Product Price Changes - When to do it?

We stock product from multiple drop-ship distributors and run inventory/price PHP programs in cron that gets the current product file from our distributors and updates the cscart_products and cscart_product_prices tables to reflect current inventory and prices. These PHP programs run throughout the day, some every 30 min, some every hour, some once a day based on when the distributor updates their product file.

This works very well except for one issue. When a customer adds a product to their cart, the price is whatever the price currently is in the tables. However, if our program runs and changes the price of that same product before the customer finishes checking out, the price will change in their cart. This is OK I suppose if the price goes down (and I haven’t gotten complaints on that), but if a customer puts a $20 item in their cart and the price changes to $25, that’s when I get complaint calls or emails along with an abandoned cart.

I know I am not the only merchant who changes pricing on products, the question I have for you all, is when do you do that to avoid this issue? Even if the price is changed manually via the admin panel, the customer will see the price change reflected in their cart before they checkout. So do I change prices only once a day and hope for the best? Or is there a way to lock the product price once it’s in a cart or some other method that I cant see?

Appreciate any help or guidance you can give.


You could update them once a day at midnight and then stipulate that the prices are subject to change daily

You might want to review this defect before enabling auto-updates of product pricing…


Thanks for the replies. I’ll update that bug with my comments, it’s along the same lines as the bug but a little different in that the bug refers to orders changing after checkout, my issue refers to an order changing during checkout. I understand if a customer puts a product into his/her cart and the price changes before they start checking out, but it shouldn’t be allowed to change once the checkout process has begun even if the price is changed on the back end.

Hopefully we’ll see some improvement in 2.0.15 or 2.1. For now I’ll see if there is a table or tables I can look up to see if an order is in progress and not update pricing on the product(s) in that order. It might be the cscart_orders* tables but I imagine those hold completed orders and in-progress orders are done via cookies and PHP code. I’ll post back if I come up with something.

Unfortunately for your situation, the ‘cart’ is held in the user’s session. The cart object only contains the product_id and any option id’s that were selected. Pricing and discounts are resolved at run-time. When the cart is displayed, it shows the “then current” pricing and other properties of the product (options, etc.).

Your “update” is running in the admin AREA and under a different user. There’s no way for you to tell whether someone has an active cart containing a modified product or not (though carts are stored, but it is part of the session management).

I would not add this issue to that bug since it is an entirely different issue.

[quote name=‘tbirnseth’]

I would not add this issue to that bug since it is an entirely different issue.[/QUOTE]

I agree, I created a new Idea with my issues: [url][/url]