Exemple #1
0
if (count($shipping_template) > 0 && $shipping_template[0]->template_desc) {
    $template_desc = $shipping_template[0]->template_desc;
} else {
    $template_desc = "<fieldset class=\"adminform\"><legend><strong>{shipping_heading}</strong></legend>\r\n<div>{shipping_method_loop_start}\r\n<h3>{shipping_method_title}</h3>\r\n<div>{shipping_rate_loop_start}\r\n<div>{shipping_rate_name} {shipping_rate}</div>\r\n{shipping_rate_loop_end}</div>\r\n{shipping_method_loop_end}</div>\r\n</fieldset>";
}
if ($this->users_info_id > 0) {
    $shippinghelper = new shipping();
    $shippingBoxes = $shippinghelper->getShippingBox();
    $selshipping_box_post_id = 0;
    if (count($shippingBoxes) > 0) {
        $selshipping_box_post_id = $shippingBoxes[0]->shipping_box_id;
    }
    if (isset($post['shipping_box_id'])) {
        $shipping_box_post_id = $post['shipping_box_id'];
    } else {
        $shipping_box_post_id = $selshipping_box_post_id;
    }
    $box_template_desc = $carthelper->replaceShippingBoxTemplate($box_template_desc, $shipping_box_post_id);
    echo eval("?>" . $box_template_desc . "<?php ");
    $returnarr = $carthelper->replaceShippingTemplate($template_desc, $this->shipping_rate_id, $shipping_box_post_id, $user->id, $this->users_info_id, $this->ordertotal, $this->order_subtotal);
    $template_desc = $returnarr['template_desc'];
    $this->shipping_rate_id = $returnarr['shipping_rate_id'];
    echo eval("?>" . $template_desc . "<?php ");
} else {
    ?>
	<div class="shipnotice"><?php 
    echo JText::_('COM_REDSHOP_FILL_SHIPPING_ADDRESS');
    ?>
</div>
<?php 
}
Exemple #2
0
 /**
  * One Step checkout process
  *
  * @return void
  */
 public function oneStepCheckoutProcess()
 {
     $producthelper = new producthelper();
     $redTemplate = new Redtemplate();
     $carthelper = new rsCarthelper();
     $order_functions = new order_functions();
     $model = $this->getModel('checkout');
     $post = JRequest::get('post');
     $user = JFactory::getUser();
     $session = JFactory::getSession();
     $cart = $session->get('cart');
     $users_info_id = $post['users_info_id'];
     $shipping_box_id = $post['shipping_box_id'];
     $shipping_rate_id = $post['shipping_rate_id'];
     $customer_note = $post['customer_note'];
     $req_number = $post['requisition_number'];
     $customer_message = $post['rs_customer_message_ta'];
     $referral_code = $post['txt_referral_code'];
     $payment_method_id = $post['payment_method_id'];
     $order_total = $cart['total'];
     $total_discount = $cart['cart_discount'] + $cart['voucher_discount'] + $cart['coupon_discount'];
     $order_subtotal = SHIPPING_AFTER == 'total' ? $cart['product_subtotal'] - $total_discount : $cart['product_subtotal_excl_vat'];
     $Itemid = $post['Itemid'];
     $objectname = $post['objectname'];
     $rate_template_id = $post['rate_template_id'];
     $cart_template_id = $post['cart_template_id'];
     $onestep_template_desc = "";
     $rate_template_desc = "";
     if ($objectname == "users_info_id" || $objectname == "shipping_box_id") {
         if ($users_info_id > 0) {
             $shipping_template = $redTemplate->getTemplate("redshop_shipping", $rate_template_id);
             if (count($shipping_template) > 0) {
                 $rate_template_desc = $shipping_template[0]->template_desc;
             }
             $returnarr = $carthelper->replaceShippingTemplate($rate_template_desc, $shipping_rate_id, $shipping_box_id, $user->id, $users_info_id, $order_total, $order_subtotal);
             $rate_template_desc = $returnarr['template_desc'];
             $shipping_rate_id = $returnarr['shipping_rate_id'];
         } else {
             $rate_template_desc = JText::_('COM_REDSHOP_FILL_SHIPPING_ADDRESS');
         }
     }
     if ($shipping_rate_id != "") {
         $shipArr = $model->calculateShipping($shipping_rate_id);
         $cart['shipping'] = $shipArr['order_shipping_rate'];
         $cart['shipping_vat'] = $shipArr['shipping_vat'];
         $cart = $carthelper->modifyDiscount($cart);
     }
     if ($cart_template_id != 0) {
         $templatelist = $redTemplate->getTemplate("checkout", $cart_template_id);
         $onestep_template_desc = $templatelist[0]->template_desc;
         $onestep_template_desc = $model->displayShoppingCart($onestep_template_desc, $users_info_id, $shipping_rate_id, $payment_method_id, $Itemid, $customer_note, $req_number, '', $customer_message, $referral_code);
     }
     $display_shippingrate = '<div id="onestepshiprate">' . $rate_template_desc . '</div>';
     $display_cart = '<div id="onestepdisplaycart">' . $onestep_template_desc . '</div>';
     $description = $display_shippingrate . $display_cart;
     $lang = JFactory::getLanguage();
     $Locale = $lang->getLocale();
     if (in_array('ru', $Locale)) {
         // Commented because redshop currency symbole has been changed because of ajax response
         $description = html_entity_decode($description, ENT_QUOTES, 'KOI8-R');
     }
     $cart_total = $producthelper->getProductFormattedPrice($cart['mod_cart_total']);
     echo "`_`" . $description . "`_`" . $cart_total;
     die;
 }