Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product attributes not updating total properly?


recoil-jay

Recommended Posts

Posted

Hello,

 

I have a clean version of OSC installed, no contributions, just 1 product with 5 attributes added.

 

http://www.jamesmelling.co.uk/wish/product_info.php?products_id=28

 

When you select any of the attributes from the box and add to cart, it updates the totals wrong? What am I doing wrong?

 

Thoses are the actual prices:-

 

5 pack of lanterns = £9.49

10 pack of lanterns = £16.99

20 pack of lanterns = £26.99

50 pack of lanterns = £64.99

100 pack of lanterns = £109.99

 

My attributes are setup like this:-

2pqj0hg.png

Posted

Jay,

 

Your prefix should be + and the default is 5 pcs so you should not have an attribute for it. The second attribute will be 10 pc 7.50 with a plus prefix.

 

It will appear as 10Pcs (+7.50) unless you have a contribution installed to display the actual attribute price.

 

 

 

Chris

Posted

Just to update, incase anyone else has a similar problem in future:-

 

In catalog/product_info.php

 

Look for:

 

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'])) .') ';

}

 

 

Change to:

 

 

$new_price ? $original_price = $new_price : $original_price = $product_info['products_price']; //// check if set special 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'])) .') ';

}

 

Then in the admin area, the attributes are setup like this:-

 

33e3mv4.png

 

Which looks like this on the front end:-

 

11qodog.jpg

 

Reason it's setup like that is because 1 pack of 5 lanterns = £9.49

 

The prices in the front end of the shop screenshot are the actual prices I want to display and as you can see from the admin back end, I have just minus £9.49 from each price and added it to the admin backend with a +

Archived

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

×
×
  • Create New...