Product In - Product Not In

I am trying to setup a promotion for my store using a discount code.



The conditions I have set are as following: ALL must be TRUE



Coupon Code equal to 12345



Once per customer YES



Product IN 2x8 pad



Product NOT IN

4x6 PAD

5X6 PAD

8x10 PAD



Bonuses:



Discount on Product - 2X8 PAD - by fixed amount: 14.99



Basically they get the 2x8 pad for free…if no other pads are added into the order



tested in store…when I add just the 2x8 PAD to the order and use the code it works fine…but lets say I add the 2x8 PAD and the 5x6 PAD…then the code should not work because the product 5x6 is IN the cart and that does not match my conditions…



Am I missing something or I am setting this up the wrong way, or my promotion settings are not working right?

Let me know what you think please

[quote name='cherubrock74' timestamp='1317060707' post='122335']

I am trying to setup a promotion for my store using a discount code.



The conditions I have set are as following: ALL must be TRUE



Coupon Code equal to 12345



Once per customer YES



Product IN 2x8 pad



Product NOT IN

4x6 PAD

5X6 PAD

8x10 PAD



Bonuses:



Discount on Product - 2X8 PAD - by fixed amount: 14.99



Basically they get the 2x8 pad for free…if no other pads are added into the order



tested in store…when I add just the 2x8 PAD to the order and use the code it works fine…but lets say I add the 2x8 PAD and the 5x6 PAD…then the code should not work because the product 5x6 is IN the cart and that does not match my conditions…



Am I missing something or I am setting this up the wrong way, or my promotion settings are not working right?

Let me know what you think please

[/quote]

Have you tried just the “Product Not In”. I use “Product Not In” for free shipping. It works for me.

cmund

[quote name='cmund' timestamp='1317080126' post='122357']

Have you tried just the “Product Not In”. I use “Product Not In” for free shipping. It works for me.

cmund

[/quote]

Thanks for your reply…I tried but it still did not work…

any other suggestion? does anyone else use promotions similar on their site? should I email cs cart tech support at this point?

Hello cherubrock74,



Thank you for your message.



It seems that the issue occurs because of a well-known bug persisting in previous CS-Cart versions. In order to fix it, you should replace the following part of the code:



foreach ($cart_products as $v) {
if (fn_promotion_validate_attribute($v[$schema[$promotion['condition']]['field']], $promotion['value'], $promotion['operator']) == true) {
return true;
}
}

return false;


with this one:


foreach ($cart_products as $v) {
if ($promotion['operator'] == 'nin') {
if (fn_promotion_validate_attribute($v[$schema[$promotion['condition']]['field']], $promotion['value'], 'in')) {
return false;
}
} else {
if (fn_promotion_validate_attribute($v[$schema[$promotion['condition']]['field']], $promotion['value'], $promotion['operator'])) {
return true;
}
}
}

return $promotion['operator'] == 'nin' ? true : false;


and this one:


$value = call_user_func_array($func, $p);

if (fn_promotion_validate_attribute($value, $promotion['value'], $promotion['operator'])) {
return true;
}
}

return false;


with this one:


$value = call_user_func_array($func, $p);

if ($promotion['operator'] == 'nin') {
if (fn_promotion_validate_attribute($value, $promotion['value'], 'in')) {
return false;
}
} else {
if (fn_promotion_validate_attribute($value, $promotion['value'], $promotion['operator'])) {
return true;
}
}
}

return $promotion['operator'] == 'nin' ? true : false;


in the “fn.promotions.php” file located in the “core” directory of your CS-Cart installation. Please check it.





Pavel Zyukin

CS-Cart Support team

Thanks Paul that fixed some of the issues



I still cannot get it to work when I set the product bonus discount to a fixed amount…



to test the functionality I created the following condition:



If 2x8 Padding is IN

and

Coupon code equals to PAD



Discount on products:



2x8 Padding



By fixed amount: 14.49 (price of the 2x8 Pad)



No discount is applied in the cart



Fixed amount is the only bonus type that is not working…



If I set the bonus to be by percentage of original price to 100 for example it works showing the product in the cart at the price of $0.00



But the problem is that if they add 6 pads with this conditions and apply the code the order of 6 pads will be free 0.00! If I could apply the fixed amount discount, does not matter how many they will add to the cart the discount will always be on one pad



Other bunuses work too…I tried to percentage of original price and to fixed amount



Any suggestion? Should I report this as a bug? that is what it looks like to me…

Please let me know

Hello cherubrock74,



Thank you for the reply. I am sorry to hear that you experience this problem.



The problem requires the investigation on your server. Please contact us via Customer Help Desk and provide temporary access to your server.





Pavel Zyukin

CS-Cart Support team