mrhill32 Posted September 30, 2014 Share Posted September 30, 2014 Hello everyone, as i my products have a range of prices depending on what combinations they choose, i would like to hide the price on the category page until they click on the product. I have removed the 'Buy now' button on the category page but now i would like to hide price, thanks! Stuart Link to comment Share on other sites More sharing options...
vekia Posted October 1, 2014 Share Posted October 1, 2014 can you show product-list.tpl file from your theme? i see that you use some custom template, so it can use different code than default Link to comment Share on other sites More sharing options...
mrhill32 Posted October 1, 2014 Author Share Posted October 1, 2014 hi! here it is:- {* * 2007-2012 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2012 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} {if isset($products)} <!-- Products list --> <div id="product_list" class="product-grid"> {foreach from=$products item=product name=products} {if ($page_name == 'category')} <div class="span {if $srpta.sellya_cat_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {elseif ($page_name == 'new-products')} <div class="span {if $srpta.sellya_newp_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {elseif ($page_name == 'best-sales')} <div class="span {if $srpta.sellya_tops_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {elseif ($page_name == 'prices-drop')} <div class="span {if $srpta.sellya_pdrop_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {elseif ($page_name == 'manufacturer')} <div class="span {if $srpta.sellya_manuf_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {elseif ($page_name == 'supplier')} <div class="span {if $srpta.sellya_supp_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {else} <div class="span {if $srpta.sellya_supp_column=='no_column'} {if $smarty.foreach.products.index % 4==0}span-first-child{/if} {else} {if $smarty.foreach.products.index % 3==0}span-first-child{/if}{/if}"> {/if} <div class="image"> {if isset($product.on_sale) && $product.on_sale && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="sale-icon">{l s='On sale!'}</span> {elseif isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE}<span class="discount-icon">{l s='Reduced price!'}</span>{/if} {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} {if isset($product.online_only) && $product.online_only}<span class="online_only">{l s='Online only!'}</span>{/if} {/if} <a href="{$product.link|escape:'htmlall':'UTF-8'}" class="product_img_link" > <img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home_default')|escape:'html'}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} {/if} /> </a> </div> <div class="description"> {$product.description_short|strip_tags:'UTF-8'|truncate:130:'...'} </div> <div class="rating hidden-phone hidden-tablet"> {hook h='displaySdsAfterProductName' idproduct=$product.id_product} </div> <div class="name">{if isset($product.pack_quantity) && $product.pack_quantity}{$product.pack_quantity|intval|cat:' x '}{/if}<a href="{$product.link|escape:'htmlall':'UTF-8'}">{$product.name|escape:'htmlall':'UTF-8'|truncate:56:'...'}</a></div> <div class="price"> <!-- <span class="price-old">{if !$priceDisplay}{displayWtPrice p=$product.special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}{/if}</span> --> {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if} {/if} <!-- <br /> <span class="price-tax">Ex Tax: $38.90</span> --> </div> <div class="cart"> {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&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&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="button">{l s='Out Of Stock'}</span><br /> {/if} {/if} </div> {if (Configuration::get('sellya_show_wishlist')==1)} <div class="wishlist"> <input type="hidden" name="qty" id="quantity_wanted" class="qtycount" value="1" size="2" maxlength="3" /> <a href="#" data-imgid="#primg_{$product.id_image}" onclick="WishlistCart('wishlist_block_list', 'add', '{$product.id_product|intval}', $('#idCombination').val(), document.getElementById('quantity_wanted').value,this); return false;">{l s='Wishlist'}</a> </div> {/if} {if isset($comparator_max_item) && $comparator_max_item} <div class="compare"> <input type="checkbox" class="comparator" id="comparator_item_{$product.id_product}" value="comparator_item_{$product.id_product}" {if isset($compareProducts) && in_array($product.id_product, $compareProducts)}checked="checked"{/if} autocomplete="off" /> <label for="comparator_item_{$product.id_product}">{l s='Compare'}</label> </div> {/if} </div> {/foreach} </div> <!-- /Products list --> <script type="text/javascript"> <!-- function display(view) { if (view == 'list') { $('.product-grid').attr('class', 'product-list'); $('.product-list > div').each(function(index, element) { html = '<div class="left">'; var image = $(element).find('.image').html(); if (image != null) { html += '<div class="image span2">' + image + '</div>'; } html += '<div class="span4">'; html += ' <div class="name">' + $(element).find('.name').html() + '</div>'; var rating = $(element).find('.rating').html(); if (rating != null) { html += '<div class="rating">' + rating + '</div>'; } html += ' <div class="description">' + $(element).find('.description').html() + '</div>'; {if (Configuration::get('sellya_show_wishlist')==1)} html += ' <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>'; {/if} {if isset($comparator_max_item) && $comparator_max_item} html += ' <div class="compare">' + $(element).find('.compare').html() + '</div>'; {/if} html += '</div>'; html += '</div>'; html += '<div class="span2">'; var price = $(element).find('.price').html(); if (price != null) { html += '<div class="price span2">' + price + '</div>'; } html += ' <div class="cart">' + $(element).find('.cart').html() + '</div>'; html += '</div>'; $(element).html(html); }); $.cookie('display', 'list'); } else { $('.product-list').attr('class', 'product-grid'); $('.product-grid > div').each(function(index, element) { html = ''; html += '<div class="pbox">'; var image = $(element).find('.image').html(); if (image != null) { html += '<div class="image">' + image + '</div>'; } html += '<div class="description hidden-phone hidden-tablet">' + $(element).find('.description').html() + '</div>'; var rating = $(element).find('.rating').html(); if (rating != null) { html += '<div class="rating hidden-phone hidden-tablet">' + rating + '</div>'; } html += '<div class="name">' + $(element).find('.name').html() + '</div>'; var price = $(element).find('.price').html(); if (price != null) { html += '<div class="price">' + price + '</div>'; } html += '<div class="cart">' + $(element).find('.cart').html() + '</div>'; {if (Configuration::get('sellya_show_wishlist')==1)} html += '<div class="wishlist">' + $(element).find('.wishlist').html() + '</div>'; {/if} {if isset($comparator_max_item) && $comparator_max_item} html += '<div class="compare">' + $(element).find('.compare').html() + '</div>'; {/if} html += '</div>'; $(element).html(html); }); $.cookie('display', 'grid'); } } view = "{Configuration::get('sellya_product_view')}"; if (view) { display(view); }else{ display('grid'); } //--></script> {/if} Link to comment Share on other sites More sharing options...
tmk Posted October 2, 2014 Share Posted October 2, 2014 Just comment/remove (better comment) this: {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))} {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if} {/if} and make backup of this file before of course Link to comment Share on other sites More sharing options...
mrhill32 Posted October 2, 2014 Author Share Posted October 2, 2014 wahooo!! you guys are legends! thank you so much it worked perfectly! One more question (sorry), how do i remove the prices from the front page, ('New Products' and 'Featured Products' Link to comment Share on other sites More sharing options...
tmk Posted October 2, 2014 Share Posted October 2, 2014 Try to comment in blocknewproducts.tpl {if (!$PS_CATALOG_MODE AND ((isset($newproduct.show_price) && $newproduct.show_price) || (isset($newproduct.available_for_order) && $newproduct.available_for_order)))} {if isset($newproduct.show_price) && $newproduct.show_price && !isset($restricted_country_mode)} <div class="price-box"> <span class="price"> {if !$priceDisplay}{convertPrice price=$newproduct.price}{else}{convertPrice price=$newproduct.price_tax_exc}{/if} </span> </div> {/if} {/if} or similar / depends on template and version you have For Featured Products comment similar one in homefeatured.tpl Those tpl file search first in your template directory and if there are no such file in main presta module directory but it isn't good practice. Link to comment Share on other sites More sharing options...
mrhill32 Posted October 2, 2014 Author Share Posted October 2, 2014 thanks for the reply, i pasted the code in and it doesn't seem to do anything, i am not sure where abouts to paste it here is my code of blocknewproducts.tpl can you show me where to put the code {* * 2007-2012 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2012 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <!-- MODULE Block new products --> <div class="box" id="categories_block_left"> <div class="box-heading" > <h2>{l s='New products' mod='blocknewproducts'}</h2></div> <div class="box-content"> <div class="box-category"> {if $new_products !== false} <ul class="product_images clearfix"> {foreach from=$new_products item='product' name='newProducts'} {if $smarty.foreach.newProducts.index < 2} <li{if $smarty.foreach.newProducts.first} class="first"{/if}><a href="{$product.link}" title="{$product.legend|escape:html:'UTF-8'}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'medium_default')}" height="{$mediumSize.height}" width="{$mediumSize.width}" alt="{$product.legend|escape:html:'UTF-8'}" /></a></li> {/if} {/foreach} </ul> <dl class="products"> {foreach from=$new_products item=newproduct name=myLoop} <dt class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}" title="{$newproduct.name|escape:html:'UTF-8'}">{$newproduct.name|strip_tags|escape:html:'UTF-8'}</a></dt> {if $newproduct.description_short}<dd class="{if $smarty.foreach.myLoop.first}first_item{elseif $smarty.foreach.myLoop.last}last_item{else}item{/if}"><a href="{$newproduct.link}">{$newproduct.description_short|strip_tags:'UTF-8'|truncate:75:'...'}</a><br /><a href="{$newproduct.link}" class="lnk_more">{l s='Read more' mod='blocknewproducts'}</a></dd>{/if} {/foreach} </dl> <p><a href="{$link->getPageLink('new-products')}" title="{l s='All new products' mod='blocknewproducts'}" class="button_large">» {l s='All new products' mod='blocknewproducts'}</a></p> {else} <p>» {l s='No new products at this time' mod='blocknewproducts'}</p> {/if} </div> </div> </div> <!-- /MODULE Block new products --> Link to comment Share on other sites More sharing options...
PrestaSOO Posted October 3, 2014 Share Posted October 3, 2014 Please clear Cache and check Force compilation ( Advanced Parameters -> Performance) to see the result. Link to comment Share on other sites More sharing options...
mrhill32 Posted October 3, 2014 Author Share Posted October 3, 2014 doing that has killed my site! Warning: include_once(/home/darthvap/public_html/override/classes/shop../../../modules/categoryquantitydiscount/categoryquantitydiscount.php) [function.include-once]: failed to open stream: No such file or directory in /home/darthvap/public_html/override/classes/shop/Product.php on line 138Warning: include_once() [function.include]: Failed opening '/home/darthvap/public_html/override/classes/shop../../../modules/categoryquantitydiscount/categoryquantitydiscount.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in/home/darthvap/public_html/override/classes/shop/Product.php on line 138Fatal error: Class 'CategoryQuantityDiscount' not found in /home/darthvap/public_html/override/classes/shop/Product.php on line 139 Link to comment Share on other sites More sharing options...
mrhill32 Posted October 3, 2014 Author Share Posted October 3, 2014 (edited) ok i had been using a cached site while debugging oops, so it is my own fault and could be anything that caused this error. I will restore and give your suggestions a try, thanks! Edited October 3, 2014 by mrhill32 (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