Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › % Discount + Free Product By Brand
- This topic has 5 replies, 2 voices, and was last updated 6 years, 1 month ago by matts.
-
AuthorPosts
-
July 20, 2017 at 1:17 pm #1679mattsParticipant
hi guys – our scenario is this:
* coupon applies 10% discount on products within 2 of our 10 or so brands – using Woocommerce Brands plugin
* coupon also adds a free add-on to the orderI can get the coupon to work fine with a Fixed Product Discount but if I change to Percentage Discount, the free product appears but the discount isn’t applied to the lead product.
I can get the discount to appear OR the free product but not both at the same time.
Any idea what I might be missing?
July 20, 2017 at 7:53 pm #1684Soft79KeymasterHi, if you temporarily disable our plugin, and you set the discount to Percentage Discount. Is the discount applied then?
If so, please send me a screenshot of your coupon settings and an url to your store with instructions to reproduce the issue.
July 21, 2017 at 1:36 am #1691mattsParticipantHi, If I disable the plugin the 10% discount applies.
If I enable the plugin with the following settings:
*percentage discount
*amount 10
*product brands: brand 1, brand 2
*minimum quantity of products: no minimum
*allow discount on cart with excluded: check
*limit discount to: default
*free product: product 1Free Product is added but discount not applied.
*percentage discount
*amount 10
*product brands: brand 1, brand 2
*minimum quantity of products: no minimum
*allow discount on cart with excluded: check
*limit discount to: default
*free product: product 1
*allow multiplication: checkDiscount shows but no free product
July 21, 2017 at 2:44 am #1693Soft79KeymasterHi, what version of our plugin are you using? Can you please send me the brands plugin (to admin at soft79.nl) so we can try to reproduce the issue?
August 1, 2017 at 7:57 am #1750Soft79KeymasterI think the issue is caused by the Brands plugin. They seemed to have missed a change in WC2 -> WC3 causing percent-discounts to fail. Please try this:
Open the file woocommerce-brands/includes/class-wc-brands.php, replace the following lines:
Line #202:
if ( ! is_a( $this_obj, 'WC_Coupon' ) || ! $this_obj->is_type( array( 'fixed_product', 'percent_product' ) ) ) {
replace with:
if ( ! is_a( $this_obj, 'WC_Coupon' ) || ! $this_obj->is_type( array( 'fixed_product', 'percent_product', 'percent' ) ) ) {
Line #318:
if ( $coupon_obj->is_type( array( 'fixed_cart', 'percent' ) ) && $num_items_match_included < sizeof( WC()->cart->get_cart() ) ) {
replace with:
if ( $coupon_obj->is_type( array( 'fixed_cart' ) ) && $num_items_match_included < sizeof( WC()->cart->get_cart() ) ) {
Line #367:
if ( $coupon_obj->is_type( array( 'fixed_cart', 'percent' ) ) && $num_items_match_excluded > 0 ) {
replace with:
if ( $coupon_obj->is_type( array( 'fixed_cart' ) ) && $num_items_match_excluded > 0 ) {
Also, in your coupon disable ‘allow multiplication’. Now all should work as expected. If so, please inform the WooCommerce guys of the issue in the Brands plugin.
August 2, 2017 at 2:13 am #1753mattsParticipantOK that worked – thanks for the help guys – I’ll give the chaps at Woo the heads-up.
-
AuthorPosts
- You must be logged in to reply to this topic.