olly79 Posted September 6, 2010 Share Posted September 6, 2010 Hi all,Just wondering if someone can assist me with the following query.I want to disable the cart from view and equally I want to change all the "add to cart" buttons to "enquire now" and for this button to take a customer to the contact form page. Is it also possible to prepopulate the contact form with the product the customer is enquiring about in the message field?help with what files and where would be much appreciated. Link to comment Share on other sites More sharing options...
Patric Posted September 6, 2010 Share Posted September 6, 2010 Topic moved. Please post in the good sections. Link to comment Share on other sites More sharing options...
rocky Posted September 8, 2010 Share Posted September 8, 2010 You will need to change line 283 of product.tpl in your theme's directory (in PrestaShop v1.3.1) from: 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> to: quantity == 0} style="display:none;"{/if} id="add_to_cart" class="buttons_bottom_block"><a href="{$base_dir_ssl}contact-form.php?product_name={$product->name}" class="exclusive">{l s='Contact us'} Then change line 37 of contact-form.tpl from: <textarea id="message" name="message" rows="7" cols="35">{if isset($smarty.post.message)}{$smarty.post.message|escape:'htmlall':'UTF-8'|stripslashes}{/if}</textarea> to: <textarea id="message" name="message" rows="7" cols="35">{if isset($smarty.post.message)}{$smarty.post.message|escape:'htmlall':'UTF-8'|stripslashes}{elseif $smarty.get.product_name}{$smarty.get.product_name} {/if}</textarea> This will add the product name to the message field followed by two new line characters. 1 Link to comment Share on other sites More sharing options...
olly79 Posted September 14, 2010 Author Share Posted September 14, 2010 Hi,I have amended the lines you have referenced; however, the change is only applied to the products; however, I wonder if you could assist me in doing the same for products displayed on the home page as these still have 'add to cart' displayed?This is the code for featured-products.tpl: <!-- MODULE Home Featured Products --> {l s='Featured products' mod='homefeatured'} {if isset($products) AND $products} {foreach from=$products item=product name=homeFeaturedProducts} getImageLink($product.link_rewrite, $product.id_image, 'home')}" height="{$homeSize.height}" width="{$homeSize.width}" alt="{$product.name|escape:html:'UTF-8'}" /> {$product.name|truncate:27:'...'|escape:'htmlall':'UTF-8'} {if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if} {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'} {else} {l s='Add to cart' mod='homefeatured'} {/if} {/foreach} {else} {l s='No featured products' mod='homefeatured'} {/if} <!-- /MODULE Home Featured Products --> Also I want to hide the 'shopping cart' on the home page and every other page please.Any help much appreciated. Link to comment Share on other sites More sharing options...
rocky Posted September 15, 2010 Share Posted September 15, 2010 Change: {if ($product.quantity > 0 OR $product.allow_oosp) AND $product.customizable != 2} {l s='Add to cart' mod='homefeatured'} {else} {l s='Add to cart' mod='homefeatured'} {/if} to: <a href="{$base_dir_ssl}contact-form.php?product_name={$product.name}" class="exclusive">{l s='Contact us'} Link to comment Share on other sites More sharing options...
olly79 Posted September 15, 2010 Author Share Posted September 15, 2010 Hi,That is great and works perfectly, so thank you very much for that.The only thing that I need to do now is disable the 'shopping cart' from the INDEX and every other page if you could help me with that also.Thanks Link to comment Share on other sites More sharing options...
jaimeweb Posted September 15, 2010 Share Posted September 15, 2010 You can remove the cart from the left hand side by going to Modules and uninstalling Cart Block. Link to comment Share on other sites More sharing options...
olly79 Posted September 16, 2010 Author Share Posted September 16, 2010 Hi,Great, that has cleared that up and the only other elements that I need to remove is 'quantity' if anyone can point me in the direction of where to remove this from please?Just as a side note I have already disabled "Enable stock management", however, quanityt still shows up against each product form someone to enter before purchase.Also I entered 0 under “Display last quantities when qty is lower than” on the Preferences > Products tab; however, it still shows up.Thanks Link to comment Share on other sites More sharing options...
lomfords Posted September 29, 2010 Share Posted September 29, 2010 Hi, I want to change the name on the Add To Cart button for featured products. I can't locate the featured-products.tpl: referred to in Olly79's post above? Link to comment Share on other sites More sharing options...
MrBaseball34 Posted September 29, 2010 Share Posted September 29, 2010 It's called homefeatured.tpl and it's located in the modules/homefeatured directory. Link to comment Share on other sites More sharing options...
Rukshar Khan Posted October 10, 2012 Share Posted October 10, 2012 will this article apply for prestashop 1.5? Link to comment Share on other sites More sharing options...
Acidy Posted October 26, 2012 Share Posted October 26, 2012 Yes, it works with 1.5. If you copy paste the code above don't forget to close the </a>. And you may want to change product-list.tpl too (same changes as homefeatured.tpl) Link to comment Share on other sites More sharing options...
mayekk Posted December 6, 2012 Share Posted December 6, 2012 (edited) what about adding "Contact Us" button along with "Add to Cart" ? I tried this in product.tpl in theme dir: original: {else} <p id="add_to_cart" class="buttons_bottom_block"> <span></span> <input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive"/> </p> {/if} modified: {else} <p id="add_to_cart" class="buttons_bottom_block"> <span></span> <input type="submit" name="Submit" value="{l s='Add to cart'}" class="exclusive"/> </p> <p id="add_to_cart" class="buttons_bottom_block"> <span></span> <a href="{$base_dir_ssl}contact-form.php?product_name={$product->name}" class="exclusive">{l s='Contact Us'} </p> {/if} (just another <p>), but this added "Contact Us" button on every div below... PS 1.5.x Edited December 6, 2012 by mayekk (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