Cart

$this->cart->getProducts();

Returns an array of all the contents in user’s basket along with other info like quantity, name, weights etc.

$this->cart->add($product_id, $quantity = 1, $option = array());

Add an item to the user’s cart with the code. First argument is the product ID, then the quantity, then the third option is an array for adding product options like colours, size, shape etc.

$this->cart->update($key, $quantity);

Updates the quantity of the products in a customer’s basket.

$this->cart->remove($key);

Remove a product from the user’s basket based on it’s key value in the getProducts() array.

$this->cart->clear();

Delete everything in the user’s basket

$this->cart->getWeight();

Get the total combined weight of everything in the user’s basket.

$this->cart->getSubTotal();

Get the subtotal of all the products in the user’s basket. This does not take into account extra order totals like handling fees, low order fees, shipping costs etc

$this->cart->getTaxes();

Get the total Tax payable on the products in the basket.

$this->cart->getTotal();

Get’s the final total for everything in the user’s basket. Including handling fees, low order fees and shipping costs (if set) etc.

$this->cart->countProducts();

Counts the number of products in the customer’s basket. This takes into account the quantity of the product so if a basket as 1 of Product A and 2 of Product B then the countProducts() will return 3.

$this->cart->hasProducts();

Checks to see if the user’s basket has anything in it. Returns true or false.

$this->cart->hasStock();

Checks to see if there is stock available for products in the user’s basket.

$this->cart->hasShipping();

Checks to see if there is a product in the user’s basket which requires shipping.

$this->cart->hasDownload();

Checks to see if there is a product in the user’s basket which is a downloadable product.

Last update: August 23rd at 11:11pm