Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Multiplier for attribute price?


Jess2406

Recommended Posts

I hope someone can help me with this!

 

I am going to be selling decals. The price of a decal is determined by the size and the color selected. Typical sizes are 5", 12" (+$7.00), 18" (+13.00), and 22" (+17.00). Most colors will not affect the price, but I have special colors like Chrome and Diamond Plate that will. But I can't just put a price like +$5.00 on these colors because that won't take into account the size selected. I can explain my problem better using an example:

 

My base price for a particular 5" sticker is $5.00. If a size of 12" is selected, that will add $7.00 to the total, making it $12.00. If Chrome is selected for the color, I want to the total to be two times $12.00, which is $24. If they select 5", I want the total to be two times $5.00. For Diamond Plate, I want the multiplier to be five. So if Diamond Plate was selected in these two examples, the totals will be $60.00 for the 12" and $25.00 for the 5".

 

I tried to make this change myself - updating the formula for attribute_price in \catalog\includes\classes\shopping_cart.php like this:

 

if ($attribute_price['price_prefix'] == '+') {

$attributes_price += $attribute_price['options_values_price'];

} else {

$attributes_price *= $attribute_price['options_values_price'];

 

(minus sign replaced with the asterisk in two places)

 

I set the value for the Chrome attribute to * 2.00.

 

But when the product is added to the cart a total of $5.00 is coming up for a 5" Chrome decal and the total for the cart ("Sub total") is $10.00. The total for a 12" Chrome decal is showing as $19.00 and the cart total is $24.00. So, obviously, I'm not even close! I knew it wasn't going to be that simple. I'm not an experienced php programmer, so I don't know where to go from here.

 

Can someone please tell me what I'll need to do to make this work the way I need it to? I would be so grateful to anyone who can give me the solution!

 

Jess

Link to comment
Share on other sites

What's wrong with using the product attributes?

 

Do you mean with the Product Multiplier contribution? When I select a *2 multiplier attribute, and also select an attribute that would add to the total cost of the product (ex. $5.00 base for decal +$7.00 for a 12" decal), I want the total for the product to be $24.00. The code in the contribution just multiplies 2* the base price. In the shopping cart, the price is shown as $10.00 and the shopping cart total is shown as $17.00 (I guess that total includes the +$7.00 attribute).

 

So the shopping_cart.php needs to perform the adds and substracts first (although I have no subtracts) and then multiply that total by the multiplier(s).

 

I desperately need this to work! I would even pay $50 for help in resolving this!

 

Jess

Link to comment
Share on other sites

I also tried this contribution: http://www.oscommerce.com/community/contributions,721

 

But it's from Aug 2003 and I haven't found any posts that say that it has worked.

 

Ok I'm a little confused at the pricing....

 

5" = $5

5" Chrome = $10

5" Diamond Plate = $25?

 

not sure how the pricing is for the 12" one? where did the total of $60 come from??

 

12" = $7

12" Chrome = $14

12" Diamond Plate = ??? $7 x 5 = $35 Possibly you have confused yourself and multiple the 12 x 5??? :D

 

I think you might be going about it the wrong way. Use the product attributes which are already available and set it up per product instead of trying to get it to go off the total??

 

Looking at the Product Attributes, it can be a little confusing.....

 

Private Message me if you want more help...

Link to comment
Share on other sites

OK now I've read again and I'm totally confused....

 

They have added a 5" and a 12" and they choose chrome for both??? and u want to double it??

 

so the total extra cost for the Chrome is double the price of the size or just adding $5 per decal???

Link to comment
Share on other sites

Ok I'm a little confused at the pricing....

 

5" = $5

5" Chrome = $10

5" Diamond Plate = $25?

 

not sure how the pricing is for the 12" one? where did the total of $60 come from??

 

12" = $7

12" Chrome = $14

12" Diamond Plate =  ??? $7 x 5 = $35 Possibly you have confused yourself and multiple the 12 x 5???  :D

 

I think you might be going about it the wrong way. Use the product attributes which are already available and set it up per product instead of trying to get it to go off the total??

 

Looking at the Product Attributes, it can be a little confusing.....

 

Private Message me if you want more help...

 

The decal has a base price of $5. So a 12" Chrome would be ($5 + $7) * 2 = 24

And a 12" Diamond Plate decal would be ($5 + $7) * 5 = 60. I need it to calculat the "add" attributes before the "multiply" attributes. The changes I made, based on the contribution, just multiplies the base price by $2. Sorry, I know I wasn't clear.

 

Thank you for responding! I will send you a PM.

Link to comment
Share on other sites

OK now I've read again and I'm totally confused....

 

They have added a 5" and a 12" and they choose chrome for both??? and u want to double it??

 

so the total extra cost for the Chrome is double the price of the size or just adding $5 per decal???

 

Here are some of my prices:

 

base price: $5:00

 

size 5": no extra cost

size 12": + $7.00

 

color black: no extra cost

color chrome: * 2.00

color Diamond Plate: * 5.00

 

a 5" Chrome decal would be ($5 + $0) * 2 = $10

a 12" Chrome decal would be ($5 + $7) * 2 = $24

 

Hope this is more clear!

Link to comment
Share on other sites

I think what I need shopping_cart php to do is this:

 

1. add together the attribute prices of all "+" and "-" attributes. I'm almost positive it does this already.

2. multiply together the attribute values of all "*" attributes.

3. calculate the total = (Product price + total of attribute prices) * product of all multiplier values.

 

So if I have a decal with a base price of $5, +$7.00 for a larger size, *5 for a special color, and *2 for a special color outline, the decal would cost ($5 + $7) * (5 * 2) = $120.

 

Could someone please tell me how to modify shopping_cart so that it calculates the products' prices this way?

 

I've tried for probably 6 hours to get this to work but I'm not getting anywhere. Please help!

 

Thanks,

 

Jess

Link to comment
Share on other sites

If anyone cares, the code below seems to work for the calculation of each product total. I still have to figure out how to code the multiplier for the calculation of the cart total (function calculate). It's tougher because it loops through the attributes of all products, so I guess the multiplier will have to be reset to 1 every time the product changes.

 

    function attributes_price($products_id, $products_price) {
     $attributes_price = 0;
     $price_multiplier = 1;

     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'];
         } elseif ($attribute_price['price_prefix'] == '-') {
             $attributes_price -= $attribute_price['options_values_price'];
         } elseif ($attribute_price['price_prefix'] == '*') { 
             $price_multiplier =  $attribute_price['options_values_price'];
         } 
       }
     }
     $attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price;
     return $attributes_price;
   }

