Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prices are not reset when promotion ends in all cases #53

Open
loevgaard opened this issue Jul 8, 2021 · 0 comments
Open

Prices are not reset when promotion ends in all cases #53

loevgaard opened this issue Jul 8, 2021 · 0 comments

Comments

@loevgaard
Copy link
Member

The process promotions command is divided into three phases:

  1. Mark the products we need to handle
  2. Update the multiplier on products based on rules
  3. Update the prices based on the computed multiplier

In phase 1 we set the multiplier to 1 on all products where multiplier != 1. We do this in a loop. This means we can successfully change the multiplier on some products and then the loop can throw an exception or deadlock or whatever. Now these products are in kind of a limbo because they won't be selected the next time the command runs (because it filters on multiplier != 1) and this in turn means that we can have products where the price isn't reset, i.e. phase 3 doesn't reset the prices because those products are not in the bulk of products being processed.

Basically what we need to run somehow is:

UPDATE sylius_channel_pricing SET price = original_price WHERE multiplier = 1 AND manually_discounted = 0 AND original_price is not null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant