Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

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!

Posted

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

}

}

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...