Insert conditional statement

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jbmaca
Forum Newbie
Posts: 5
Joined: Thu Sep 03, 2009 1:29 am

Insert conditional statement

Post by jbmaca »

Hi, I'm a total noob when it comes to php so was wondering if anyone here can help me with a simple request. I'm using PrestaShop and am trying to figure out a way to delete the words "Available" and "Add to cart" just in the Travel section of my website, but retain them in all the other sections. Here's the link to show you what I mean:

http://www.baby-international.com/35-travel

I understand that I need to identify that Travel section in the code somehow and insert a conditional statement? I've been playing around with the code without much luck. Can anyone nudge me in the right direction? Here's the snippet of php code that I think I need to modify somehow:

<span {if ($product.allow_oosp OR $product.quantity > 0)}class="availability"{else}class="outofstock"{/if}>{if ($product.allow_oosp OR $product.quantity > 0)}{l s='Available'}{else}{l s='Out of stock'}{/if}</span>
{if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2}
<a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$base_dir}cart.php?add&id_product={$product.id_product|intval}&token={$static_token}">{l s='Add to cart'}</a>
{else}
<span class="exclusive">{l s='Add to cart'}</span>


Any help would be greatly appreciated. Many thanks.
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: Insert conditional statement

Post by cpetercarter »

The stuff you have quoted isn't php, it is a templating language such as Smarty. No-one can help you much without knowing a lot more about the variables available to the template. I think your best bet is to ask the developers of the software you are using.
jbmaca
Forum Newbie
Posts: 5
Joined: Thu Sep 03, 2009 1:29 am

Re: Insert conditional statement

Post by jbmaca »

Oh I see, many thanks for pointing that out. I've been trying to get help on the PrestaShop forums but to no avail. Oh well, I'll see what else I can do. Thanks again for the reply.
Post Reply