Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Mar 2007
    Posts
    44
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question A little bit of Smarty coding help needed.

    i have a line of code that i changed before my shopping cart was upgraded. The old code that i easily edited with ease but the new code i need a little help with.

    the old code was

    {if $product.list_price > $product.price}{$lang.our_price}{else}{$lang.price}{/if}: {include file="common_templates/price.tpl" value=$product.price span_id="original_price_`$product.product_id`"}

    REPLACED WITH

    {if $product.list_price > $product.price}{$lang.our_price}{else}{$lang.price}{/if}: {if $product.price == 0}{$lang.free} {else}{include file="common_templates/price.tpl" value=$product.price span_id="original_price_`$product.product_id`"}{/if}

    My new code is like this and i cannot get my head around it.

    {if $product.list_price > $product.price && $product.price != 0}
    <div class="list-price">{$lang.list_price}: {include file="common_templates/price.tpl" value=$product.list_price span_id="list_price_`$product.product_id`" class="list-price"}</div>
    {/if}


    help please !

    Thanks

    Richard

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Posts
    201
    Thanks
    8
    Thanked 1 Time in 1 Post
    Is that even PHP? that code looks weird to me :S

  • #3
    New Coder
    Join Date
    Mar 2005
    Location
    Indiana (USA)
    Posts
    50
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Ok so you need this code interpreted and translated into English? I think I can do that for you.
    Code:
    {if $product.list_price > $product.price && $product.price != 0}
    <div class="list-price">{$lang.list_price}: {include file="common_templates/price.tpl" value=$product.list_price span_id="list_price_`$product.product_id`" class="list-price"}</div>
    {/if}
    If $product.list_price is greater than $product.price and $product.price does not equal 0 then output the following:
    <div class="list-price">{$lang.list_price}: {include file="common_templates/price.tpl" value=$product.list_price span_id="list_price_`$product.product_id`" class="list-price"}


    what you output is the beginnings of a div tag, and then $lang.list_price is replaced with whatever it equals, then you have a ":" then you include the file that is found at common_templates/price.tpl. I and not sure that the value, span_id, and class are used for, but they should be replaced with their values.


    Is that what you needed?

  • #4
    Senior Coder
    Join Date
    Mar 2003
    Location
    Atlanta
    Posts
    1,037
    Thanks
    14
    Thanked 30 Times in 28 Posts
    Quote Originally Posted by Anthony2oo4 View Post
    Is that even PHP? that code looks weird to me :S
    Its PHP to an extent. They are using the Smarty templating to use templates on their site. The above code is parsed by the Smarty class.

    As far as your question....exactly what is your question??
    Most of my questions/posts are fairly straightforward and simple. I post long verbose messages in an attempt to be thorough.

  • #5
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Not sure about your problem, perhaps CS-cart can help with that?

    I have noticed though that you appear to be ripping off Template Monster designs:

    1) His Template | TemplateMonster's

    2) His Template | TemplateMonsters

    3) His Template | TemplateMonster's

    4) His Template | TemplateMonster's

  • #6
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    At least they are a lot cheaper

  • #7
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by aedrin View Post
    At least they are a lot cheaper
    So copyright theft doesnt bother you?

  • #8
    Senior Coder kbluhm's Avatar
    Join Date
    Apr 2007
    Location
    Philadelphia, PA, USA
    Posts
    1,509
    Thanks
    3
    Thanked 258 Times in 254 Posts
    I think he was being facetious.

    Even the names could be compared... Demon vs. Monster. Certainly arbitrary, but very interesting.

  • #9
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by kbluhm View Post
    I think he was being facetious.

    Even the names could be compared... Demon vs. Monster. Certainly arbitrary, but very interesting.
    God i hope so

  • #10
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Of course I was joking. :P


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •