LemonStand Documentation

shop:onGetCartItemPrice event

The shop:onGetCartItemPrice event allows to override a price of an item in the shopping cart. The handler should accept a single parameter - an object of the Shop_CartItem class. The overridden price will be correctly processed by the discount and tax engines.

Event handler example:

public function subscribeEvents()
{
  Backend::$events->addEvent('shop:onGetCartItemPrice', $this, 'get_cart_price');
}
 
public function get_cart_price($cart_item)
{
  if ($cart_item->product->sku == '26268880')
    return 10;
}

Next: shop:onExtendOrderItemModel event
Previous: shop:onDisplayProductList event
Return to Handling LemonStand events