Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Options Price Prefix Problem


PuffDandEd

Recommended Posts

Posted

Hello,

I've been trying to get my product options to add additional options but instead of using + or - to change the price for the additional options, I want to use * for multiplication. When I put * in for the prefix, when a person purchases an item with the additional option, it subtracts the Value Price rather than multiply it. For example:

 

Widget costs $19.95

Widget plus red paint costs base price * 1.25 (which equals out to an additional 25% of the original purchase price)

Total with red paint should be $24.94 but osC makes the price $18.70 by subtracting the original price from the Value Price.

 

Hence multiplication operand doesn't work, it subtracts when it sees multiply.

 

Any thoughts?

 

TIA!

Posted

in includes/classes/shopping_cart.php, change the following:

 

1. around line 386, change

 if ($attribute_price['price_prefix'] == '+') {
		$attributes_price += $attribute_price['options_values_price'];
	  } else {
		$attributes_price -= $attribute_price['options_values_price'];
	  }

to

 if ($attribute_price['price_prefix'] == '+') {
		$attributes_price= $attribute_price['options_values_price'];
	  }

 

 

 

2. around line 420, change

 'final_price' => ($products_price + $this->attributes_price($products_id)),

to

 'final_price' => ($products_price * $this->attributes_price($products_id)),

 

 

this should work to get the new price, but the I believe there is more to be done to get the subtotals, etc. all working together --- please back up this file before trying this out :)

 

Linda

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...