Promotion's Original Price

Hi there,



I was wondering if anyone else had come across this and figured out how to fix it…



At the moment when you create a promotion is CS Cart it applies the discount to the Price of the product. I was wondering if it is possible to change this to the list-price and not the normal price…



For example:

Product X has a list price of £100

we sell it for £80

We apply a Promotion of 50% off and it gives us a sale price £40



What I want it to give me is a sale price of £50



I have found what looks like the right code in core > fn.promotions.php - line 246 or so just don’t know what to do with it…



Thanks,

Edward :smiley:

Strange but I couldn't find someone mentioning this.

For example I want to setup a Black Friday sale. Now, if I enter say 20% discount, it takes the original price and lowers it by 20%.

For example if I have a product with List price $100 sold at $90, I have a 10% discount. If I set up a promotion based on List price (which is the MSRP in my case) and put another 10%, it shows 10% from the original price.

This is wrong, the list price is often used for SRP and any discount is applied from it, or at least there should be an option.

Strange but I couldn't find someone mentioning this.

For example I want to setup a Black Friday sale. Now, if I enter say 20% discount, it takes the original price and lowers it by 20%.

For example if I have a product with List price $100 sold at $90, I have a 10% discount. If I set up a promotion based on List price (which is the MSRP in my case) and put another 10%, it shows 10% from the original price.

This is wrong, the list price is often used for SRP and any discount is applied from it, or at least there should be an option.

Try this:

add the following code to promotion schema, to the $schema['bonuses'] array:

        'product_list_price_discount' => array (
            'function' => array('fn_promotion_apply_catalog_rule_list_price', '#this', '@product', '@auth'),
            'discount_bonuses' => array('to_percentage', 'by_percentage', 'to_fixed', 'by_fixed'),
            'zones' => array('catalog'),
        ),

Open the app/functions/fn.promotions.php file and add the following functions:

function fn_promotion_apply_discount_list_price($promotion_id, $bonus, &$product, $use_base = true, &$cart = null, &$cart_products = null)
{
    if (!isset($product['promotions'])) {
        $product['promotions'] = array();
    }
if (!isset($product['discount'])) {
    $product['discount'] = 0;
}

if (!isset($product['list_price'])) {
    $product['list_price'] = db_get_field("SELECT list_price FROM ?:products WHERE product_id = ?i", $product['product_id']);
}
if (!isset($product['base_price'])) {
    $product['base_price'] = $product['list_price'];
}

$product['base_price'] = $product['original_price'] = $product['price'] = $product['list_price'];
$base_price = ($use_base == true) ? $product['list_price'] + (empty($product['modifiers_price']) ? 0 : $product['modifiers_price']) : $product['list_price'];

$discount = fn_promotions_calculate_discount($bonus['discount_bonus'], $base_price, $bonus['discount_value'], $product['list_price']);
$discount = fn_format_price($discount);

$product['discount'] += $discount;
$product['price'] = $product['list_price'] - $discount;

if ($product['price'] < 0) {
    $product['discount'] += $product['price'];
    $product['price'] = 0;
}

$product['promotions'][$promotion_id]['bonuses'][] = array (
    'discount_bonus' => $bonus['discount_bonus'],
    'discount_value' => $bonus['discount_value'],
    'discount' => $product['discount']
);

if (isset($product['subtotal'])) {
    $product['subtotal'] = $product['price'] * $product['amount'];

    if (is_array($cart) && is_array($cart_products)) {
        $cart['subtotal'] = 0;
        foreach ($cart_products as $cart_product_code => $cart_product) {
            $cart['subtotal'] += $cart_product['subtotal'];
        }
    }
}

if (!empty($base_price)) {
    $product['discount_prc'] = sprintf('%d', round($product['discount'] * 100 / $base_price));
} else {
    $product['discount_prc'] = 0;
}

return true;

}

