knacknuss Posted April 13, 2005 Posted April 13, 2005 Hi all I have 2 problems with this contribution: 1. Price is not updatet when there are special offers. (Normal price is displayed) eg. T-Shirt is 29.-- special price is 20.-- still 29.-- is diplayed in the drop down! 2. The price should only be displayed if there is a different price for this attribute. If the price of the attribute is the same for all, just the text should appear in the dropdown. eg instead of : red - 29.-- blue -29.-- green - 29.-- only red blue green should be shown... The code to change in product_info.php is: $original_price = $product_info['products_price']; $option_price = $products_options['options_values_price']; if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract. { $show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0; } else { $show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0; } $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; instead of if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price( $products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } Can someone help me with this :) Thanks! Quote
knacknuss Posted April 13, 2005 Author Posted April 13, 2005 Sorted the problem :) and if someone is interested in the solution here it is: $original_price = $product_info['products_price']; $option_price = $products_options['options_values_price']; if ($products_options['price_prefix'] == "-") // in case price lowers, don't add values, subtract. { $show_price = 0.0 + $original_price - $option_price; // force float (in case) using the 0.0; } else { $show_price = 0.0 + $original_price + $option_price; // force float (in case) using the 0.0; } if ($products_options['options_values_price'] != '0') { $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $currencies->display_price( $show_price, tep_get_tax_rate($product_info['products_tax_class_id'])) .') '; } } Quote
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.
Note: Your post will require moderator approval before it will be visible.