Markoni Posted July 25, 2005 Share Posted July 25, 2005 Hi people, Can anybody know how can I deseble prefix.. and use attributes , Option value without + prefix.. ? Just the price I put in attributes (option value) I want to sell images on my stock.. and I need a 3 options When somebody click to product.. that he have option example: Low resolution 5$ Medium res. 10 $ High res. 15 $ At this moment if I put price on that product 5 $ and put option Medium res. with 10$ the total oreder will be 5 $ + 10$ = 15$ How can I correct this? Thank you Quote Link to comment Share on other sites More sharing options...
ofek Posted June 20, 2006 Share Posted June 20, 2006 I am having the same issue... did u get the solution for prefix??? please share that with me also... that will be geat. Quote Link to comment Share on other sites More sharing options...
davidcox67 Posted September 23, 2006 Share Posted September 23, 2006 I am having the same issue... did u get the solution for prefix???please share that with me also... that will be geat. I made the following code change to both shopping_cart.php files. I added $product_prices as a parameter to attribute_price(). I changed all references to attribute_price() to not do an addition of $product_prices and instead do the math here. I made up a price_prefix of '@' to fix the price to the given value instead of doing addition or subtraction. function attributes_price($products_id, $products_prices) { $attributes_price = 0; if (isset($this->contents[$products_id]['attributes'])) { reset($this->contents[$products_id]['attributes']); while (list($option, $value) = each($this->contents[$products_id]['attributes'])) { $attribute_price_query = tep_db_query("select options_values_price, price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and options_id = '" . (int)$option . "' and options_values_id = '" . (int)$value . "'"); $attribute_price = tep_db_fetch_array($attribute_price_query); if ($attribute_price['price_prefix'] == '+') { $attributes_price += $attribute_price['options_values_price']; } else if ($attribute_price['price_prefix'] == '@') { return $attribute_price['options_values_price']; } else { $attributes_price -= $attribute_price['options_values_price']; } } } return $products_price + $attributes_price; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.