Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

STS and coding????


speed2

Recommended Posts

Posted

Hi, I am using STS 1.8 and I am thinking of adding a code to show content of shopping card at the top.

 

Is any one know how to do that?

 

This is the code i am thinking of adding

 

<table width="100%"  border="0" cellspacing="0" cellpadding="2">
<tr>
  <td><table width="100%"  border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td valign="top" width="21"><img src="images/cart.gif" alt="cart" width="21" height="16"></td>
<?php
if ($cart->count_contents() == 0) {
?>
<td valign="top" class="smallText">Your cart is empty.</td>
<?php
} else {
?>
<td valign="top" class="smallText"><?php echo '(' . $cart->count_contents() . ')' .  ($cart->count_contents() == "1" ? " Item" : " Items "); ?>  /  <?php echo $currencies->format($cart->show_total()); ?></td>
<?php
}
?>

 

Please some one advise me! very urgent

Posted

I pm'd you this code yesterday when you asked. It's in the 2nd pm because what you just pasted got cut off in the 1st pm.

 

Here it is again..

 

<table width="100%"  border="0" cellspacing="0" cellpadding="2">
 <tr>
   <td><table width="100%"  border="0" cellspacing="0" cellpadding="2">
     <tr>
       <td valign="top" width="21"><img src="images/cart.gif" alt="cart" width="21" height="16"></td>
<?php
if ($cart->count_contents() == 0) {
?>
 <td valign="top" class="smallText">Your cart is empty.</td>
<?php
} else {
?>
 <td valign="top" class="smallText"><?php echo '(' . $cart->count_contents() . ')' .  ($cart->count_contents() == "1" ? " Item" : " Items "); ?>  /  <?php echo $currencies->format($cart->show_total()); ?></td>
<?php
}
?>
     </tr>
   </table></td>
 </tr>
</table>

Posted

STS does NOT parse php code... notice the html extension..

if you want to pars PHP in a template try BTS..

<span style='font-family:Courier'>If you can't fix it Perl it!!!...</span>

******************************

Posted

Thanks guys for your prompt reply,

 

DO you guys perfer BTS over STS?

I installed a new version of OSC and BTS and BTS seems little complicated than STS.

 

Where STS is stright foward. what do you guys think? give me some advise!

Archived

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

×
×
  • Create New...