You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have created a custom price calculation for a project, in where you can order a product (a fabric in this case) per meter. So in craft the variant has the price for 1m as the defaultPrice (say $20,-), and when people order this fabric, they fill in the amount of meters they want (for example 2m). Then the lineitem is saved as qty 1 and an option in where the length 2m is saved. We also calculate the price for this lineItem as 2 * the default price (2 * $20 = $40 in this case).
This works fine. But now our client has created a discount code, which only has to work if the total order amount is over $100,-.
And now it doesn't apply the discount, because i think it uses the purchasable price * the quantity.
For example, a customer has ordered 6m of the fabric and has a order of $120,- now. They should get the discount, because the order amount is over $100,-. But they discount isn't subtracted. Only when I add 6x 1m of this fabric in the cart, I get the discount.
Expected behavior
If i have a lineItem with the total price over the amount set in the discount, it should apply the discount
Actual behavior
Craft CMS version
5.5.7
Craft Commerce version
5.2.10
PHP version
8.3.8
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
What happened?
Description
We have created a custom price calculation for a project, in where you can order a product (a fabric in this case) per meter. So in craft the variant has the price for 1m as the defaultPrice (say $20,-), and when people order this fabric, they fill in the amount of meters they want (for example 2m). Then the lineitem is saved as qty 1 and an option in where the length 2m is saved. We also calculate the price for this lineItem as 2 * the default price (2 * $20 = $40 in this case).
This works fine. But now our client has created a discount code, which only has to work if the total order amount is over $100,-.
And now it doesn't apply the discount, because i think it uses the purchasable price * the quantity.
For example, a customer has ordered 6m of the fabric and has a order of $120,- now. They should get the discount, because the order amount is over $100,-. But they discount isn't subtracted. Only when I add 6x 1m of this fabric in the cart, I get the discount.
Expected behavior
If i have a lineItem with the total price over the amount set in the discount, it should apply the discount
Actual behavior
Craft CMS version
5.5.7
Craft Commerce version
5.2.10
PHP version
8.3.8
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: