is it possible to make shop discount rule on number of items

Author Message

Vytautas Germanavičius

Tuesday 11 January 2011 7:56:20 am

I need to apply XX% discount to basket item, if user orders more than X items.

 

I made trigger "shop addtobasket after", there i thought all order items

foreach($basket->productCollection()->itemList() as $item)

{
  if($item->attribute( 'item_count') > $xxx)
  {
    $item->setAttribute( 'discount', $discountValue );

    $item->store();
  }
}


Debug print shows that values are updated.
But when shop/basket page is called , discounts are reset back to 0.

{set-block scope=root variable=cache_ttl}0{/set-block}

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.