niloo Posted February 25, 2014 Share Posted February 25, 2014 (edited) Hello i want to have a text under my "Add to cart" button with linking to a cms page that i can write some rules for shipping and return so customers by clicking to this text can view a chart for shipping costs. something like this page: http://www.meincupcake.de/shop/Lebensmittelfarbstoffe/Lebensmittelfarbe-fluessig/Lebensmittelfarbe--Metallic---Pearlescent---Dunkel-Gold.html you can see text "Versand" above add to cart button that when click on it you will go to this page: http://www.meincupcake.de/shop/info/Lieferung-und-Versandkosten.html I have found this: http://hassadee.com/2012/10/06/how-to-link-to-page-of-cms-in-prestashop/ but dont know where i must put this code in my product.tpl file? thank you for helping Edited February 28, 2014 by niloo (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 25, 2014 Share Posted February 25, 2014 you can edit product.tpl file below the add to cart button you can add code like: <a href="{$link->getCmsLink(1)}">{l s='my cms page'}</a> where the 1 is an ID of page you want to link 1 Link to comment Share on other sites More sharing options...
niloo Posted February 25, 2014 Author Share Posted February 25, 2014 (edited) you can edit product.tpl file below the add to cart button you can add code like: <a href="{$link->getCmsLink(1)}">{l s='my cms page'}</a> where the 1 is an ID of page you want to link here is my tpl file. could you please tell me exactly in which line i must add this? because there is several "add to cart" text in it: {include file="$tpl_dir./errors.tpl"} {if $errors|@count == 0} <script type="text/javascript"> // <![CDATA[ // PrestaShop internal settings var currencySign = '{$currencySign|html_entity_decode:2:"UTF-8"}'; var currencyRate = '{$currencyRate|floatval}'; var currencyFormat = '{$currencyFormat|intval}'; var currencyBlank = '{$currencyBlank|intval}'; var taxRate = {$tax_rate|floatval}; var jqZoomEnabled = {if $jqZoomEnabled}true{else}false{/if}; //JS Hook var oosHookJsCodeFunctions = new Array(); ..... // Parameters {if isset($packItems) && $packItems|@count > 0} <div id="blockpack"> <h2>{l s='Pack content'}</h2> {include file="$tpl_dir./product-list.tpl" products=$packItems} </div> {/if} {/if} Edited February 28, 2014 by niloo (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 25, 2014 Share Posted February 25, 2014 below this code: <div class="price"> {if !$priceDisplay || $priceDisplay == 2} {assign var='productPrice' value=$product->getPrice(true, $smarty.const.NULL)} {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(false, $smarty.const.NULL)} {elseif $priceDisplay == 1} {assign var='productPrice' value=$product->getPrice(false, $smarty.const.NULL)} {assign var='productPriceWithoutRedution' value=$product->getPriceWithoutReduct(true, $smarty.const.NULL)} {/if} {if $product->specificPrice AND $product->specificPrice.reduction} {if $priceDisplay >= 0 && $priceDisplay <= 2} {if $productPriceWithoutRedution > $productPrice} <span id="old_price_display">{convertPrice price=$productPriceWithoutRedution}</span> <!-- {if $tax_enabled && $display_tax_label == 1} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if} --> {/if} {/if} {/if} {if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'} <span id="reduction_percent">-{$product->specificPrice.reduction*100}%</span> {elseif $product->specificPrice AND $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|intval !=0} <span id="reduction_amount">-{convertPrice price=$product->specificPrice.reduction|floatval}</span> {/if} <p class="our_price_display"> {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display">{convertPrice price=$productPrice}</span> <!--{if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) OR !isset($display_tax_label))} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if}--> {/if} </p> {if (!$allow_oosp && $product->quantity <= 0) OR !$product->available_for_order OR (isset($restricted_country_mode) AND $restricted_country_mode) OR $PS_CATALOG_MODE} <span class="exclusive"> <span></span> {l s='Add to cart'} </span> {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} {if $product->on_sale} <img src="{$img_dir}onsale_{$lang_iso}.gif" alt="{l s='On sale'}" class="on_sale_img"/> <span class="on_sale">{l s='On sale!'}</span> {elseif $product->specificPrice AND $product->specificPrice.reduction AND $productPriceWithoutRedution > $productPrice} <span class="discount">{l s='Reduced price!'}</span> {/if} {if $priceDisplay == 2} <br /> <span id="pretaxe_price"><span id="pretaxe_price_display">{convertPrice price=$product->getPrice(false, $smarty.const.NULL)}</span> {l s='tax excl.'}</span> {/if} </div> 1 Link to comment Share on other sites More sharing options...
niloo Posted February 25, 2014 Author Share Posted February 25, 2014 below this code: <div class="price"> Thank you so much. works like charm. a little customization i need. as you can see in picture it is stuck to the price. i want it to go under "add to cart" button and a little have space with it. i have highlighted the desired place. what must i do? cos in tpl file when i press enter between two cods nothing is happen. Link to comment Share on other sites More sharing options...
vekia Posted February 25, 2014 Share Posted February 25, 2014 due to the fact that this is non default theme, please share url to your shop Link to comment Share on other sites More sharing options...
niloo Posted February 25, 2014 Author Share Posted February 25, 2014 (edited) due to the fact that this is non default theme, please share url to your shop www.mysite.c@m Edited February 28, 2014 by niloo (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted February 25, 2014 Share Posted February 25, 2014 somewhere in your theme .css file (alysum.css) paste this code: .content_prices a {margin-right:140px} effect: 1 Link to comment Share on other sites More sharing options...
niloo Posted February 25, 2014 Author Share Posted February 25, 2014 where?(line number please) and i want it to a little come down and dose not stuck to button. Link to comment Share on other sites More sharing options...
vekia Posted February 25, 2014 Share Posted February 25, 2014 you can paste it anywhere you want, don't worry about line, it will work everywhere 1 Link to comment Share on other sites More sharing options...
niloo Posted February 26, 2014 Author Share Posted February 26, 2014 you can paste it anywhere you want, don't worry about line, it will work everywhere OK. Thank you. but toy didn't say what must i do for making a little space between cart button and this text? Link to comment Share on other sites More sharing options...
niloo Posted February 26, 2014 Author Share Posted February 26, 2014 my problem is not fully solved yet! please Link to comment Share on other sites More sharing options...
vekia Posted February 26, 2014 Share Posted February 26, 2014 hello you mean that you want to move the text a bit down: ? 1 Link to comment Share on other sites More sharing options...
niloo Posted February 27, 2014 Author Share Posted February 27, 2014 yes exactly, but not so many. a bout 1 or 2 line. Link to comment Share on other sites More sharing options...
vekia Posted February 27, 2014 Share Posted February 27, 2014 alysum.css line ~2262 add margin-bottom:3px; to #productsCarousel div.price span, div.price { direction: rtl; overflow: hidden !important; } final code: #productsCarousel div.price span, div.price { direction: rtl; overflow: hidden !important; margin-bottom:3px; } 1 Link to comment Share on other sites More sharing options...
niloo Posted February 28, 2014 Author Share Posted February 28, 2014 Yeh! that was what exactly i want. fully solved my problem. thank you so much Vekia. Link to comment Share on other sites More sharing options...
Ugo Fontana Posted June 14, 2016 Share Posted June 14, 2016 vekia you are a legend for me! ) i'd need a small suggestion: if i want to insert an image somewhere in product.tpl (done, thanks to your tips) but i want that image to be the #2 of uploaded product images... example: <a href="#2 thumb img" class="fancybox" width="458" height="271"> <img src="#2 big img" alt="somethingh i like" title="always same"> </a> but i don't know how to give info of the ID 2 img Link to comment Share on other sites More sharing options...
Recommended Posts