Checkout disabled?
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Checkout disabled?
I wrote a plugin to automatically discount products in the basket based on quantity. Everything works except that once I've updated the price of the item in the basket, the checkout button disappears.
I'd prefer not to use a coupon. Basically, we have 5 or 6 different product types in the store. For 2 of those types, the price per item goes down based on the total quantity of that type item in the basket.
Example:
Products A, B, and C are type widget and cost $1.95.
Product D is type thingy and costs $5.00.
User adds Product A to basket. $1.95. (quantity 1 of type widget)
User adds Product D to basket. No price changes. (quantity 1 of type widget)
User adds Product B to basket. Price for Products A and B in basket should both now be $1.80. (quantity 2 of type widget)
User updates quantity of Product A in basket to 2. Price for products A and B should now both be $1.65. (quantity 3 of type widget)
User removes Product B from basket. Price for Product A should now be $1.80. (quantity 2 of type widget)
User updates quantity of Product A in basket to 1. Price for product A should now be $1.95 (quantity 1 of type widget).
I'm using something along the lines of:
I get the feeling I should be modifying the price a different way? Is there a way to do this without making the Checkout button disappear?
I'd prefer not to use a coupon. Basically, we have 5 or 6 different product types in the store. For 2 of those types, the price per item goes down based on the total quantity of that type item in the basket.
Example:
Products A, B, and C are type widget and cost $1.95.
Product D is type thingy and costs $5.00.
User adds Product A to basket. $1.95. (quantity 1 of type widget)
User adds Product D to basket. No price changes. (quantity 1 of type widget)
User adds Product B to basket. Price for Products A and B in basket should both now be $1.80. (quantity 2 of type widget)
User updates quantity of Product A in basket to 2. Price for products A and B should now both be $1.65. (quantity 3 of type widget)
User removes Product B from basket. Price for Product A should now be $1.80. (quantity 2 of type widget)
User updates quantity of Product A in basket to 1. Price for product A should now be $1.95 (quantity 1 of type widget).
I'm using something along the lines of:
Code: Select all
$product->getPrice()->setValue($newPrice);
Re: Checkout disabled?
The checkout button only disappears if another plugin returns false for the check.before or check.after events. The BasketLimits plugin does this for example. Simply disable all plugins you don't need in the admin interface.swpierce wrote: I get the feeling I should be modifying the price a different way? Is there a way to do this without making the Checkout button disappear?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Checkout disabled?
Got it. Didn't think about the other plugins. The problem was the ProductPrice plugin. Assuming it was returning false because I was changing the prices.
Haven't got to the point of dealing with saved/abandoned baskets yet. It would be nice to have the ProductPrice plugin work in case a product's price changed between when the customer saved the cart and when they came back to buy. I'll have to see if I can figure out a way to make it work without interfering with our quantity discount plugin.
Thanks!
Haven't got to the point of dealing with saved/abandoned baskets yet. It would be nice to have the ProductPrice plugin work in case a product's price changed between when the customer saved the cart and when they came back to buy. I'll have to see if I can figure out a way to make it work without interfering with our quantity discount plugin.
Thanks!
Re: Checkout disabled?
A problem is that your discount is based on the quantity of several products. If the discount would based on single products, you could use the block pricing instead.swpierce wrote: Haven't got to the point of dealing with saved/abandoned baskets yet. It would be nice to have the ProductPrice plugin work in case a product's price changed between when the customer saved the cart and when they came back to buy. I'll have to see if I can figure out a way to make it work without interfering with our quantity discount plugin.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Checkout disabled?
Very true. Our customers never buy more than 1 of a given product in any shopping session, though. They do, however, buy multiple products in every shopping session. The block pricing won't work for us. We'll definitely come up with a solution though.