You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.
Hi Nick
Can you give me a pointer please.
Custom items are being added to cart using the forceprice variable and all works correctly.
However, I can't get the wholesale discounts to apply to any product using forceprice.
Wholesale system does works correctly on normal products, so it is set up correctly.
I am looking at buildpricedisp() in ECOM.php as this appears to be where the discount is applied and the regprice updated.
But it gets the regprice from the pricemap table, not the updated regprice in the cart table.
Any ideas?
Offline
Custom items are being added to cart using the forceprice variable and all works correctly.
How? Let's back up a bit. You're getting custom items into the cart, I'd like to know how that is happening. What variables are being passed? Are the custom items showing up with the correct price in the store (retail or wholesale) but then not when added to the cart? What function adds them to the cart?
Forceprice is a flag that's used when adding to the cart to force the price to the price passed. There would be no discounting past that point, so it would make most sense for you to calculate the wholesale discounted price in your add to cart function (assuming it's custom) then pass that with the forceprice flag. The system assumes you want the price you're passing in, period. Which makes sense, because if it did anything else with it, that would likely be undesirable in most instances.
FYI: forceprice is normalized to the system currency and stored with any VAT excluded. These changes are made to the passed price so it becomes something the system can work with, but they don't represent a fundamental change to the price passed.
Offline
Hi Nick
Forceprice is being used as suggested by you https://forum.kryptronic.com/viewtopic.php?id=33306
Everything works fine when adding to cart. All prices are correct and various custom fields are passed correctly.
I don't think I can get wholesale pricing to work using the current system as the price is checked against the inventory item price, not the overridden price from the cart table. Looks like I would need to pass my updated price to cart_loadoffers() along with the offerid, and then override the inventory price buildprodoffers().
It will be much easier to add the discount when the price is initially calculated, but I wanted to avoid this as it means the user would need to be logged in when the items were added to the basket. Or I might just add an automated discount code for wholesale users so the discount is applied on the checkout page.
Offline
Worked out the easiest way was too add a check in the custom sale method for wholesale account, and then discount subtotal at checkout.
This works fine as I only have a few wholesale accounts and one discount level.
Offline
Glad you've got a workaround, but I'm not sure what the issue is with the forceprice variable. I think if you set your wholesale pricing then passed that as 'forceprice' you'd get what you wanted.
Offline
Glad you've got a workaround, but I'm not sure what the issue is with the forceprice variable.
Wholesale User goes to site, add a few items to cart, goes to checkout and then logs in. Discount isn't applied as when the items were added to cart they weren't logged in.
Using a custom sale script, the discount is added at checkout so it doesn't matter if the user forgets to log in.
Offline
Moving on slightly, when a pay on account order is placed, can I get the order status as pending shipment, not pending review??
Offline