Category : coupon

I’ve a problem with this code to apply different percentage of discount to product in different category The function work but is execute n times where n depends on the number of products in cart add_filter( ‘woocommerce_coupon_get_discount_amount’, ‘alter_shop_coupon_data’, 1, 5 ); function alter_shop_coupon_data( $discount, $discounting_amount, $cart_item, $single, $instance ){ $coupons = WC()->cart->get_coupons(); $cart_items = WC()->cart->get_cart(); ..

Read more

I am trying to get order data by coupon code and date. I have added this code. But how to find the data by coupon code and date? $date_from = ‘2015-11-20’; $date_to = ‘2015-12-20′; $post_status = implode("’,’", array(‘wc-processing’, ‘wc-completed’) ); $result = $wpdb->get_results( "SELECT * FROM $wpdb->posts WHERE post_type = ‘shop_order’ AND post_status IN (‘{$post_status}’) ..

Read more

I am trying to set up a custom coupon code so that customers can add an add-on product to their cart, only if their cart total is $50 or more. I have the code written that allows or denies adding the product depending on their cart total add_filter( ‘woocommerce_add_to_cart_validation’, ‘wc_add_on_feature’, 20, 3 ); function wc_add_on_feature( ..

Read more