Promotions and Bulk Discounted products

HI all
I have a 20% promotion running, but do not want to offer 20% off volume discounted products.

I do not want to create a category of sale items as the store has roughly 4,000 products, and about 70% of them were to be part of the sale.

How do I get CS-Cart to exclude the discount from products where the customer is getting bulk discounts already?

Any help appreciated as I am still new to this sort of thing and am a graphic designer and not a web developer :-).
www.papersource.net.au

cheers
Shaz

Do you mean other promotions? In this case please use the “Stop other rules” promotion setting and set up corresponding priority values for your promotions

1 Like

If you mean apply the promotion to all products but not to the products that already have “product qty discount”,
then no, not as far as Im aware, it will still give discount on the 50,
Screenshot by Lightshot

Unless maybe all the qty discunts are 50, then maybe you can set a rule/condition in the basket promotion where “product qty ordered” is less than 50

Hi johnbol1
Wish that was the case, but some are 15, 25, 50 and 100 sheets which all have different bulk discounts. I currently have an overseas order with about 1,000 sheets all with different qtys.

Guess there is no workaround at the moment…

if anyone has a solution, please let me know.

cheers
Shaz

Hi ecomlabs
I sell handmade paper which you can purchase in single sheets or volume eg, 10, 25, 50 and 100.

The way I have it set up is that to receive the promotion discount you need to firstly register on the site and then the WOW code will work.

Problem is that I do not want to give a 20% WOW discount on top of a possible 20% bulk buy of say 50 sheets. Most of my paper range has this sliding scale of discounts for volume purchases.

Does that make more sense?
thanks, Shaz

You can try this modification via my_changes add-on:

app/addons/my_changes/schemas/promotions/schema.post.php

<?php

$schema['conditions']['no_quantity_discounts'] = [
    'type'           => 'statement',
    'field_function' => ['fn_my_changes_check_promo_qnt_disc', '@product', '#this'],
    'zones'          => ['cart','catalog'],
];

return $schema;

app/addons/my_changes/func.php

<?php
use Tygh\Enum\YesNo;

function fn_my_changes_check_promo_qnt_disc($product, $promotion)
{
    static $prices = [];
    if ($promotion['condition'] === 'no_quantity_discounts'
        && YesNo::isTrue($promotion['value'])
    ) {
        if (empty($prices[$product['product_id']])) {
            $prices[$product['product_id']] = db_get_field(
                'SELECT COUNT(price) FROM ?:product_prices'
                . ' WHERE product_id = ?i GROUP BY product_id',
                $product['product_id']
            );
        }
        if ($prices[$product['product_id']] > 1) {
            return YesNo::NO;
        }
    }
    return YesNo::YES;
}

It will add a new condition that can be added to promotions, that will check if the current product has any quantity discounts.

4 Likes

Hi CS-Cart team
this sounds great. How do I know if it will work on my older version of CS-Cart?

Has the code been tested on people’s sites?

I am a graphic designer and not a developer and would not want to touch anything on the site in case it “breaks”, so am unsure of how I would do this IF it has beeen tested and actually is suitable for my older version.

thanks
Shaz

What version of cs cart ?

Using it on the my changes addon is quite safe.
You can always remove the code

Or make backups of the file if schema.post.php already exisits

1 Like

not sure where to find it.
It’s not recent, but has been updated a couple of times to keep things working.

Shaz

admin>upgrade centre
or add /?version to the end of your web address.

I can see you are on V 4.36

so yes the my changes addon works fine with that version, you possibly already have it enabled so just may need to create the directories as posted above
https://docs.cs-cart.com/latest/user_guide/addons/my_changes/index.html

always remember to backup files or download them first.

Hi johnbol1
thanks for checking the version for me.

Will I be able to turn it off and on by myself once installed so I have the control?

thanks
Shaz

For version 4.3.6, the code provided earlier must be changed. It won’t work with such an old version.

app/addons/my_changes/func.php

<?php

function fn_my_changes_check_promo_qnt_disc($product, $promotion)
{
    static $prices = [];
    if ($promotion['condition'] === 'no_quantity_discounts'
        && $promotion['value'] == 'Y'
    ) {
        if (empty($prices[$product['product_id']])) {
            $prices[$product['product_id']] = db_get_field(
                'SELECT COUNT(price) FROM ?:product_prices'
                . ' WHERE product_id = ?i GROUP BY product_id',
                $product['product_id']
            );
        }
        if ($prices[$product['product_id']] > 1) {
            return 'N';
        }
    }
    return 'Y';
}

The app/addons/my_changes/schemas/promotions/schema.post.php should be left unchanged.

1 Like

Please check this article:
https://docs.cs-cart.com/4.3.x/user_guide/addons/1manage_addons.html

1 Like

Hi CS-Cart team…
Happy New Year!

I had my web developer add your code and it’s not working. Here is what he said happened…
"I implemented their code, but it doesn’t seem to work correctly. I’m using https://www.papersource.net.au/batik-plain-200gsm-aqua-green-card.html for testing.

If I have the condition set, it won’t allow the coupon at all. If I don’t have the condition set, the coupon works fine, but it also discounts the quantity discount."

Any ideas on how to get this working?
thanks
Shaz

If you set this condition to “**all conditions are true”, the promocode can’t be applied within a promotion until all other conditions are met.

Hi
Thanks for the info… I have passed it on and hope this will now work.
Will let you know once my developer is back from the break.

thanks again
Shaz

1 Like

I am helping Sharon with this. I can’t seem to get this to work at all. Attached is a screenshot of the settings I’m using. What do I need to change?

Please clarify, is this the promotion not working under these conditions or the condition not working?