Minimum product price after cupon code
-
Hello, I need to configure coupon codes to split discount proportionally on products. I cannot have item which cost 0 PLN it should cost at least 0,01 PLN. Please let me know how to configure it. Thanks.
Screen: https://p29.zdusercontent.com/attachment/242287/vmxTmmGFJIVeiUKfBnFLh1C3J
-
This topic was modified 2 years, 5 months ago by
twocolours.
The page I need help with: [log in to see the link]
-
This topic was modified 2 years, 5 months ago by
-
Hi @twocolours
Thanks for reaching out!
I understand that you want to distribute the coupon’s discount to your products proportionally.
Can you please share how coupons are added to your site? Is it thru the built in Coupon Management? If so, kindly please share a screenshot of your Coupons Settings here.
If you don’t already have a screenshot service installed, you can try https://snipboard.io or https://skitch.com/. You can share the direct link to the image in response to this topic.
Otherwise, if this was added thru a third-party plugin or a custom code, it would be best to reach out to the developers for further assistance here.
Thanks!
Hello,
Coupons are created vi YITH plugin Rewards and Points. The plugin creates normal amount discount coupon code (up to 95% of value of the products cart). Unfortunately it in scenario where I have 100 PLN worth of products in the cart and it will create 95 PLN discount and first product in the cart normally cost 10 PLN and second 90 PLN it will discount first product to 0 PLN and second to 5 PLN.
I reach out to YITH devs and they told me that they use standard Woo functionalities to create these coupons: https://loom.com/i/caf968d4220e4429bf52a45fe70a82d3
I would need to proportionally discount all cart products. Any product shouldn’t be in summary at 0 PLN (I can’t have free products on invoices because of the law – it generates extra taxes in my country to giving products for free).
In above scenario it should discount 10 PLN product to 0.5 PLN and 90 PLN product to 4.5 PLN.
This is how coupons look like: https://loom.com/i/71ee57ad16b843f89f26f32899f07e8b
Hello,
I need to configure coupon codes to split discount proportionally on products.
Any product shouldn’t be in summary at 0 PLN (I can’t have free products on invoices because of the law – it generates extra taxes in my country to giving products for free).
Can you please provide an example, let’s say a customer make a purchase, and they apply a coupon. Feel free to send screenshots as well.
Thank you.
Hello Igor, I recorded 2 min video to show you example: https://www.loom.com/share/2a50933a8fc744e68374d78777e440e9
Hi there @twocolours ??
Thanks for reaching out about this, and for the very helpful video recording! I’ll loop back to this:
Hello, I need to configure coupon codes to split discount proportionally on products. I cannot have item which cost 0 PLN it should cost at least 0,01 PLN. Please let me know how to configure it.
There are three discount types, when using coupons, as explained here. Also, this is how I have the settings under
WooCommerce > Settings > General
, in my test installation.This is the result of using a fixed cart discount coupon. This is the result of using a fixed product discount (notice the 0 product value), and this is the result of using a percentage discount.
Out of the three, it is safe to suggest that the option with more control on your particular scenario would be to go ahead with a percentage discount; therefore, not having a zero resulting price on any product.
I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.
-
This reply was modified 2 years, 5 months ago by
anastas10s.
Hey, thanks for replay. Yes I agree that the safest way is to use percentage coupons but I use rewards and points plugin to generate fixed coupons based of points. In that particular situation I use YITH plugin, but Woocommerce plugin works the same.
I have setup which allow user to generate coupon worth up to 95% of cart amount.
Imagine that scenario. We have 2 product in the cart first worth 10 PLN, second 90 PLN.
In first scenario 1PLN product is as a first in the cart (above second), 99PLN product as second. In the plugin I can generate max 95PLN discount (95% of cart total value). In that scenario it will discount first product to 0 PLN, and second to 5 PLN. – THIS IS BAD, BECAUSE I HAVE ZERO PLN PRODUCT IN SUMMARY AND IN INVOICE.
In second scenario 99PLN product is as a first in the cart (above second), 1PLN product as second. In the plugin I can generate max 95PLN discount (95% of cart total value). In that scenario it will discount first product to 4PLN, and second will leave at 1 PLN. – THIS IS GOOD.
Second scenario is GOOD but not always there will be situation that first product will be more valuable than 95% of cart value.
The solution is to proportionally split this 95PLN discount to all products. 95 PLN in that scenario is 95% of cart total. It would be 1PLN = 0,05PLN and 99PLN = 94,05PLN.
When someone will generate coupon worth 50PLN it would be 1PLN=0,5PLN and 99PLN=49,5PLN.
Do you get me? The problem isn’t coupon itself, because I set limit to max 95% of cart value but allocation of this coupon which causes 0PLN products in summary.
Hi there @twocolours,
I went ahead with trying the following scenario on a test installation of mine:
In first scenario 1PLN product is as a first in the cart (above second), 99PLN product as second. In the plugin I can generate max 95PLN discount (95% of cart total value). In that scenario it will discount first product to 0 PLN, and second to 5 PLN. – THIS IS BAD, BECAUSE I HAVE ZERO PLN PRODUCT IN SUMMARY AND IN INVOICE.
The coupon I used is for 95% discount and I added a 1PLN and a 99PLN product. As seen in the screenshot directly linked here, none of the two resulted in 0 price, after the discount applied.
Therefore, I’d like to put the spotlight on this for a moment:
Yes I agree that the safest way is to use percentage coupons but I use rewards and points plugin to generate fixed coupons based of points. In that particular situation I use YITH plugin
Since I am unable to reproduce the issue with the core WooCommerce functionality, this appears related to the other plugin you are clearly stating is in use at your site. As this falls outside the scope of support provided here (here’s a link to our support policy), and it appears that it is not currently available on the www.remarpro.com repo, instead it is available directly from YITH, I suggest you get in touch with them, regarding this, from their official plugin page.
I trust that points you in the right direction, but if you have more questions, let us know. We’re happy to help.
I see we don’t understand each other. The case I’m talking about is core functionalities which are used by YITH plugin.
95% of total cart value isn’t a percentage discount. This is 95% of value of the cart I can exchange for fixed amount discount. And this fixed amount discount I need to split proportionally to all cart product to not generate 0 PLN value in cheap products when fixed discount amount will be greater than value of some products in the cart.
I recorded quick video to explain it: https://www.loom.com/share/18ffa253b776499c9ff874f87e24423c
Hello @twocolours,
Thank you for sharing the video. ??
As mentioned before, this is something that has to do with the plugin controlling the coupon creation, so I’d definitely take this to the plugin author.
I did some testing using our own Points and Rewards plugin and I was able to confirm that the discounted amount was for the whole cart, the coupon didn’t discount one to 0 and match the price of the other one as you described.
Link to image: https://i.imgur.com/jbgtNfO.pngYou can try all of this yourself as the plugin has a test feature.
Link to image: https://i.imgur.com/GgjIVYv.pngHope this helps!
Thanks Saif for your replay.
I will refer to my above post where I explain why in your scenario coupon didn’t set your first product to zero value have a look: https://loom.com/i/bafa6cd2f5164bd08aee96f720e3e4d0
Try to have first product cheaper than value of coupon generated in Points and Rewards (doesn’t meter it this is YITH or Woocommerce plugin).
I tested this also with Woocommerce plugin and it also made zero value product after applaying a coupon: https://loom.com/i/53a2942800ce459c99b87fa7e6fef386
Hi there @twocolours ??
I understand that opting for a
percentage discount
coupon type is not an option for your scenario. Here’s a direct link to the coupon documentation, referring to all three types of coupons the WooCommerce core plugin supports.When opting for either a
Fixed cart discount
orFixed product discount
coupon, the risk of zeroing out a product’s value is coming into play, though.The solution would be to programmatically make adjustments that suit your particular use case.
Kindly keep in mind we are not developers and only offer support for existing functionality.
Please see our Support Policy: https://www.woocommerce.com/support-policy/
For assistance with customization or development with your site, we recommend that you seek help from:
* A local web developer
* Codeable.io
* WooExperts
* StackexchangeIf you are comfortable coding yourself and have questions, I would also recommend that you consider:
* WooCommerce developer Portal
* WooCommerce Slack Community
* Advanced WooCommerce Facebook groupI hope that helps you to figure it out.
Feel free to get back to us if you have further questions.
-
This reply was modified 2 years, 5 months ago by
anastas10s. Reason: typo
Ok. I found a solution here: https://stackoverflow.com/questions/73444301/woocommerce-product-price-0-when-apply-coupon-discount
function filter_woocommerce_coupon_get_discount_amount( $discounting_amount, $price_to_discount , $cart_item, $single, $coupon ) {
// On backorder
if ( $cart_item[‘data’]->get_price() – $discounting_amount <= 0 ) {
$discounting_amount = 0;
}
return $discounting_amount;
}
add_filter( ‘woocommerce_coupon_get_discount_amount’, ‘filter_woocommerce_coupon_get_discount_amount’, 10, 5 );`We can close
I’m glad a solution was found, @twocolours, and thank you for referencing it here, for others to benefit from it also!
-
This reply was modified 2 years, 5 months ago by
- The topic ‘Minimum product price after cupon code’ is closed to new replies.