Link to comment
Share on other sites

OK how are you listing the products?

 

One of each colour 5" and going from there???

 

I'm not sure what you're asking. I'm able to to select the size and color from the same product_info.php page. There's no need to list the same decal more than once.

 

I'm happy to report that I was able to get the multiplier to work perfectly, even with more than once multiplier on the same product. It took some patience... lots of trial and error. The code pasted above isn't exactly what I ended up with. When I have time, I'll add to the Product Accessories Multiplier contribution.

 

I'll post a link to the site here tomorrow so you can see what I wanted to accomplish. I have a few more tweaks to make before going live.

Link to comment
Share on other sites

I'm not sure what you're asking.  I'm able to to select the size and color from the same product_info.php page.  There's no need to list the same decal more than once. 

 

I'm happy to report that I was able to get the multiplier to work perfectly, even with more than once multiplier on the same product.  It took some patience... lots of trial and error.  The code pasted above isn't exactly what I ended up with.  When I have time, I'll add to the Product Accessories Multiplier contribution.

 

I'll post a link to the site here tomorrow so you can see what I wanted to accomplish.    I have a few more tweaks to make before going live.

 

I've been having problems with the multiplier as well. It behaves strangely when used more than once on the same product (although in my case I do want the * to go before the +)...the total in the shopping cart is wrong, but sub-total is correct, but only when there's one kind of product in the cart. With two products (not two quantities), the looping results in really huge numbers.

 

Can you post your code so I can see how this would be solved?

Link to comment
Share on other sites

Ok, here it is. (Since you want to exclude the plus and minus attribute values from the multiplication, you'll have to change the formula for calculating the $attributes_price).

 

   function calculate() {
     $this->total = 0;
  $this->weight = 0;
  if (!is_array($this->contents)) return 0;

     reset($this->contents);
     while (list($products_id, ) = each($this->contents)) {
       $qty = $this->contents[$products_id]['qty'];

// products price
       $product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
       if ($product = tep_db_fetch_array($product_query)) {
         $prid = $product['products_id'];
         $products_tax = tep_get_tax_rate($product['products_tax_class_id']);
         $products_price = $product['products_price'];
         $products_weight = $product['products_weight'];
   $attributes_price = 0;
   $this->attribute_price = 0;
      $price_multiplier = 1;
   
         $specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
         if (tep_db_num_rows ($specials_query)) {
           $specials = tep_db_fetch_array($specials_query);
           $products_price = $specials['specials_new_products_price'];
         }

//        $this->total += tep_add_tax($products_price, $products_tax) * $qty;
         $this->weight += ($qty * $products_weight);
       }

// attributes price, for shopping cart total
       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)$prid . "' 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'] == '+') {
              $this->attribute_price += tep_add_tax($attribute_price['options_values_price'], $products_tax);
    $attributes_price += $attribute_price['options_values_price'];
           } elseif ($attribute_price['price_prefix'] == '-') {
               $attribute_price -= $attribute_price['options_values_price'];
	 } elseif ($attribute_price['price_prefix'] == '*') {
              $price_multiplier *= $attribute_price['options_values_price'];
           } 
         }
         $attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price;  
   } else {
   $attributes_price = 0;
 }
    $this->total += (tep_add_tax($products_price, $products_tax) + $attributes_price) * $qty;   
     }
}

   function attributes_price($products_id, $products_price) {
     $attributes_price = 0;
  $price_multiplier = 1;

     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'];
         } elseif ($attribute_price['price_prefix'] == '-') {
             $attributes_price -= $attribute_price['options_values_price'];
   } elseif ($attribute_price['price_prefix'] == '*') { 
    $price_multiplier *=  $attribute_price['options_values_price'];
         } 
       }
  $attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price;	
     }
     return $attributes_price;
   }

 

 

 

I've been having problems with the multiplier as well.  It behaves strangely when used more than once on the same product (although in my case I do want the * to go before the +)...the total in the shopping cart is wrong, but sub-total is correct, but only when there's one kind of product in the cart.  With two products (not two quantities), the looping results in really huge numbers.

 

Can you post your code so I can see how this would be solved?

Link to comment
Share on other sites

Ok, here it is.  (Since you want to exclude the plus and minus attribute values from the multiplication, you'll have to change the formula for calculating the $attributes_price). 

 

 ? function calculate() {
? ? ?$this->total = 0;
? $this->weight = 0;
? if (!is_array($this->contents)) return 0;

? ? ?reset($this->contents);
? ? ?while (list($products_id, ) = each($this->contents)) {
? ? ? ?$qty = $this->contents[$products_id]['qty'];

// products price
? ? ? ?$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
? ? ? ?if ($product = tep_db_fetch_array($product_query)) {
? ? ? ? ?$prid = $product['products_id'];
? ? ? ? ?$products_tax = tep_get_tax_rate($product['products_tax_class_id']);
? ? ? ? ?$products_price = $product['products_price'];
? ? ? ? ?$products_weight = $product['products_weight'];
? ?$attributes_price = 0;
? ?$this->attribute_price = 0;
? ? ? $price_multiplier = 1;
? ?
? ? ? ? ?$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
? ? ? ? ?if (tep_db_num_rows ($specials_query)) {
? ? ? ? ? ?$specials = tep_db_fetch_array($specials_query);
? ? ? ? ? ?$products_price = $specials['specials_new_products_price'];
? ? ? ? ?}

// ? ? ? ?$this->total += tep_add_tax($products_price, $products_tax) * $qty;
? ? ? ? ?$this->weight += ($qty * $products_weight);
? ? ? ?}

// attributes price, for shopping cart total
? ? ? ?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)$prid . "' 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'] == '+') {
? ? ? ? ? ? ? $this->attribute_price += tep_add_tax($attribute_price['options_values_price'], $products_tax);
? ? $attributes_price += $attribute_price['options_values_price'];
? ? ? ? ? ?} elseif ($attribute_price['price_prefix'] == '-') {
? ? ? ? ? ? ? ?$attribute_price -= $attribute_price['options_values_price'];
?	} elseif ($attribute_price['price_prefix'] == '*') {
? ? ? ? ? ? ? $price_multiplier *= $attribute_price['options_values_price'];
? ? ? ? ? ?} 
? ? ? ? ?}
? ? ? ? ?$attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price; ?
? ?} else {
? ?$attributes_price = 0;
?}
? ? $this->total += (tep_add_tax($products_price, $products_tax) + $attributes_price) * $qty; ? 
? ? ?}
}

? ?function attributes_price($products_id, $products_price) {
? ? ?$attributes_price = 0;
? $price_multiplier = 1;

? ? ?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'];
? ? ? ? ?} elseif ($attribute_price['price_prefix'] == '-') {
? ? ? ? ? ? ?$attributes_price -= $attribute_price['options_values_price'];
? ?} elseif ($attribute_price['price_prefix'] == '*') { 
? ? $price_multiplier *= ?$attribute_price['options_values_price'];
? ? ? ? ?} 
? ? ? ?}
? $attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price;	
? ? ?}
? ? ?return $attributes_price;
? ?}

 

It works. Cool! Thanks.

Link to comment
Share on other sites

Ok, here it is.  (Since you want to exclude the plus and minus attribute values from the multiplication, you'll have to change the formula for calculating the $attributes_price). 

 

 ? function calculate() {
? ? ?$this->total = 0;
? $this->weight = 0;
? if (!is_array($this->contents)) return 0;

? ? ?reset($this->contents);
? ? ?while (list($products_id, ) = each($this->contents)) {
? ? ? ?$qty = $this->contents[$products_id]['qty'];

// products price
? ? ? ?$product_query = tep_db_query("select products_id, products_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
? ? ? ?if ($product = tep_db_fetch_array($product_query)) {
? ? ? ? ?$prid = $product['products_id'];
? ? ? ? ?$products_tax = tep_get_tax_rate($product['products_tax_class_id']);
? ? ? ? ?$products_price = $product['products_price'];
? ? ? ? ?$products_weight = $product['products_weight'];
? ?$attributes_price = 0;
? ?$this->attribute_price = 0;
? ? ? $price_multiplier = 1;
? ?
? ? ? ? ?$specials_query = tep_db_query("select specials_new_products_price from " . TABLE_SPECIALS . " where products_id = '" . (int)$prid . "' and status = '1'");
? ? ? ? ?if (tep_db_num_rows ($specials_query)) {
? ? ? ? ? ?$specials = tep_db_fetch_array($specials_query);
? ? ? ? ? ?$products_price = $specials['specials_new_products_price'];
? ? ? ? ?}

// ? ? ? ?$this->total += tep_add_tax($products_price, $products_tax) * $qty;
? ? ? ? ?$this->weight += ($qty * $products_weight);
? ? ? ?}

// attributes price, for shopping cart total
? ? ? ?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)$prid . "' 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'] == '+') {
? ? ? ? ? ? ? $this->attribute_price += tep_add_tax($attribute_price['options_values_price'], $products_tax);
? ? $attributes_price += $attribute_price['options_values_price'];
? ? ? ? ? ?} elseif ($attribute_price['price_prefix'] == '-') {
? ? ? ? ? ? ? ?$attribute_price -= $attribute_price['options_values_price'];
?	} elseif ($attribute_price['price_prefix'] == '*') {
? ? ? ? ? ? ? $price_multiplier *= $attribute_price['options_values_price'];
? ? ? ? ? ?} 
? ? ? ? ?}
? ? ? ? ?$attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price; ?
? ?} else {
? ?$attributes_price = 0;
?}
? ? $this->total += (tep_add_tax($products_price, $products_tax) + $attributes_price) * $qty; ? 
? ? ?}
}

? ?function attributes_price($products_id, $products_price) {
? ? ?$attributes_price = 0;
? $price_multiplier = 1;

? ? ?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'];
? ? ? ? ?} elseif ($attribute_price['price_prefix'] == '-') {
? ? ? ? ? ? ?$attributes_price -= $attribute_price['options_values_price'];
? ?} elseif ($attribute_price['price_prefix'] == '*') { 
? ? $price_multiplier *= ?$attribute_price['options_values_price'];
? ? ? ? ?} 
? ? ? ?}
? $attributes_price = ($price_multiplier * $attributes_price) + ($price_multiplier * $products_price) - $products_price;	
? ? ?}
? ? ?return $attributes_price;
? ?}

 

Ehemm, you are a rockstar :thumbsup:

 

after a tedium of trying to tweek the algorythms i just copied and pasted your fix

 

I would definately make this a contribution, this saved me a huuuge headache

 

Thanks again ~~ =)

 

J

Link to comment
Share on other sites

Ehemm, you are a rockstar  :thumbsup:

 

after a tedium of trying to tweek the algorythms i just copied and pasted your fix

 

I would definately make this a contribution, this saved me a huuuge headache

 

Thanks again ~~ =)

 

J

 

Hey, im getting this error when i went live

 

Missing argument 2 for attributes_price()

 

and its pointing to this part of the code (referring to and contained within the above code)

 

 function attributes_price($products_id, $products_price) {
    $attributes_price = 0;
 $price_multiplier = 1;

 

~ Please does anyone know a fix?

 

Cheers

 

TIA

 

J

Link to comment
Share on other sites

  • 2 years later...

Hi,

 

I'm having issue too.

 

here is my need

 

basic price

1 attribute (x2 the regular price)

1 other attribute +5$

 

so this is what I need (10.00 x 2)+5 = 25

I want the multiplication first and only multiply once the basic price

 

Now the total give this (10+5) x2 =30

 

really need to fix it asap

Lenamtl

Link to comment
Share on other sites

  • 8 months later...

Hello, I have a problem with install this on my shop:

 

You had to add following lines in our Produkt_info.php(so you have a clean ms2):

Replace:
________________________________________________________________________________
____________
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'])) .') ';
	  }
