• Resolved borish1

    (@borish1)


    Is it possible actually to not count the items on sale and to just include regular priced items.

    So for example: Let’s say that the price tag needed for the gift to appear is 150 dollars. The user adds 4 items of total worth of 200 dollars BUT 3 items (of those 4) are worth 120$ and the fourth one is 80 BUT on discount. Because the fourth one is on discount it won’t count so that leaves user with the 120 dollar in total for the gift which is not enough and therefore the gift wont be added.

    So is there a possibility to hook into your plugin or if that is not possible can I at least modify specific plugin file? (I know its not recommended but I really need this feature and your plugin has everything that I need except that one).

    Thank you.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author DecomTeam

    (@decomteam)

    Hi @borish1, not sure did I understand but you can change from subtotal to total price calculation,
    giftable-for-woocommerce/includes/CriteriaAmounts.php from WC()->cart->subtotal to WC()->cart->total

    Post about subtotal to total

    Thread Starter borish1

    (@borish1)

    Hey @decomteam,

    Sorry if I didn’t explained good. What I was saying is if there is any chance to exclude sale prices to be counted. I don’t have VAT / Taxes or any other % value on the cart so I don’t need to worry about those. Only thing turned on is shipping but that comes at the checkout so that can also be ignored. What I did is this:

        	$items_on_sale = 0;
        	foreach ( WC()->cart->get_cart() as $cart_item ) {
        		$_product =  wc_get_product( $cart_item['data']->get_id() );
        		if($_product->is_on_sale())
    		   $items_on_sale += $cart_item['data']->get_price();
    
    		}
    
            $total = WC()->cart->total - $items_on_sale;

    I think this should work as intended if we consider that I don’t have anything turned on from above mentioned. Correct me if I’m wrong and thank you for the fast response.

    Plugin Author DecomTeam

    (@decomteam)

    @borish1 that could work, easier would be maybe to edit plugin file in /public/public.php
    – we don’t count coupon codes at all – not sure will we integrate that part.
    – if your products have custom category or somewhat tag – you could try to exclude theme via that tag, category

    • This reply was modified 5 years, 11 months ago by DecomTeam.
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Gift for regular items (disable sale items)’ is closed to new replies.