Example #1
0
 private function prepareCartPrice()
 {
     $productM = VmModel::getModel('product');
     $usermodel = VmModel::getModel('user');
     $currentVMuser = $usermodel->getCurrentUser();
     if (!is_array($currentVMuser->shopper_groups)) {
         $virtuemart_shoppergroup_ids = (array) $currentVMuser->shopper_groups;
     } else {
         $virtuemart_shoppergroup_ids = $currentVMuser->shopper_groups;
     }
     foreach ($this->products as $cart_item_id => &$product) {
         $product->virtuemart_category_id = $this->getCardCategoryId($product->virtuemart_product_id);
         //$product = $productM->getProduct($product->virtuemart_product_id,true, true, true, $product->quantity);
         $productM->getProductPrices($product, $product->quantity, $virtuemart_shoppergroup_ids, true, true);
         // No full link because Mail want absolute path and in shop is better relative path
         $product->url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id, FALSE);
         //JHTML::link($url, $product->product_name);
         if (!empty($product->customfieldsCart)) {
             if (!class_exists('VirtueMartModelCustomfields')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'customfields.php';
             }
             $product->customfields = VirtueMartModelCustomfields::CustomsFieldCartDisplay($cart_item_id, $product);
         } else {
             $product->customfields = '';
         }
         $product->cart_item_id = $cart_item_id;
     }
 }
Example #2
0
 private function prepareCartPrice($prices)
 {
     foreach ($this->products as $cart_item_id => $product) {
         $product->virtuemart_category_id = $this->getCardCategoryId($product->virtuemart_product_id);
         // No full link because Mail want absolute path and in shop is better relative path
         $product->url = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id=' . $product->virtuemart_product_id . '&virtuemart_category_id=' . $product->virtuemart_category_id);
         //JHTML::link($url, $product->product_name);
         if (!empty($product->customfieldsCart)) {
             if (!class_exists('VirtueMartModelCustomfields')) {
                 require JPATH_VM_ADMINISTRATOR . DS . 'models' . DS . 'customfields.php';
             }
             $product->customfields = VirtueMartModelCustomfields::CustomsFieldCartDisplay($cart_item_id, $product);
             // 				vmdebug('prepareCartPrice',$product->customfields);
         } else {
             $product->customfields = '';
         }
         // 			$product->salesPrice = empty($prices[$cart_item_id]['salesPrice'])? 0:$prices[$cart_item_id]['salesPrice'];
         // 			$product->basePriceWithTax = empty($prices[$cart_item_id]['salesPrice'])? 0:$prices[$cart_item_id]['basePriceWithTax'];
         // 			$product->basePriceWithTax = $prices[$cart_item_id]['basePriceWithTax'];
         // 			$product->subtotal = $prices[$cart_item_id]['subtotal'];
         // 			$product->subtotal_tax_amount = $prices[$cart_item_id]['subtotal_tax_amount'];
         // 			$product->subtotal_discount = $prices[$cart_item_id]['subtotal_discount'];
         // 			$product->subtotal_with_tax = $prices[$cart_item_id]['subtotal_with_tax'];
         $product->cart_item_id = $cart_item_id;
     }
 }