Current
Access and modify the shopping cart of the current visitor.
Methods
Invoke via \Components\Commerce\Carts\Current::method()
Click a method name to copy it.
Adds a product to the shopping cart
product_id => The id of the product to add to the cart product_quantity => The quantity to add to the cart product_order_options_user => User selected options when ordering a product product_price => Price disable_merge => When true, if an identical product already exists in the cart, no merge will occur bought_for_contact_id => Allows the product to be linked to a different contact product_title => Used only if no product_id set product_sales_description => Sales invoice description ]
Adds products to the shopping cart
[ [ product_id => The id of the product to add to the cart product_quantity => The quantity to add to the cart product_order_options_user => User selected options when ordering a product product_price => Price disable_merge => When true, if an identical product already exists in the cart, no merge will occur bought_for_contact_id => Allows the product to be linked to a different contact product_title => Used only if no product_id set product_sales_description => Sales invoice description ], ... ]
Returns the shipment items
Parameters
$arrOrderOptionsPost
mixed
Returns the shopping cart as an array with the details of the products, calculated tax and shipping
Return
Products in shopping cart
Returns any comments the customer may have on their order
Returns the number of item rows in the shopping cart
Returns the total quantity of products in the shopping cart
Return
Number of products
Returns the country of the contact uses this cart
Returns the current currency id
Returns an array of discounts for this order
Returns whether or not the 'guest checkout' option is disabled for cart.
This is derived from the products in the cart.
Returns whether shipping is required for the products currently in the cart
Returns whether the cart is submittable or not
Retrieves the order minimum value as configured in the config item
Returns the payment method used when the order is processed
Retrieves the ordered quantity for a specific product for a specific contact
Returns the product_id for a particular row of items in the cart
Returns a column of the orders shipping details
Returns an array of any errors encountered when calculating shipping
Returns the configuration options for the shipping method
Returns the page of the recommended step in the ordering process
Returns the total dollar value of the items in the shopping cart
Returns the dollar value total of just the products in the cart
Return
Total for products
Returns the dollar value total of the shipping
Returns the dollar value total tax for the items in the cart
Returns the label for the tax rate - eg: 'GST'
Returns the tax rate - eg: '10%'
Returns the total weight for the cart.
Returns whether the cart has free shipping
Returns whether the cart has discounts
Determines if a cart item is custom or if corresponds to a product
Returns whether or not a product has been added to the cart
Parameters
$iProductCategoryId
mixed
Returns whether a product has been added to the cart
Adds a product to the cart with quantity $iQuantity
If the product already exists in the cart, the quantity is increased by $iQuantity
TODO: deprecate
Removes all the items from the cart.
Removes all items in the cart that do not have quantity
Removes all of a particular product from the cart
Renders any extra pricing information such as discounts or payment method hooks
Sets any comments the customer may have on their order
Sets the context of the contact who owns the cart
Note: Setting this value only persists for the length of the current request
When set to true, the invoice will be created on the contact's company on cart completion
Parameters
$bContactShouldInvoiceCompany
mixed
Updates a row in the cart to have a different quantity / options
If the product already exists in the cart, the quantity is set to $iQuantity