500 error on product detail page after deleting product variation and using tieredpricing app

Issue #1336 new
Eric Bartels created an issue

To reproduce:
* Create a product and some variations.
* Delete a product variation. * Visit the product detail page on the site.

This will throw Product.DoesNotExist since deleting a product does not delete its entry in ProductPriceLookup table. Consequently when tiered_price_listener is called you get the error.

Comments (3)

  1. Chris Moffitt repo owner

    I'm assuming that if you call rebuild_pricing then it would be ok? There's been talk about automating this in the past but I can't recall any patches to do this.

  2. Eric Bartels reporter

    Yes, rebuild_pricing would fix it. But I can't ask the client to wait until the next cron job runs whenever they make changes to the product catalog. The pricing table getting out of sync seems to be a pain point leading to a number of issues.

    But I think calling rebuild_pricing is overkill. The current store I'm working on has about 15 thousand products including variations, so it takes a while to rebuild the entire table, making it unfeasible to call automatically in response to product updates. A more fine-grained solution is required to keep things in sync. Maybe some signals to update only the effected rows when changes are made to product prices.

  3. Chris Moffitt repo owner

    You're probably right. I would need to look at the code to see what it is doing and how to be more fine-grained about it all.

  4. Log in to comment