Quantity Discounts with Variants

Some of my product variants (size for example) have price modifiers. I need to be able to apply quantity discounts and variants on the same product.



This has been done already for previous versions of CS Cart here:

Option quantity discounts MOD - Configuration - CS-Cart Forums



…but I can’t get it to work with v2.2.2.



This Cs Cart installation shows it in action:

http://www.thebutterflygrove.com/butterfly-decorations/sasha-butterflies/sasha-butterfly-decor.html



…notice that when you change the size of the product, the quantity discounts also change.



This seems like a fairly simple mod that should be included out-of-the-box.



If anyone has done this mod and gotten it working with v2.2.2 please let me know!

You might want to look at this addon to see if it meets your needs: Addon: Discount Plans - Third-Party Add-ons - CS-Cart Community Forums

Nice. I'll keep it in mind. Thanks.

Like you, I was dumbfounded when I noticed the quantity discount prices NOT updating when you change the options. I'm not sure how good a solution this is, but it may just work for you.



PS cs-cart: This really should be part of the standard install.



Make these changes to your [csart]/addons/my_changes folder (as documented in kb, somewhere).

init.php:

```php


if ( !defined('AREA') ) { die('Access denied'); }

fn_register_hooks(
'get_additional_product_data'
);
?>

```



And in funcs.php:

```php



if ( !defined('AREA') ) { die('Access denied'); }

function fn_my_changes_get_additional_product_data(&$product, $auth, $options, $params)
{
foreach ($product['prices'] as $id=>$price_data)
{
$price_data['price'] = fn_apply_options_modifiers($product['selected_options'], $price_data['price'], 'P');
$product['prices'][$id] = $price_data;
}
}
```

I haven't extensively tested it....perhaps one of the more senior members of these forums (or cs cart themselves) can verify it...?

I've looked through the code and the only place that the prices collection is actually used (ie 'read') seems to be in "views\products\components\products_qty_discount.tpl", so the changes should be pretty safe, without affecting any cart calculations at all.

this is now as std in the new Ultimate release, makes sense.



John