drchad Posted October 18, 2013 Share Posted October 18, 2013 Hi There, I have been searching the forums for this answer for a while, but still haven't found a clear solution. I'm looking to remove the add to cart button from the product list for only some products, not all products. I have subscription services, so on the subscription page I wish for customers to click to the main product page instead of having the ability to "add to cart" from the product list page. However, on all the other pages, I wish for the products to retain the "add to cart" button, so they don't need to click through each time to the specific product page. Anybody have a way to achieve this? Thanks, Chad Link to comment Share on other sites More sharing options...
vekia Posted October 18, 2013 Share Posted October 18, 2013 on each product edit page you can find option: 1 Link to comment Share on other sites More sharing options...
drchad Posted October 18, 2013 Author Share Posted October 18, 2013 Hi Vekia, Thank you for the reply - this doesn't work for my situation, my apologies, let me be more specific about my situation: I have a shop which uses a separate module to communicate with paypal and the prestashop back office for setting up memberships automatically. This module installs a separate button on my product pages for the memberships called "Subscribe Membership" which takes you directly to Paypal for the orders. This still communicates with Prestashop however, so making the membership products unavailable for order creates an error when trying to process memberships through Paypal. Therefore, what I really need is to have 2 things: 1. I need to have the "Add to Cart" button removed from the product list page for just the membership products 2. I need to have the "Add to Cart" button removed from the individual products pages for each membership product. **However, I still need these products to be available for ordering, or else I will receive errors. Please let me know if you think this is possible. Thanks Again Link to comment Share on other sites More sharing options...
PascalVG Posted October 19, 2013 Share Posted October 19, 2013 Maybe add some code in themes/<your theme folder>/product-list.tpl. Here you will find the code where the add to cart button is added: {/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=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="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} <span class="exclusive"><span></span>{l s='Add to cart'}</span><br /> {/if} {/if} Here you can add some check if the current customer is member of the subscription group. if so, grey-out or don't show the button. to get the groups of the customer, you can use: $customerGroups = Customer::getGroupsStatic(<ID of customer>); same in themes/<your theme folder>product.tpl Hope this helps, pascal Link to comment Share on other sites More sharing options...
drchad Posted October 19, 2013 Author Share Posted October 19, 2013 Hi Pascal, Thanks for the reply. Would it be possible to change whether or not the "add to cart" button and quantity gets displayed depending on the page? This would probably be the best option, as I still need members to view other products with the "add to cart" buttons active. I'm not very experienced with code, so thanks for your explanations. Link to comment Share on other sites More sharing options...
Salus Posted February 19, 2014 Share Posted February 19, 2014 Hi everyone, I know it's bit old post, but I still hope for a reply. I'd like to KEEP the add to cart button in product LIST view, but remove the ADD TO CART text and leave only the CART itself as a funtional button. I need this to have more space in the list and for a more clear design. I tried removing the label form product_list.tpl, but its not working. What exactly do I have to modify in the tpl to remove the text? But i also want the leave the button intact on the produt.tpl itself. I have the "force compilation" activated in backpanel. Thanks in advance Link to comment Share on other sites More sharing options...
PascalVG Posted February 19, 2014 Share Posted February 19, 2014 Salus, do I understand you correctly that you want to reduce the text on the button from 'Add to Cart' -> 'Cart' only? If so, try to use Customization->translations: - Select Front Office Translations, - Select your theme (default, or your own theme) - Choose your language (Choose USA flag if you want to 'translate' 'English' into 'alternative English': Result: Hope this is what you needed. pascal Link to comment Share on other sites More sharing options...
Salus Posted February 19, 2014 Share Posted February 19, 2014 Thank you Pascal, this is very useful too. I also though of this, but its not what I need. In needed to remove COMPLETELY the text. Vekia helped me here http://www.prestashop.com/forums/topic/309657-removing-text-add-to-cart-from-add-to-cart-button-keep-the-image/m so its kindda solved. Thank you 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