petros Posted October 19, 2009 Share Posted October 19, 2009 I have searched the forum and found out how to completely remove add to cart button (if i want to just show the products without the ability to sell them for example). But what if i want for some products or whole category to have the ability to be sold through the add to cart button and for some products or better for a whole category not to be sold; Link to comment Share on other sites More sharing options...
rocky Posted October 19, 2009 Share Posted October 19, 2009 You could hide all the "Add to cart" buttons in a certain category by changing the "Add to cart" code in product-list.tpl from: {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Add to cart'} {else} {l s='Add to cart'} {/if} to: {if $id_category != 1} {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Add to cart'} {else} {l s='Add to cart'} {/if} {/if} where 1 is the id of the category you don't want the "Add to cart" button to appear on. Link to comment Share on other sites More sharing options...
petros Posted October 19, 2009 Author Share Posted October 19, 2009 rocky, thank you VERY MUCH for your reply.the truth is that i had in my mind something like this which is describred in this topichttp://todoprestashop.com/foro/viewtopic.php?f=17&t=434&start=10i tried it with the latest prestashop version but it did not work.my whole right sidebar keeps on dissapearing...i tried it many times following the instructions but no luck.but it is exactly what i want.to define through admin panel witch products will not be able to buy through add to cartfollowed by a customized message. Link to comment Share on other sites More sharing options...
rocky Posted October 19, 2009 Share Posted October 19, 2009 I see, so someone modified Prestashop v1.0.0.8 to add a checkbox on each product you can tick when you don't want the "Add to cart" button to appear, but you can't get it to work in v1.2.4. You'll need to compare the original files with the modified ones on that site and find what they changed. If you can make the same changes in your Prestashop v1.2.4 files instead of just overwriting the files, hopefully it will work. Unfortunately, I don't have time to do it myself at the moment. Link to comment Share on other sites More sharing options...
petros Posted October 19, 2009 Author Share Posted October 19, 2009 ok rocky, thanks again,i will try it it out as soon as i can and i will post my experience. Link to comment Share on other sites More sharing options...
petros Posted October 19, 2009 Author Share Posted October 19, 2009 rocky i did what you told and indeed...the add to cart button has vanished from the category i wanted.But...When i click on the view button of a product of ths category,the add to cart button is still there on the details page...What file do i have to modify in oder to vanish the add tocart button from the details page for the products of thespecified category;Thanks for hearing me. Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2009 Share Posted October 20, 2009 You would need to modify product.tpl in your theme's directory and do a similar thing as before, assuming that the you've set the default category of the product to the category it is hidden from: {if $product->id_category_default != 1} Link to comment Share on other sites More sharing options...
petros Posted October 20, 2009 Author Share Posted October 20, 2009 rocky thanks for replying,but,i opened product.tpl file and i dont know what exactly to change...please if you have some spare time would it be possible to be more specific.in what part of the code should i insert {if $product->id_category_default != 1};thank you very much. Link to comment Share on other sites More sharing options...
rocky Posted October 20, 2009 Share Posted October 20, 2009 You should put the code above line 283 and {/if} after the line: quantity == 0} style="display:none;"{/if} id="add_to_cart" class="buttons_bottom_block"><input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive" /></p> Link to comment Share on other sites More sharing options...
petros Posted October 21, 2009 Author Share Posted October 21, 2009 rocky thank you very much.it worked. 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