jahyax Posted August 9, 2013 Share Posted August 9, 2013 (edited) is there a way to add the "ADD TO CART" button on list of products under my favorite products? so that the customer can click 'ADD TO CART' just by being on the favorite product list and without having to click on the product itself. Edited August 12, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted August 9, 2013 Share Posted August 9, 2013 (edited) In basic, you can do something like this: edit file: modules/favoriteproducts/views/templates/front/favoriteproducts-account.tpl and add the red code: {foreach from=$favoriteProducts item=favoriteProduct} <div class="favoriteproduct clearfix"> <a href="{$link->getProductLink($favoriteProduct.id_product, null, null, null, null, $favoriteProduct.id_shop)|escape:'htmlall':'UTF-8'}" class="product_img_link"> <img src="{$link->getImageLink($favoriteProduct.link_rewrite, $favoriteProduct.image, 'medium_default')|escape:'htmlall':'UTF-8'}" alt=""/></a> <h3><a href="{$link->getProductLink($favoriteProduct.id_product, null, null, null, null, $favoriteProduct.id_shop)|escape:'htmlall':'UTF-8'}">{$favoriteProduct.name|escape:'htmlall':'UTF-8'}</a></h3> <div class="product_desc">{$favoriteProduct.description_short|strip_tags|escape:'htmlall':'UTF-8'}</div> <a class="button ajax_add_to_cart_button exclusive" rel="ajax_id_product_{$favoriteProduct.id_product|intval}" href="{$link->getPageLink('cart',false, NULL, "add=1&id_product={$favoriteProduct.id_product|intval}", false)}" title="{l s='Add to cart'}"><span></span>{l s='Add to cart'}</a> <div class="remove"> ... This does basically the job, but there should maybe be added some code for tests when exactly you can enable/ should disable the button, like when the shop is in catalog mode, the product is out of stock, if there are selectable attributes to choose first etc. This I didn't do. There are probably some sample files where they do this already. My 2 cents, pascal Edited August 10, 2013 by PascalVG (see edit history) 1 Link to comment Share on other sites More sharing options...
jahyax Posted August 9, 2013 Author Share Posted August 9, 2013 (edited) Pascal thanks a lot.. it worked.. regarding the enable/disable thing... I will try to test it later. thanks Edited August 9, 2013 by jahyax (see edit history) Link to comment Share on other sites More sharing options...
jahyax Posted August 9, 2013 Author Share Posted August 9, 2013 Pascal, so far when i set my shop into catalog mode, the add to cart button wont disappear, it is still clickable, and it will re direct to the home page. hopefully we could find a workaround on this. but your solution is very helpful , this will do the trick for now.. Link to comment Share on other sites More sharing options...
vekia Posted August 9, 2013 Share Posted August 9, 2013 it's because the code is without if condition to check the catalog_mode variable value, exactly as Pascal suggested {if (!$PS_CATALOG_MODE)} CODE HERE {/if} Link to comment Share on other sites More sharing options...
jahyax Posted August 12, 2013 Author Share Posted August 12, 2013 Cheers!! It worked! Thank you! Link to comment Share on other sites More sharing options...
vekia Posted August 12, 2013 Share Posted August 12, 2013 glad to hear that Pascal and I helped you here, and finally everything work as you expected. Im going to mark this topic as [solved] if you have any additonal questions related to this case - feel free to continue discussion here best regards Link to comment Share on other sites More sharing options...
lanijulmar Posted May 23, 2015 Share Posted May 23, 2015 Hi, I don't know if it's possible to post in a solved topic... Many thanks for the trick. It works but when I try to add a product to cart, it says that it doesn't exist Can you help me please ? Thanks in advance Link to comment Share on other sites More sharing options...
lanijulmar Posted June 8, 2015 Share Posted June 8, 2015 Up thank you Link to comment Share on other sites More sharing options...
monica.emedia Posted June 10, 2015 Share Posted June 10, 2015 (edited) hi i have replaced add to cart with request quote, so i have to remove the price display all over . at the end in the cart summary i want the customer not to enter the payment zone. please help Thanks in advance Edited June 10, 2015 by monica.emedia (see edit history) 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