Jump to content

Smarty Template Code for Product Name & Desc in cart?


BryanB

Recommended Posts

I'm trying to add the product name and description in the shopping cart above where it says "subtotal"

 

I've tried using this code but it wont display:

{$product.name}-{$product.description}

 

I'd like to include it here, as it is not included if you link directly to a product.

00001072.png

 

This is on /cart.php?a=view

 

and here is my viewcart.tpl lines 9-28

<p class="ordersummary">

{$product.name}-{$product.description}<br />

{$LANG.ordersubtotal}: {$subtotal}<br />

{if $promotioncode}{$promotiondescription}: {$discount}<br />{/if}

{if $taxrate}{$taxname} @ {$taxrate}%: {$taxtotal}<br />{/if}

{if $taxrate2}{$taxname2} @ {$taxrate2}%: {$taxtotal2}<br />{/if}

<b>{$LANG.ordertotalduetoday}: {$total}</b><br />

{if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}

{$LANG.ordertotalrecurring}: {if $totalrecurringmonthly}{$totalrecurringmonthly} {$LANG.orderpaymenttermmonthly}, {/if}

{if $totalrecurringquarterly}{$totalrecurringquarterly} {$LANG.orderpaymenttermquarterly}, {/if}

{if $totalrecurringsemiannually}{$totalrecurringsemiannually} {$LANG.orderpaymenttermsemiannually}, {/if}

{if $totalrecurringannually}{$totalrecurringannually} {$LANG.orderpaymenttermannually}, {/if}

{if $totalrecurringbiennially}{$totalrecurringbiennially} {$LANG.orderpaymenttermbiennially}, {/if}{/if}

</p>

<center>

<p>Not the correct amount?

Click here to start over:

<input type="button" value="{$LANG.orderstartover}" onclick="window.location='cart.php?a=startover'" />

</p>

</center>

 

Any ideas?

Link to comment
Share on other sites

You are missing the foreach:

 

<p class="ordersummary">
[b]{foreach key=num item=product from=$products}[/b]
{$product.productinfo.name}-{$product.productinfo.description}<br />
[b]{/foreach}[/b]
{$LANG.ordersubtotal}: {$subtotal}<br />
{if $promotioncode}{$promotiondescription}: {$discount}<br />{/if}
{if $taxrate}{$taxname} @ {$taxrate}%: {$taxtotal}<br />{/if}
{if $taxrate2}{$taxname2} @ {$taxrate2}%: {$taxtotal2}<br />{/if}
<b>{$LANG.ordertotalduetoday}: {$total}</b><br />
{if $totalrecurringmonthly || $totalrecurringquarterly || $totalrecurringsemiannually || $totalrecurringannually || $totalrecurringbiennially}
{$LANG.ordertotalrecurring}: {if $totalrecurringmonthly}{$totalrecurringmonthly} {$LANG.orderpaymenttermmonthly}, {/if}
{if $totalrecurringquarterly}{$totalrecurringquarterly } {$LANG.orderpaymenttermquarterly}, {/if}
{if $totalrecurringsemiannually}{$totalrecurringsemian nually} {$LANG.orderpaymenttermsemiannually}, {/if}
{if $totalrecurringannually}{$totalrecurringannually} {$LANG.orderpaymenttermannually}, {/if}
{if $totalrecurringbiennially}{$totalrecurringbiennial ly} {$LANG.orderpaymenttermbiennially}, {/if}{/if}
</p>
<center>
<p>Not the correct amount?
Click here to start over:
<input type="button" value="{$LANG.orderstartover}" onclick="window.location='cart.php?a=startover'" />
</p>
</center> 

 

(I don't know if the description works, I'm not sure if the variable exists)

Edited by m00
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated