Jump to content

Smarty Help


kingmoore

Recommended Posts

From: order-stepone.tpl

{if $product.pricing.monthly}<option value="monthly"> {$product.pricing.monthly}
</option>{/if}

 

I would like to replace this code with some code that displays the monthly price, and then the default text... so the result would look like this:

15.00/mo - 90 USD Semi Anually etc.

 

I need to be able to parse out the actual $ amount from the smarty variable {$product.pricing.monthly}, so I am breaking into php. The problem is, I can't find a way for PHP to access $product.pricing.monthly. I can access the products array like this:

 

{php}echo $products[0]['pricing']['monthly'];{/php}

 

but in order-stepone.tpl, this is inside of a smarty loop:

 

{foreach key=num item=product from=$products}

 

The $product array is just one product from the $products (PLURAL) array, but I see no way for PHP to know the current index of the smarty array, so I don't know which product from the products array to grab my data from. Any help?

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