________________________________________________________________________________
_______________
with:
________________________________________________________________________________
______________
if ($products_options['options_values_price'] != '0') {
  if ($products_options['price_prefix'] !='*') {
   $option_price_display = ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
			$option_price_display_d = $option_price_display;

					 } else {
  if ($products_options['options_values_price'] > 1)   {
					 $prozentpr = (($products_options['options_values_price'] -1) * 100 );
					 $option_price_display = ' (Price '.$prozentpr.'% increase)';
					 } else{
					  $prozentpr = ((1 - $products_options['options_values_price']) * 100 );
					 $option_price_display = ' (Price'.$prozentpr.'% decrease)';
					 }

					 $option_price_display_d = $option_price_display;
					 }
 $products_options_array[sizeof($products_options_array)-1]['text'] .= $option_price_display_d;
	}

________________________________________________________________________________
__________________


If you have the B2B Contrib installed (like me):
Replace:
________________________________________________________________________________
__________________
if ($products_options['options_values_price'] != '0') {
   $option_price_display = ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
					if (PRICES_LOGGED_IN == 'false') {
			$option_price_display_d = $option_price_display;
				}
				 	if ((PRICES_LOGGED_IN == 'true') && (!tep_session_is_registered('customer_id'))) {
			$option_price_display_d = '';
		}  else  {
			$option_price_display_d = $option_price_display;
		}
________________________________________________________________________________
__________________

with:
________________________________________________________________________________
________________
if ($products_options['options_values_price'] != '0') {
  if ($products_options['price_prefix'] !='*') {
   $option_price_display = ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
					if (PRICES_LOGGED_IN == 'false') {
			$option_price_display_d = $option_price_display;
				}
				 	if ((PRICES_LOGGED_IN == 'true') && (!tep_session_is_registered('customer_id'))) {
			$option_price_display_d = '';
		}  else  {
			$option_price_display_d = $option_price_display;
		}
					 } else {
					 if ($products_options['options_values_price'] > 1)   {
					 $prozentpr = (($products_options['options_values_price'] -1) * 100 );
					 $option_price_display = ' ('.$prozentpr.'% Aufschlag)';
					 } else{
					  $prozentpr = ((1 - $products_options['options_values_price']) * 100 );
					 $option_price_display = ' ('.$prozentpr.'% Abschlag)';
					 }
					 	if (PRICES_LOGGED_IN == 'false') {
			$option_price_display_d = $option_price_display;
				}
				 	if ((PRICES_LOGGED_IN == 'true') && (!tep_session_is_registered('customer_id'))) {
			$option_price_display_d = '';
		}  else  {
			$option_price_display_d = $option_price_display;
		}
________________________________________________________________________________
_______________________________


The second Problem comes when you check out. PHP error missed argument.

in the catalog/includes/classes/shopping_cart.php you has changed the function "attributes_price($products_id)"
to "attributes_price($products_id, $products_price)".

our old catalog/includes/classes/order.php called the function only with  + $cart->attributes_price($products[$i]['id'])); without to define $products_price.

You must change the follow calls in catalog/includes/classes/order.php:
search for attributes_price and add the products price Variable to the functin call.

In my order.php I must change this:

replaced (arround line 236):
________________________________________________________________________________
____________
'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']),
________________________________________________________________________________
____________

with:
________________________________________________________________________________
_____________
'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id'],$products[$i]['price']),
________________________________________________________________________________
______________________________

and replace (arround line 249)(B2B):
________________________________________________________________________________
____________
'final_price' => $orders_customers['customers_group_price'] + $cart->attributes_price($products[$i]['id'], $orders_customers['customers_group_price']));
________________________________________________________________________________
_________________________________


Best Regards, and sorry for my english :-)

 

but my product_info look like:

<table border="0" width="100%" cellspacing="0" cellpadding="0">

<?php
// Brak produktow BOF
///////////////////////////////////////////////////////////////////////////////
if ($product_check['total'] < 1) {
?>

<tr>
	<td><h3><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></h3></td>
</tr>
<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
</tr>

<tr>
	<td>
		<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
			<tr class="infoBoxContents">
				<td>
					<table border="0" width="100%" cellspacing="0" cellpadding="2">
						<tr>
							<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
							<td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
							<td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</td>
</tr>

<?php
///////////////////////////////////////////////////////////////////////////////
// Brak produktow EOF

} else {

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, p.products_image_pop, pd.products_url, p.products_price, p.products_retail_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id,  p.products_availability_id, p.products_maxorder  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_info = tep_db_fetch_array($product_info_query);

tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

//TotalB2B start
$product_info['products_price'] = tep_xppp_getproductprice($product_info['products_id']);
//TotalB2B end

if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
	//TotalB2B start
	$query_special_prices_hide_result = SPECIAL_PRICES_HIDE;
	if ($query_special_prices_hide_result== 'true') {
		$products_price = '<span class="Cena">' .$currencies->display_price($product_info['products_id'],$product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '';
		$nuPrice = $currencies->display_price($product_info['products_id'],$product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])). '</span>';
	} else {
		$products_price = '<span class="SmallPriceProduct"><s>'.$currencies->display_price_nodiscount($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s></span><br><span class="productSpecialPrice">' . $currencies->display_price_nodiscount($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
		$nuPrice = $currencies->display_price_nodiscount($new_price, tep_get_tax_rate($product_info['products_tax_class_id']));
	}
	//TotalB2B end
} else {
	$products_price = '<span class="Cena">' .$currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])). '</span>';
	$nuPrice = $currencies->display_price($product_info['products_id'], $product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
}

$tysiac = trim($currencies->currencies[$currency]['thousands_point']);
if ($tysiac !='') {
	$nuPrice = str_replace($tysiac, "", $nuPrice);
}
$decimal = trim($currencies->currencies[$currency]['decimal_point']);
if ($decimal !='.') {
	$nuPrice = str_replace($decimal, ".", $nuPrice);
}

if (tep_not_null($product_info['products_model'])) {
	//$products_name = '' . $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>';
	$products_name = '' . $product_info['products_name'] . '';
} else {
	$products_name = '' . $product_info['products_name'] . '';
}

$products_availability = $product_info['products_availability_id'];
 $products_availability_info_query = tep_db_query("select e.products_availability_name from " . TABLE_PRODUCTS_AVAILABILITY . " e where e.products_availability_id = '" . (int)$products_availability . "' and e.language_id = '" . (int)$languages_id . "'");
 $products_availability_info = tep_db_fetch_array($products_availability_info_query);
$products_availability_name = $products_availability_info['products_availability_name'];

$the_manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
$the_manufacturers = tep_db_fetch_array($the_manufacturer_query);

?>

<!-- Naglowek BOF /////////////////////////////////////////////////////////-->
<tr>  
  <td height="35" class="infoBoxHeading"><img src="templates/standard/images/infobox/corner_right.gif" border="0" alt="" width="30" height="35"></td>
  <td height="35" class="infoBoxHeading" width="100%"><?php echo HEADING_PRODUCT_INFO; ?></td>
  <td height="35" class="infoBoxHeading"><img src="templates/standard/images/infobox/corner_left.gif" border="0" alt="" width="30" height="35"></td>	
</tr> 
</table></td>
  </tr>	  
	  <tr>
		<td>
		   <table border="0" width="100%" cellspacing="0" cellpadding="5" class="infoBoxContents_Box">
<!-- Naglowek EOF /////////////////////////////////////////////////////////-->

<?php
// BOF: WebMakers.com Added: Show Category and Image /////////////////////////
if (SHOW_CATEGORIES=='1') {
	?>
	<tr>
		<td colspan="2">
			<table align="right">
				<tr>
					<td class="main" align="center"><?php echo tep_image(DIR_WS_IMAGES . tep_get_categories_image(tep_get_products_catagory_id($product_info_values['products_id']))); ?></td>
				</tr>
				<tr>
					<td class="main" align="center"><?php echo tep_get_categories_name(tep_get_products_catagory_id($product_info_values['products_id'])); ?></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '1'); ?></td>
	</tr>
	<?php
}
// EOF: WebMakers.com Added: Show Category and Image /////////////////////////
?>

