1

I would like to apply catalog price rules based on a session variable that I will store for some customer segments. For example, if a customer visits the site with a specific URL parameter, I would apply some catalog price rules, that will accompany the customer throughout his visit in the site.

-- EDIT -- Another option, could be, to assign a guest customer to a customer group somehow, and the group can be associated with catalog price rule.

Shay Zalman
  • 353
  • 2
  • 9

1 Answers1

0

This is a reasonable request however customers are familiar with websites that use coupons.

You can add a coupon by observing a landing page and applying a coupon to a basket, then showing a customer message that tells them coupon NNN has been applied and that they will get their discount at the checkout automatically.

    $quote = $this->checkoutSession->getQuote();
    $quote->setCouponCode($couponCode)->collectTotals()->save();

Works great, with Magento1 you needed to store a coupon in a cookie and apply it when something was added to the cart. With M2 there is no need for this, you can add an observer that just does the above.

Mavis Bacon
  • 101
  • 1
  • Hi Mavis, my idea is to apply the discount prices to the catalog, before it is in the cart – Shay Zalman Nov 20 '19 at 10:14
  • I would say that it cannot be done and that you would be better to advise your client that the customer is used to the automatic coupon approach. I wish you luck! – Mavis Bacon Nov 20 '19 at 10:42