Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need calculation for particular item


thenexgen

Recommended Posts

Hi,

 

i need to create a calculation for particular item.

 

i do this about product_id.

 

i did that in product_info.php

 

 

 

now i try to add this calc in classe/shopping_cart.php

 

 

but not work.

i did so also for other items, and work fine

this is the link

http://www.puntograph.it/shop/manifesti-affissione-p-5712.html

 

Please someone can help me?

Link to comment
Share on other sites

if($products_id==5712) /*+++++++++++++++++++++++++++++++++++++++++++++=*/
		{    

			  if ($attribute_price['products_options_name'] == 'Altezza (cm)') 
			        {
			 	$altezza=$attribute_price['t_price'];
			  }
			  if ($attribute_price['products_options_name'] == 'Base (cm)') 
			  {
				$base=$attribute_price['t_price'];
			  }
			  if($altezza!='' && $base!='')
			  {
				$cmTUNITS=($altezza*$base*$qty);
			}
			if(($cmTUNITS/10000)<1){$neocarpe=1;}else{$neocarpe=($cmTUNITS/10000);}

if ($attribute_price['products_options_name'] == 'Materiale') 
				{
					$materiale = 30;
                     if($neocarpe >= 2) 
                      {
                      $materiale=27;
                       } 
                  elseif($neocarpe >= 3) 
                       {
                     $materiale=25;
                       } 
                  elseif($neocarpe >= 5)
                      {
                      $materiale=23;

                       }
                   elseif($neocarpe >= 7)
                      {
                      $materiale=21;

                       }
                   elseif($neocarpe >= 10)
                      {
                      $materiale=19;

                       }
                   elseif($neocarpe >= 15)
                      {
                      $materiale=17;

                       }
                   elseif($neocarpe >= 20)
                      {
                     $materiale=15;

                       }
                   elseif($neocarpe >= 30)
                      {
                     $materiale=13;

                       }
                   elseif($neocarpe >= 40)
                      {
                      $materiale=11;

                       }
                   elseif($neocarpe >= 50)
                      {
                      $materiale=9;

                       }
                   elseif($neocarpe >= 70)
                      {
                      $materiale=7;

                       }
                   elseif($neocarpe >= 100)
                      {
                      $materiale=6;

                       }
					$mPrice=($neocarpe*$materiale);	

					}
if ($attribute_price['products_options_name'] == 'Plastificazione') 
				{
					$Plastificazione=$attribute_price['products_options_values_name'];


				}
				if($Plastificazione!='')
				{
					$materialeLENGTH = strlen($Plastificazione);
					$characters = 5;
					$start = $materialeLENGTH - $characters;
					$Plastificazione = substr($Plastificazione , $start ,$characters);

					$pPrice=($neocarpe*$Plastificazione);
				}
if ($attribute_price['products_options_name'] == 'Grafica') 
                  				{
				if($attribute_price['products_options_values_name']=='Realizzazione Grafica')
				{
					$graficaPrice=45;
				}
				else if($attribute_price['products_options_values_name']=='Senza Grafica')
				{
					$graficaPrice=0;

				}

			}
				$TOTPrice=$mPrice+$pPrice+$graficaPrice;

$TOTPrice = floatval($TOTPrice);



		}

 

That work in classe/shopping_cart.php

 

but if i change so

 

if($products_id==5712 && $options_values_id==1293)

 

 

or

 

if($products_id==5712)

{

if($options_values_id==1293)

{

 

 

the function not work, where I wrong?

Link to comment
Share on other sites

What is the formula for price calculation.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...