TheCamoHut Posted September 8, 2013 Share Posted September 8, 2013 When you’re in a category for example http://thecamohut.com/10-camo-party-supplies and click the add to cart button on an item it takes you to the home page or sometimes it takes you to an empty shopping cart?? Now if you are in the item for example http://thecamohut.com/camo-party-supplies/25-next-camo-luncheon-plates-654082768015.html the add to cart button functions correctly I would like to have a confirm this item was added rather than taking you to the cart but nevertheless it works. I have the Ajax on my cart set to OFF when it is turned on no add to cart function works. Thanks for your help, It seems as if this is a bit of an issue out there I have seen numerous bugs for this but no real solution. Matt TheCamoHut.com Link to comment Share on other sites More sharing options...
vekia Posted September 8, 2013 Share Posted September 8, 2013 links to the cart looks really weird, you should fix it and create url like: http://thecamohut.com/cart?add&id_product=26token=706741ca1e4a4070dd21980d80ee2f2b= can you show your product-list.tpl file ? i will give U solution Link to comment Share on other sites More sharing options...
TheCamoHut Posted September 8, 2013 Author Share Posted September 8, 2013 I have attached the code. {if isset($products)} <!-- Products list --> <ul id="product_list" class="clearfix"> {foreach from=$products item=product name=products} <li class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.iteration%4 == 0}last_row_item{else}item{/if}"> <a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_img_link" title="{$product.name|escape:'htmlall':'UTF-8'}"> <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /> {if isset($product.new) && $product.new == 1}<span class="new">{l s='New'}</span>{/if} </a> <p class="clear"></p> <h3><a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:26:'...':true}</a></h3> <div class="content_price"> {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if} {if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if} {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="on_sale">{l s='On sale!'}</span> {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount">{l s='Reduced price!'}</span> {else} <span style="height:16px; margin: 5px 0; display: block"></span> {/if} {if ($product.id_product_attribute == 0 || (isset($add_prod_display) && ($add_prod_display == 1))) && $product.available_for_order && !isset($restricted_country_mode) && $product.minimal_quantity <= 1 && $product.customizable != 2 && !$PS_CATALOG_MODE} {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'}"><span></span>{l s='Add to cart'}</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'}"><span></span>{l s='Add to cart'}</a> {/if} {else} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} {/if} {if isset($comparator_max_item) && $comparator_max_item} <p class="compare"> <input type="checkbox" class="comparator" id="comparator_item_{$product.id_product}" value="comparator_item_{$product.id_product}" {if isset($compareProducts) && in_array($product.id_product, $compareProducts)}checked="checked"{/if} /> <label for="comparator_item_{$product.id_product}">{l s='Select to compare'}</label> </p> {/if} </div> </li> {/foreach} </ul> <!-- /Products list --> {/if} Link to comment Share on other sites More sharing options...
TheCamoHut Posted September 25, 2013 Author Share Posted September 25, 2013 Still Having this issue any help would be apperciated!!! Link to comment Share on other sites More sharing options...
vekia Posted September 25, 2013 Share Posted September 25, 2013 hello instead of this code: {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'}"><span></span>{l s='Add to cart'}</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'}"><span></span>{l s='Add to cart'}</a> {/if} {else} use this one {if ($product.allow_oosp || $product.quantity > 0)} {if isset($static_token)} <a class="cartbutton button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}&token={$static_token}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {else} <a class="cartbutton button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$product.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$product.id_product|intval}", false)|escape:'html'}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> {/if} {else} sorry for late response Link to comment Share on other sites More sharing options...
TheCamoHut Posted September 26, 2013 Author Share Posted September 26, 2013 Thanks it works! Link to comment Share on other sites More sharing options...
vekia Posted September 26, 2013 Share Posted September 26, 2013 hello thank you for confirmation & your patience glad that it works as you expected im goiung tom ark this thread as [solved] best regards Link to comment Share on other sites More sharing options...
philipvictor Posted April 10, 2015 Share Posted April 10, 2015 Hello, I am using prestashop to making pizza online ordering system and its great but after I added the data to the site it was woring very well but suddenly when you click to add to the cart it give you another product you didn't order and in the mail notification it send to me the order plus another things I didn't order them, so any help I will be greatful Thanks 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