Ray UK Posted August 29, 2013 Share Posted August 29, 2013 Hi all, Im looking at this piece of code on product-list.tpl <p class="prodbutt"> {if ($product.allow_oosp || $product.quantity > 0)} {if isset($static_token)} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}&token={$static_token}", true)}" title="{l s='Add to cart'}">1{l s='Add to cart'}</a> <a href="{$product.link|escape:'htmlall':'UTF-8'}" class="button">View</a> {else} <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add&id_product={$product.id_product|intval}", true)}" title="{l s='Add to cart'}">2{l s='Add to cart'}</a> {/if} {else} <a href="{$product.link|escape:'htmlall':'UTF-8'}" class="button">3Out of Stock</a> {/if} </p> I see 3 options there If the qty is above 0, do 1 or 2 ? else do 3 (Out of stock) what are the 1st 2 options ? I do need 3 options here but cant figure it out. 1. Item in stock [ADD TO CART] [VIEW] 2. Item in stock with combinations [VIEW OPTIONS] 3. Item out of stock [OUT OF STOCK] Does anybody know how I can modify this code to achieve this ? The site I am trying to do this on is http://www.electroniccigarettee-liquid.co.uk/7-atomisers-tanks-parts I have added 4 products to this. I have the [OUT OF STOCK] working on the 2 products, but one of them shows a price of £0.00, yet the other shows the correct price ? Any help is appreciated. Ray Link to comment Share on other sites More sharing options...
Ray UK Posted August 29, 2013 Author Share Posted August 29, 2013 Any ideas on this one ? I think that all I need is the smarty code for {if product has options} Code for view item {else} Code for add/view item {endif} Link to comment Share on other sites More sharing options...
Ray UK Posted August 30, 2013 Author Share Posted August 30, 2013 (edited) ... its ok, I think I figured it out myself You can see it in action on this site... check it out on your mobile device http://www.no-match....ers-tanks-parts Edited August 30, 2013 by MerseyRay (see edit history) Link to comment Share on other sites More sharing options...
sandy8m Posted July 24, 2014 Share Posted July 24, 2014 Hi Team, How can we have a cart in search box ? Is this possible ? If so, how can we achieve this ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now