# Different prices for different option combinations

I have an option combination where i need the price to change based on both the first option and the second option the user selects. The price will vary depending on the combination of the first and second product.

Is there a way to do this, or do I have to use the configurator to do this for a product. Or, is there some other feature I can utilize.

Example:

First option choices:

First Option 1

First Option 2

First Option 3

Second option choices:

Second Option 1

Second Option 2

Second Option 3

If the user selects First Option 1 & Second Option 2 the price will be different than if the user selects First Option 2 & Second Option 2, so on and so forth.

Thanks for any assistance!

In standard CS-Cart you can add price modifiers not for option combinations, but for option variants only. So, in your example, you can set up the additional cost for each option:

First option choices:

First Option 1 +10\$

First Option 2 +20\$

First Option 3 +30\$

Second option choices:

Second Option 1 +12\$

Second Option 2 +24\$

Second Option 3 +36\$

So, if a customer selects First Option 1 and Second Option 2, the additional cost will be \$34, and if he/she selects First Option 2 and Second Option 1, the cost will be \$32.

so, do I make the product price 0?

[quote name=‘kimboecu1’]so, do I make the product price 0?[/QUOTE]

Yes, you can, Or you can make it some minimal amount, e.g. \$5 and then add additional option variants cost to it.

Just be aware that if you make the product price \$0 then you won’t be able to use any promotions for that product (at least in 2.0.8 which is my current CS-Cart version.) The promotion would see the product with the \$0 price and not be able to calculate any type of discount. I wanted this feature in CS-Cart but as far as I know, it hasn’t happened yet. If you are on a newer version, you might want to test a product with a promotion to see if works or not.

Dear Stephanie,

Yes, there was a bug with calculating the promotions in the mentioned case. And this bug has been fixed. To fix it in your CS-Cart installation, open the “fn.promotions.php” file located in the “core” directory of your CS-Cart, find and replace the following parts of the code:

1)this line:

```php

\$product[‘discount_prc’] = sprintf(‘%d’, round(\$product[‘discount’] * 100 / \$product[‘base_price’]));

```

with this part of the code:

```php

if (!empty(\$base_price)) {

\$product[‘discount_prc’] = sprintf(‘%d’, round(\$product[‘discount’] * 100 / \$base_price));

} else {

\$product[‘discount_prc’] = 0;

}

```

2)this line:

```php

if (\$bonus[‘bonus’] == ‘product_discount’ && floatval(\$product[‘base_price’])) {

```

with this one:

```php

if (\$bonus[‘bonus’] == ‘product_discount’) {

```

3)this part of the code:

```php

} elseif (\$bonus[‘bonus’] == ‘discount_on_products’) {

foreach (\$cart_products as \$k => \$v) {

if (isset(\$v[‘exclude_from_calculate’]) || !floatval(\$v[‘base_price’])) {

```

with this one:

```php

} elseif (\$bonus[‘bonus’] == ‘discount_on_products’) {

foreach (\$cart_products as \$k => \$v) {

if (isset(\$v[‘exclude_from_calculate’]) || (!floatval(\$v[‘base_price’]) && \$v[‘base_price’] != 0)) {

```

4)this part of the code:

```php

} elseif (\$bonus[‘bonus’] == ‘discount_on_categories’) {

foreach (\$cart_products as \$k => \$v) {

if (isset(\$v[‘exclude_from_calculate’]) || !floatval(\$v[‘base_price’])) {

```

with this one:

```php

} elseif (\$bonus[‘bonus’] == ‘discount_on_categories’) {

foreach (\$cart_products as \$k => \$v) {

if (isset(\$v[‘exclude_from_calculate’]) || (!floatval(\$v[‘base_price’]) && \$v[‘base_price’] != 0)) {

```

Save the file. Please check it.