function fn_promotion_apply_catalog_rule_list_price($bonus, &$product, &$auth)
{
if ($bonus[‘bonus’] == ‘product_list_price_discount’) {
if (!isset($product[‘extra’][‘promotions’][$bonus[‘promotion_id’]]) && !isset($product[‘promotions’][$bonus[‘promotion_id’]])) {
fn_promotion_apply_discount_list_price($bonus[‘promotion_id’], $bonus, $product);
}
}

return true;

}

Should work.

I tried but.. I probably didn't get something. What I am supposed to do with the condition? I don't really want to have another condition, it's more like having the way the discount is shown changed. I'm quite OK running the promotions based on the Price, they just need to show the product was discounted further.

For example:

The first image is the product without any promotions, just based on List Price (SRP) 99 and Price 75, which gives you 24% discount label and text.

The second image is when I run 10% discount on the same product - as you can see, the price is lower than 75, but instead of having SRP shown and total 31-32% discount from the SRP, it takes the old (original) Price and only shows 10% discount.

I want [1] to show normal List price, and [2] (and the green label) to show the total discount.

I know it may look like a cheap marketing trick, but this is how it's used in many countries. My rivals, for example, sell the game at 99 and discount it with 20% for the Black Friday, this is higher than our regular price, and I want to reflect the fact that we offer even bigger discount on this day.

I think that this should have been in the code since the begining or an option, every single shop that works with SRPs would want it!

Thank you for trying to make it work for me. I searched for an addon that does that, but I didn't had any luck.

You set any condition, even 'Product price' >= 0.

But list discount (difference between list price and price) and promotion discount will not be joined. Only one of them will work. You can set 33% as a bonus.

And try to replace

$product['price'] = $product['list_price'] - $discount;

with

$product['price'] -= $discount;

You set any condition, even 'Product price' >= 0.

But list discount (difference between list price and price) and promotion discount will not be joined. Only one of them will work. You can set 33% as a bonus.

And try to replace

$product['price'] = $product['list_price'] - $discount;

with

$product['price'] -= $discount;

I'll try it tonight and let you know if it worked.

Wow!

Thank you so much, worked like a charm even w/o the last change (tried but couldn't see the difference)

Promotion based on list price, removes sales discount, applies promotion for the duration, shows correct discount.

Again, thank you!

You are very welcome :) It would be nice you vote my message up if it is helpful for you ;)

We'd really like to have this work on our 4.2.2 store.

The code was installed by my dev, but it's not working...

Any ideas?

How can we get this working on the latest CS-Cart.

The promotional discount should be of the List Price and not the already discounted price on the site.

How can we get this working on the latest CS-Cart.

The promotional discount should be of the List Price and not the already discounted price on the site.

Hello!

Please describe how you applied the changes from #3 post.

Hello!

Please describe how you applied the changes from #3 post.

Hi there,

The $schema['bonuses'] seems different to what is in the file - which line would that be added?

Hi there,

The $schema['bonuses'] seems different to what is in the file - which line would that be added?

Hello!

Add this code to the end of the file before "return $schema;".

$schema['bonuses']['product_list_price_discount'] = array (
    'function' => array('fn_promotion_apply_catalog_rule_list_price', '#this', '@product', '@auth'),
    'discount_bonuses' => array('to_percentage', 'by_percentage', 'to_fixed', 'by_fixed'),
    'zones' => array('catalog'),
);

Hi there,

Thanks for that, have added that in the file, also added the code in app/functions/fn.promotions.php.

Was there any specific area for that? as it is still discounting off the price and not the list price.

Hi there,

Thanks for that, have added that in the file, also added the code in app/functions/fn.promotions.php.

Was there any specific area for that? as it is still discounting off the price and not the list price.

Hello!

Did you clear cache?

Hi there,

Yes, have done that - still the same result ;-(

Hi there,

Yes, have done that - still the same result ;-(

Please send us the screenshot of the promotion configuration.

Please send us the screenshot of the promotion configuration.

Hi there, have sent via PM