This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:on_deleteCartItem AJAX handler

Defined in /modules/shop/classes/shop_actions.php, lines 672-687
Author LemonStand eCommerce Inc.
Removes an item from the cart. Usually this AJAX handler used on the Cart page together with shop:cart action. You can use this handler for creating the Remove Item links for individual cart items. The following example creates the Remove Item link which sends the shop:on_deleteCartItem AJAX request to LemonStand and updates the cart page content on success.
<a onclick="return $(this).getForm().sendRequest(
  'shop:on_deleteCartItem', 
  {update: {'cart_page': 'cart_partial'}, 
  confirm: 'Do you really want to remove this item from the cart?', 
  extraFields: {key: '<?= $item->key ?>'}})" 
href="#">Remove Item</a>

See Also

Supported form fields

Field Type Description
key string specifies a key of a shopping cart item to remove, required.
cart_name string specifies the shopping cart name, the default value is main.

Generated PHP variables

Variable Type Description
countries Db_DataCollection a collection of countries for populating the country list for the Estimate Shipping Cost feature.
states Db_DataCollection a list of states for a currently selected country.
shipping_info Shop_CheckoutAddressInfo a customer's shipping location.
discount float a discount value, calculated using the price rules, defined on the Shop/Discounts page in the Administration Area.
applied_discount_rules array a list of discount rules applied to the cart products.
cart_total float a sum of all cart items.
subtotal float a sum of all cart items. Matches the $cart_total variable value.
cart_total_tax_incl float cart total, including tax.
cart_tax float a total tax amount for all cart items.
cart_taxes array a list of all taxes applied to the cart items.
coupon_code string a coupon code provided by the customer.

Supported form field details

key form field

Specifies a key of a shopping cart item to remove, required.

cart_name form field

Specifies the shopping cart name, the default value is main.

Generated PHP variable details

countries variable

Db_DataCollection $countries;
A collection of countries for populating the country list for the Estimate Shipping Cost feature. Each element in the collection is an object of the Shop_Country class.

states variable

A list of states for a currently selected country. Each element in the collection is an object of the Shop_CountryState class.

shipping_info variable

Shop_CheckoutAddressInfo $shipping_info;
A customer's shipping location. For new customers all fields in the object are empty.

discount variable

float $discount;
A discount value, calculated using the price rules, defined on the Shop/Discounts page in the Administration Area. The discount value can be not accurate on the Cart page, because price rules can refer to customer details like the shipping location which are not known on the Cart page and will become available only during the checkout process.

applied_discount_rules variable

array $applied_discount_rules;
A list of discount rules applied to the cart products. Each element in the array is an object with two fields: rule (Shop_CartPriceRule object) and discount. You can use this variable for displaying a list of applied discounts. Example:
<h3>Applied discounts</h3>
<? foreach ($applied_discount_rules as $rule_info): ?>
  <p>
    <?= $rule_info->rule->name ?> 
    <?= $rule_info->rule->description ?> - 
    <?= format_currency($rule_info->discount) ?><br/>
  </p>
<? endforeach ?>

cart_total variable

float $cart_total;
A sum of all cart items.

subtotal variable

float $subtotal;
A sum of all cart items. Matches the $cart_total variable value.

cart_total_tax_incl variable

float $cart_total_tax_incl;
Cart total, including tax. If the Display catalog/cart prices including tax feature is enabled, this variable value will match the $cart_total variable value.

cart_tax variable

float $cart_tax;
A total tax amount for all cart items.

cart_taxes variable

array $cart_taxes;
A list of all taxes applied to the cart items. Each element in the array is an object with two fields: name, total.

coupon_code variable

string $coupon_code;
A coupon code provided by the customer.