
Public Member Functions | |
| getCart () | |
| getAddUrl ($product, $additional=array()) | |
| getRemoveUrl ($item) | |
| getCartUrl () | |
| getQuote () | |
| getItemsCount () | |
| getItemsQty () | |
| getSummaryCount () | |
| getIsVirtualQuote () | |
Definition at line 32 of file Cart.php.
| getAddUrl | ( | $ | product, | |
| $ | additional = array() | |||
| ) |
Retrieve url for add product to cart
| Mage_Catalog_Model_Product | $product |
Identify continue shopping url
go to product view page
go to category view page
Definition at line 50 of file Cart.php.
00051 { 00052 /** 00053 * Identify continue shopping url 00054 */ 00055 // if ($currentProduct = Mage::registry('current_product')) { 00056 // /** 00057 // * go to product view page 00058 // */ 00059 // $continueShoppingUrl = $currentProduct->getProductUrl(); 00060 // } elseif ($currentCategory = Mage::registry('current_category')) { 00061 // /** 00062 // * go to category view page 00063 // */ 00064 // 00065 // $continueShoppingUrl = $currentCategory->getUrl().(count($this->_getRequest()->getQuery())!=0?'?'.http_build_qu//ery($this->_getRequest()->getQuery(), '', '&'):''); 00066 // 00067 // } else { 00068 // $continueShoppingUrl = $this->_getUrl('*/*/*', array('_current'=>true)); 00069 // } 00070 00071 $continueShoppingUrl = $this->getCurrentUrl(); 00072 00073 $params = array( 00074 Mage_Core_Controller_Front_Action::PARAM_NAME_URL_ENCODED => Mage::helper('core')->urlEncode($continueShoppingUrl), 00075 'product' => $product->getId() 00076 ); 00077 00078 if ($this->_getRequest()->getRouteName() == 'checkout' 00079 && $this->_getRequest()->getControllerName() == 'cart') { 00080 $params['in_cart'] = 1; 00081 } 00082 00083 if (count($additional)){ 00084 $params = array_merge($params, $additional); 00085 } 00086 00087 return $this->_getUrl('checkout/cart/add', $params); 00088 }
| getCart | ( | ) |
Retrieve cart instance
Definition at line 39 of file Cart.php.
00040 { 00041 return Mage::getSingleton('checkout/cart'); 00042 }
| getCartUrl | ( | ) |
| getIsVirtualQuote | ( | ) |
| getItemsCount | ( | ) |
| getItemsQty | ( | ) |
| getQuote | ( | ) |
Retrieve current quote instance
Definition at line 120 of file Cart.php.
00121 { 00122 return Mage::getSingleton('checkout/session')->getQuote(); 00123 }
| getRemoveUrl | ( | $ | item | ) |
Retrieve url for remove product from cart
| Mage_Sales_Quote_Item | $item |
Definition at line 96 of file Cart.php.
00097 { 00098 $params = array( 00099 'id'=>$item->getId(), 00100 Mage_Core_Controller_Front_Action::PARAM_NAME_BASE64_URL => $this->getCurrentBase64Url() 00101 ); 00102 return $this->_getUrl('checkout/cart/delete', $params); 00103 }
| getSummaryCount | ( | ) |
1.5.8