Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-17833

shop/basket resets discounts added by trigger "shop addtobasket after"

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Medium Medium
    • None
    • 4.4.0
    • Legacy > Webshop
    • None

    Description

      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.

      Attachments

        Activity

          People

            unknown unknown
            vytis vytis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: