Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP SYNTAX


OSC-Sevilla

Recommended Posts

Posted

<?php

$products_name .= '<td>'.$products_options .

 

 

 

if ($products[$i]

) >1){[/color]

 

'<br> <div class="cart_products_options">'.TEXT_PRODUCT_PART_NUMBER .'<br><p style=" font-weight:bold;">'. $products[$i][code].'</p></div>';

[color=#b22222] }[/color]

 

 

 

'</td>

</tr>

</table>'

 

?>

 

 

------------------------------------

Right after product options I would like a DIV do display but only when $products[$i][code] has a value.

 

 

Thanks

Posted

Try this

 

<?php
$products_code = $products[$i][code]) >1 ? '<div class="cart_products_options"><p>' . TEXT_PRODUCT_PART_NUMBER . '</p><p>'. $products[$i][code].'</p></div>' : '';
$products_name .= '<td>'.$products_options . $products_code'</td>
</tr>
</table>'
?>

 

How you set the condition (ie >1 or !empty or whatever) depends on what the $products[$i]

 is. Is it a number?

 

Better you do the styling in the css than all this br and inline styles

Posted

Perfect - Big Thanks:

 

$products_options .= '</div>';

}

if (($products[$i]

) >1){

$products_code = '<div class="cart_products_options"><p>' . TEXT_PRODUCT_PART_NUMBER . '</p><p>'. $products[$i][code].'</p></div>';

}

$products_name .= '<td>'.$products_options . $products_code .

 

 

'</td>

</tr>

</table>

Archived

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

×
×
  • Create New...