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

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Obsolete
    • Affects Version/s: 4.4.0
    • Fix Version/s: None
    • Component/s: Legacy > Webshop
    • Labels:
      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

            Assignee:
            unknown unknown
            Reporter:
            vytis Vytautas Germanavičius
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated: