Viewing 9 replies - 16 through 24 (of 24 total)
  • I have been having the same problem and I think I have some info that will help find the cause of the discount being removed. I am using Divi and woocommerce on my site and it currently only accepts paypal. When a customer checks out as a guest the discount works fine. If a customer logs in as a returning customer and makes an order the discount works fine. The only time the discount is removed is when a new customer “creates an account” on the checkout page. I hope this helps! I will make a donation also when this gets fixed! Thank you!

    I think I’ve found a fix. I was able to reproduce the bug just like @stephen.loera – it happened whenever I created a new account during checkout. But I’ve managed to fix it on my own site.

    I’ve submitted a pull request to the author of the plugin, so hopefully he’ll update it soon.

    In the meantime, you can manually change your woocommerce-bulk-discount.php to use this updated code for the action_after_calculate function:

    // line 437
    		public function action_after_calculate( WC_Cart $cart ) {
    			if ( $this->coupon_check() ) {
    				return;
    			}
    			if ( !$this->bulk_discount_calculated) {
    				return;
    			}
    			if ( sizeof( $cart->cart_contents ) > 0 ) {
    				foreach ( $cart->cart_contents as $cart_item_key => $values ) {
    					$_product = $values['data'];
    					if ( get_post_meta( $_product->id, "_bulkdiscount_enabled", true ) != '' && get_post_meta( $_product->id, "_bulkdiscount_enabled", true ) !== 'yes' ) {
    						continue;
    					}
    					$values['data']->set_price( $this->discount_coeffs[$this->get_actual_id( $_product )]['orig_price'] );
    				}
    				$this->bulk_discount_calculated = false;
    			}
    		}

    Hope it helps!

    Thanks axcho, that worked very well for me!

    axcho, your fix worked for me as well. Thank you!

    So glad to hear it’s working! ?? I haven’t been able to get a hold of Rene Puchinger, the plugin author, but hopefully he’ll update with the fix soon.

    Works great! Thanks axcho!

    axcho, you are my hero!!!!

    I am using your plugin and when my products display, they display the discount price. If the item is $7 and you have to buy 2 to get a discount then it should display $7 not $6.10?

    I can confirm Axcho adjustment works, please accept his pull request.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘Discount removed at checkout!’ is closed to new replies.