<tr>
	<td>
	  <!-- Glowna tabela zdjecia, ceny kup, opcje ///////////////////////////-->
		<table border="0" width="100%" cellspacing="1" cellpadding="2" class="">
			<tr class="infoBoxContents">
				<td>
					<table width="100%" cellspacing="0" cellpadding="0" border="0">
						<tr>
							<td>
								<!-- Tabelka naglowka produktu BOF -->
								<table border="0" cellspacing="0" cellpadding="0" width="100%">
									<tbody>
										<!-- Nazwa produktu BOF -->
										<tr>
											<td width="100%" align="left" colspan="5">
												<table width="100%" cellspacing="0" cellpadding="2" border="0">
													<tr>
														<td class="ProductInfoTile"><?php echo $products_name; ?></td>
													</tr>
												</table>
											</td>
										</tr>
										<tr>
											<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '5'); ?></td>
										</tr>
										<!-- Nazwa produktu EOF -->

										<!-- Glowne zdjecie produktu oraz informacje o cenie, producencie, dostepnosci  BOF -->
										<tr>
											<td valign="top">
												<table border="0" cellspacing="0" cellpadding="0" width="190">
													<tr>
														<!-- Zdjecie BOF -->
						  <?php
														// Pobranie dodatkowych obrazkow
														$tab_szer = DISPLAY_IMAGE_WIDTH + 20;
														$tab_wys = DISPLAY_IMAGE_HEIGHT + 20;
														$szerokosc = DISPLAY_IMAGE_WIDTH + 16;
														$wysokosc = DISPLAY_IMAGE_HEIGHT + 16;
														$img_path = DIR_WS_IMAGES;
														?>
						  <td vAlign="middle" align="center">
															<?php
															// BOF Wyswietlanie obrazka glownego /////////
															if (tep_not_null($product_info['products_image'])) {
																?>
																<TABLE cellspacing="0" cellpadding="2" align="center" border="0" width="100%">
																	<TR>
																		<TD align=center>
																			<?php require('fotoimage.php'); ?>
																			<INPUT TYPE="hidden" NAME="current_photo_path" VALUE="">
																			<TABLE BORDER=0 ALIGN=CENTER cellpadding="0" cellspacing="0">
																				<TR>
																					<TD ALIGN="CENTER" width="<?php echo $tab_szer; ?>" height="<?php echo $tab_wys; ?>">
																						<?php
																						if (isset($product_info[products_image])) { ?>
																							<div style="border: 0px; width: <?php echo $szerokosc; ?>px; height: <?php echo $wysokosc; ?>px; padding: 0px 0px;">
																							<table border="0" cellpadding="0" cellspacing="0" width="<?php echo $szerokosc; ?>" height="<?php echo $wysokosc; ?>"><tr>
																							<td class="t1"></td>
																							<td class="t2"></td>
																							<td class="t3"></td>
																							</tr><tr>
																							<td class="t4"></td>
																							<td class="t5" align="center" valign="middle" >
																								<A HREF="java script: ShowBigPicture(current_picture)" name="big_photo_link">
																								<IMG name="big_photo" border="0" alt="" src="<?php echo tep_obrazek(DIR_WS_IMAGES . $product_info[products_image], DISPLAY_IMAGE_WIDTH, DISPLAY_IMAGE_HEIGHT); ?>"></A>
																							</td><td class="t6"></td>
																							</tr><tr>
																							<td class="t7"></td>
																							<td class="t8"></td>
																							<td class="t9"></td>
																							</tr></table>
																							</div>
																						<?php } ?>
																					</TD>
																				</TR>
																			</TABLE>
																		</td>
																	</tr>
																</table>
															<?php
															} // EOF Wyswietlanie obrazka glownego /////////
															?>
														</td>
													</tr>
													<!-- Zdjecie EOF -->

												</table>
											</td>

											<!-- Data dodania, producent, cena, przycisk kup teraz BOF -->
											<td valign="top" height="100%" width="100%">
												<table border="0" cellspacing="0" cellpadding="0" width="100%">
													<tbody>
														<?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
														<tr>
															<td>
																<table border="0" cellspacing="1" cellpadding="5" width="100%" class="TableFrame">
																	<?php
																	// Numer katalogowy BOF ////////////////////
																	if (tep_not_null($product_info['products_model'])) {
																	?>
																		<tr>
																			<td class="ProductHead" width="50%"><B><?php echo CATALOG_NUMBER; ?></B></td>
																			<td class="ProductHead" width="50%"><?php echo $product_info['products_model']; ?></td>
																		</tr>
																	<?php
																	}
																	// Numer katalogowy EOF ////////////////////

																	// Producent BOF ///////////////////////////
																	if (tep_not_null($the_manufacturers['manufacturers_name'])) {
																	?>
																		<tr>
																			<td class="ProductHead" width="50%"><?php echo '<b>' .BOX_HEADING_MANUFACTURER_INFO. '</b>' ?></TD>
																			<td class="ProductHead" width="50%"><?php echo '<a class="boxLink" href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $the_manufacturers['manufacturers_id']) . '">' .$the_manufacturers['manufacturers_name'] . '</a>'; ?></TD>
																		</TR>
																	<?php
																	}
																	// Producent EOF ///////////////////////////

																	// Dostepnosc produktu BOF /////////////////
																	if (tep_not_null($products_availability_info['products_availability_name'])) {
																	?>
																		<tr>
																			<td class="ProductHead" width="50%"><B><?php echo TEXT_AVAILABILITY; ?></B></td>
																			<td class="ProductHead" width="50%"><?php echo $products_availability_name; ?></td>
																		</tr>
																	<?php
																	}
																	// Dostepnosc produktu EOF /////////////////

																  // Maksymalna ilosc zamawianych przedmiotow BOF
																	//MAXIMUM quantity code
																	if (tep_not_null($product_info['products_maxorder']) && MAXIMUM_ORDERS == 'true') {
																		if ($product_info['products_maxorder'] > 0) {;
																		?>
																			<tr>
																				<td class="ProductHead" width="50%"><b><?php echo MAXIMUM_ORDER_TEXT; ?></b></TD>
																				<td class="ProductHead" width="50%"><?php echo ''.$product_info['products_maxorder'].''; ?></TD>
																			</TR>
																		<?php
																		}
																	}
																	//End: MAXIMUM quantity code
																	// Maksymalna ilosc zamawianych przedmiotow BOF
																	?>
																</table>
															</td>
														</tr>
														<tr>
															<td><td height="1"></td>
														</tr>
														<!-- Cena produktu BOF ////////////////////////-->
														<tr>
															<td valign="top">
																<TABLE cellSpacing="2" cellPadding="0" border="0" width="100%" class="TableFrame">
																	<tbody>
																		<TR>
																			<TD align="center" class="main">
																				<?php
																				$query_price_to_guest_result = ALLOW_GUEST_TO_SEE_PRICES;
																				if ((($query_price_to_guest_result=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
																					if ($product_info['products_price'] > 0) {
																						include($modules_folder . 'ezier_new_fields.php');
																					} else {
																						echo '<b>'.TEMPORARY_NO_PRICE.'</b>';
																					}
																				} else {
																					echo '<span class="smallText"><b>' . PRICES_LOGGED_IN_TEXT . '</b></span>';
																				}
																				?>
																			</td>
																		</TR>
																	</tbody>
																</table>
															</td>
														</tr>
													</tbody>
												</table>
											</td>
											<!-- Cena produktu EOF ////////////////////////-->
										</tr>

										<!-- Dodatkowe opcje produktu BOF /////////////-->
										<?php
										$products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
										$products_attributes = tep_db_fetch_array($products_attributes_query);
										if ($products_attributes['total'] > 0) {
											if ($currencies->currencies[$currency]['symbol_right'] != '') {
												$symbol = trim($currencies->currencies[$currency]['symbol_right']);
												$nuPrice = eregi_replace($symbol,"",$nuPrice);
											} elseif ($currencies->currencies[$currency]['symbol_left'] != '') {
												$symbol = trim($currencies->currencies[$currency]['symbol_left']);
												$nuPrice = eregi_replace($symbol,"",$nuPrice);
											} elseif ($currencies->currencies[$currency]['symbol_left'] == '' && $currencies->currencies[$currency]['symbol_lright'] == '' ) {
												$symbol = '';
												$nuPrice = $nuPrice;
											}
											?>
											<TR>
												<TD align="center" class="main" valign="top" colspan="2">
						  <TABLE cellSpacing="2" cellPadding="0" border="0" width="100%">
							<tr>
							  <td valign="top">
																<input type="hidden" name="nuPrice" value="<?php echo eregi_replace($symbol,"",$nuPrice); ?>">
																<?php
																//Options as Images. This whole php clause needs to be added
																if (OPTIONS_AS_IMAGES_ENABLED == 'true') include ('options_images.php');

																if (OPTIONS_AS_IMAGES_ENABLED == 'false') {
																  $products_id=(preg_match("/^\d{1,10}(\{\d{1,10}\}\d{1,10})*$/",$HTTP_GET_VARS['products_id']) ? $HTTP_GET_VARS['products_id'] : (int)$HTTP_GET_VARS['products_id']);
																	//++++ QT Pro: Begin Changed code //////////
																	require(DIR_WS_CLASSES . 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN . '.php');
																	$class = 'pad_' . PRODINFO_ATTRIBUTE_PLUGIN;
																	$pad = new $class($products_id);
																	echo $pad->draw();
																	//++++ QT Pro: End Changed Code ////////////
																}
																?>
															</td>
															<td>
								<TABLE cellSpacing="2" cellPadding="0" border="0" width="100%">
											<!-- Cena z wyposazeniem dodatkowym BOF -->
																	<tr>
																		<td align="right" class="smallText"><b><?php echo PRICE_WITH_OPTIONS; ?></b></td>
																	</tr>
																	<TR>
																		<TD height="5"></TD>
																	</TR>
																	<?php
																	$query_price_to_guest_result = ALLOW_GUEST_TO_SEE_PRICES;
																	if ((($query_price_to_guest_result=='true') && !(tep_session_is_registered('customer_id'))) || ((tep_session_is_registered('customer_id')))) {
																		?>
																		<tr>
																			<td align="right">
																				<?php
																				if ($currencies->currencies[$currency]['symbol_right'] != '') {
																					echo '<span class="PriceProduct" id="productNEWprice">'.$currencies->format1($nuPrice).'</span> <span class="PriceProduct">'.$currencies->currencies[$currency]['symbol_right'].'</span>';
																				} elseif ($currencies->currencies[$currency]['symbol_left'] != '') {
																					echo '<div class="PriceProduct">'.$currencies->currencies[$currency]['symbol_left'].'</span> <span class="PriceProduct" id="productNEWprice">'.$currencies->format1($nuPrice).'</span>';
																				} elseif ($currencies->currencies[$currency]['symbol_left'] == '' && $currencies->currencies[$currency]['symbol_lright'] == '' ) {
																					echo '<span class="PriceProduct" id="productNEWprice">'.$currencies->format1($nuPrice).'</span>';
																				}
																				?>
																			</td>
																		</tr>
																		<?php
																	} else {
																		?>
																		<tr>
																			<td align="center"><span class="smallText"><?php echo ''.PRICES_LOGGED_IN_TEXT.''; ?></span></td>
																		</tr>
																		<?php
																	} ?>
																	<?php
																  require(DIR_WS_INCLUDES . 'javascript/price_with_attributes.js.php');
																	?>
																<!-- Cena z wyposazeniem dodatkowym EOF -->
																</table>
									  </td>
														</tr>
													</table>
												</td>
											</tr>
										<?php
										}
										?>
										<!-- Dodatkowe opcje produktu EOF -->
		<tr>
		<td colspan="2"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
	</tr>

										<TR>
										  <td colspan="2" align="right">
											<TABLE cellSpacing="2" cellPadding="2" border="0">
											  <tr>
														<!-- Ilosc zamawianych produktow BOF -->
														<td class="main" align="righ"><?php echo ENTRY_CANTIDAD; ?>  <input type="text" name="quantity" value="1" maxlength="2" size="2"></td>
														<!-- Ilosc zamawianych produktow EOF -->

														<!-- Przycisk "do koszyka" BOF -->
														<TD align="center" class="main">
														<?php
															if ( $product_info['products_quantity'] > 0 ) {
																if ($product_info['products_price'] > 0) {
																	echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
																} else {
																	echo ''.TEMPORARY_NO_PRICE.'';
																}
															} else {
																if ( (STOCK_CHECK == 'true') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
																	echo ''.tep_image_button('button_sold.gif').'';
																} else if ( (STOCK_CHECK == 'false') && (STOCK_ALLOW_CHECKOUT != 'true') ) {
																	echo ''.tep_image_button('button_sold.gif').'';
																} else {
																	echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART);
																}
															}
														?>
														</TD>
													</TR>
												</table>
											</td>
										</tr>
										<!-- Przycisk "do koszyka" EOF -->
										</form>
									</tbody>
								</table>
								<!-- Tabelka naglowka produktu EOF -->
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</td>
</tr>

<!-- Dodatkowe zdjecia BOF //////////////////////-->
<?php
$images_product = tep_db_query("SELECT additional_images_id, products_id, images_description, medium_images, popup_images FROM " . TABLE_ADDITIONAL_IMAGES . " WHERE products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
if (tep_db_num_rows($images_product)) {
	?>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
	</tr>
	<tr>
		<td>
			<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
				<tr class="infoBoxContents">
					<td>
						<table width="100%" cellspacing="0" cellpadding="2" border="0">
							<!-- Opis BOF -->
							<tr>
								<td align="center">
									<?php require($modules_folder . FILENAME_ADDITIONAL_IMAGES); ?>
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<?php
}
?>
<!-- Dodatkowe zdjecia EOF //////////////////////-->

<!-- Opis produktu BOF ////////////////////////////////////////////////////-->
<tr>
	<td>
		<table border="0" width="100%" cellspacing="0" cellpadding="2">
			<tr>
				<td class="subTileModule"><b><?php echo PRODUCT_INFO_DESCRIPTION; ?></b></td>
			</tr>
		</table>
	</td>
</tr>
<tr>
	<td><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
</tr>
<tr>
	<td>
		<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
			<tr class="infoBoxContents">
				<td>
					<table width="100%" cellspacing="0" cellpadding="2" border="0">
						<!-- Opis BOF -->
						<TR>
							<td>
								<table cellspacing="0" cellpadding="2" border="0">
									<tr>
										<td class="main">
											<?php echo stripslashes($product_info['products_description']); ?>
										</td>
									</tr>
								</table>
							</td>
						</tr>
						<!-- Opis EOF -->

						<!-- Dodatkowe pola w opisie produktu BOF -->
						<tr>
							<td>
								<table width="100%" cellspacing="1" cellpadding="5" border="0" class="TableFrame">
																		<?php
											// START: Extra Fields Contribution v2.0b
											$extra_fields_query = tep_db_query("
											SELECT pef.products_extra_fields_status as status, pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
												FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
												LEFT JOIN  ". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
												ON ptf.products_extra_fields_id=pef.products_extra_fields_id
												WHERE ptf.products_id=" . (int)$HTTP_GET_VARS['products_id']." and ptf.products_extra_fields_value<>'' and (pef.languages_id='0' or pef.languages_id='".$languages_id."')
												ORDER BY products_extra_fields_order");

											while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
												if (! $extra_fields['status'])  // show only enabled extra field
?>



	<tr>
	<td class="ProductHead" width="50%"><b><?php echo $extra_fields['name']; ?></b>:</td>
	<td class="ProductHead" width="50%"> <?php echo $extra_fields['value']; ?></td>
	</tr>




						<?
 }
// END: Extra Fields Contribution
?>
								</table>
							</td>
						</tr>
		  <!-- Dodatkowe pola w opisie produktu EOF -->

						<!-- data dodania BOF -->
						<TR>
							<td class="smallText" align="center">
								<?php
								if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
									echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available']));
								} else {
									echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added']));
								}
								?>
							</td>
						</tr>
						<!-- data dodania EOF -->
					</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<!-- Opis produktu EOF ////////////////////////////////////////////////////-->
<tr>
	<td><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
</tr>
<!-- Dodatkowe linki BOF //////////////////////////////////////////////////-->
<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
</tr>
<tr>
	<td>
		<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
			<tr class="infoBoxContents">
				<td>
					<table width="100%" cellspacing="0" cellpadding="2" border="0">
						<tr>
							<td class="main">
								<?php echo '» <a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_blank">' . TEXT_PDF_DOWNLOAD . ' ' .tep_image(DIR_WS_TEMPLATES.'images/misc/icons/pdf.png',TEXT_PDF_DOWNLOAD) .'</a>'; ?>
							</td>
						</tr>

						<?php
						if (tep_not_null($product_info['products_url'])) {
							?>
							<tr>
								<td class="main">
									<?php echo '» ' . sprintf(TEXT_MORE_INFORMATION, tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false)); ?>
								</td>
							</tr>
							<?php
						}
						?>

						<tr>
							<td class="main">
								<?php
								if (tep_session_is_registered('customer_id')) {
									$check_query = tep_db_query("select count(*) as count from " . TABLE_PRODUCTS_NOTIFICATIONS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and customers_id = '" . $customer_id . "'");
									$check = tep_db_fetch_array($check_query);
				$notification_exists = (($check['count'] > 0) ? true : false);
								} else {
									$notification_exists = false;
								}
			  if ($notification_exists == true) {
									echo '<a class="boxLink" href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify_remove', $request_type) . '">» ' . sprintf(BOX_NOTIFICATIONS_NOTIFY_REMOVE, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a>';
								} else {
									echo '<a class="boxLink" href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=notify', $request_type) . '">» ' . sprintf(BOX_NOTIFICATIONS_NOTIFY, tep_get_products_name($HTTP_GET_VARS['products_id'])) .'</a>';
								}
								?>
							</td>
						</tr>

						<tr>
							<td class="main">
								<?php
								if (isset($HTTP_GET_VARS['products_id'])) {
									echo '<a class="boxLink" href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS_WRITE, 'products_id=' . $HTTP_GET_VARS['products_id']) . '">» ' . BOX_REVIEWS_WRITE_REVIEW .'</a>';
								}
								?>
							</td>
						</tr>

						<tr>
							<td class="main">
								<a class="boxLink" href="ask_a_question.php?products_id=<?php echo $product_info['products_id']; ?>">» <?php echo '' . TEXT_ASK_QUESTION . ''; ?></a>
							</td>
						</tr>

						<tr>
							<td class="boxLink" align="left">
								<?php
								echo tep_draw_form('compare', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_compare'));
								echo tep_draw_hidden_field('products_id', $product_info['products_id']);
								echo '» <input class="compare" type="submit" value="'.BOX_HEADING_COMPARE_CART.'"/>';
								echo '</form>';
								?>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
	</td>
</tr>
<!-- Dodatkowe linki EOF -->
<tr>
	<td><?php echo tep_draw_separator('pixel_black.gif', '100%', '1'); ?></td>
</tr>
<!-- Komentarze BOF -->
<?php
$reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where approved = 1 and products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
$reviews = tep_db_fetch_array($reviews_query);
if ($reviews['count'] > 0) {
	?>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
	</tr>
	<tr>
		<td>
			<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
				<tr class="infoBoxContents">
					<td>
						<table width="100%" cellspacing="0" cellpadding="2" border="0">
							<tr>
							<td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
							</tr>
							<tr>
								<td class="main"><?php echo '<a class="boxLink" href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '"><B>» '.IMAGE_BUTTON_REVIEWS.'</B></a></td>'; ?>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
<?php
}
// Komentarze EOF

// Previous/Next Product Buttons v3.2 ////////////////////////////////////////
if ($product_check['total'] >= 1) {
	?>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
	</tr>
	<tr>
		<td>
			<table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
				<tr class="infoBoxContents">
					<td>
						<table border="0" width="100%" cellspacing="0" cellpadding="0">
							<?php include (DIR_WS_INCLUDES . 'products_next_previous.php'); ?>
						</table>
					</td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
	</tr>
	<?php
}
?>

<tr>
	<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '3'); ?></td>
</tr>
<tr>
	<td>
		<?php
		include($modules_folder . FILENAME_RELATED_PRODUCTS);
		?>
	</td>
</tr>
<?php
}
?>
</table>

<?php
if ((USE_CACHE == 'true') && empty($SID)) {
echo '<table width="100%" cellspacing="0" cellpadding="2"><tr><td>';
echo tep_cache_also_purchased(3600);
echo '</td></tr></table>';
} else {
echo '<table width="100%" cellspacing="0" cellpadding="2"><tr><td>';
include($modules_folder . FILENAME_ALSO_PURCHASED_PRODUCTS);
echo '</td></tr></table>';
}
?>

 

Can some one help me?

Link to comment
Share on other sites

  • 3 months later...

Greetings,

 

I have installed this contribution, and made a modification to the option multiplier list to reflect a change from % increased to Total Price (selling 1 gallon of liquid, multiplied by 5, 15, 55 gallons as the options). According to this, I need to pass this option multiple information to the shipping module's product weight for accurate shipping price information. Any ideas what to change?

 

Great contrib!

 

:blink:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...