angelillu Posted January 20, 2015 Share Posted January 20, 2015 Buenos dias me surge esta duda, ¿como ocultar el precio de unos determinados productos al grupo de visistantes? He visto que se podía hacer por categorías, pero si solo quiero ocultar el precio a 6 productos que se encuentran en diferentes categorías. ¿como se hace? Saludos. Link to comment Share on other sites More sharing options...
ventura Posted January 20, 2015 Share Posted January 20, 2015 Lo puedes hacer mediante codigo con un condicional utilizando la variable global {$is_logged} Link to comment Share on other sites More sharing options...
ventura Posted January 21, 2015 Share Posted January 21, 2015 Tienes instalado prestashop 1.6 y utilizas la plantilla default, verdad ¿? Link to comment Share on other sites More sharing options...
angelillu Posted January 21, 2015 Author Share Posted January 21, 2015 Prestashop 1.6 con la plantilla default¡¡¡ Link to comment Share on other sites More sharing options...
ventura Posted January 21, 2015 Share Posted January 21, 2015 En el archivo themes/plantilla_utilizada/product.tpl Busca esta parte <div class="box-info-product"> <div class="content_prices clearfix"> {if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} <!-- prices --> <div class="price"> <p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> {if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if} {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if} <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> <hr class="taxinprice-element"> <span id="with-taxes" itemprop="price"> {convertPrice price=$productPrice*1.21}</span><span class="taxinprice_incl">{l s='tax incl.'}</span> </p> {hook h="displayProductPriceBlock" product=$product type="price"} {/if} </p> <p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}> <span id="reduction_percent_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if} </span> </p> <p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}> <span id="reduction_amount_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0} -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval} {/if} </span> </p> <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}> {if $priceDisplay >= 0 && $priceDisplay <= 2} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span> <!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} --> {/if} </p> {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> </div> <!-- end prices --> Y la dejas asi <div class="box-info-product"> {if in_array($product->id, array(6,4,3)) && !$is_logged}<style="display:none"> {else} <div class="content_prices clearfix"> {if $product->show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE} <!-- prices --> <div class="price"> <p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer"> {if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if} {if $priceDisplay >= 0 && $priceDisplay <= 2} <span id="our_price_display" itemprop="price">{convertPrice price=$productPrice}</span> {if $tax_enabled && ((isset($display_tax_label) && $display_tax_label == 1) || !isset($display_tax_label))} {if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if} {/if} <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> <hr class="taxinprice-element"> <span id="with-taxes" itemprop="price"> {convertPrice price=$productPrice*1.21}</span><span class="taxinprice_incl">{l s='tax incl.'}</span> </p> {hook h="displayProductPriceBlock" product=$product type="price"} {/if} </p> <p id="reduction_percent" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'percentage'} style="display:none;"{/if}> <span id="reduction_percent_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'percentage'}-{$product->specificPrice.reduction*100}%{/if} </span> </p> <p id="reduction_amount" {if !$product->specificPrice || $product->specificPrice.reduction_type != 'amount' || $product->specificPrice.reduction|floatval ==0} style="display:none"{/if}> <span id="reduction_amount_display"> {if $product->specificPrice && $product->specificPrice.reduction_type == 'amount' && $product->specificPrice.reduction|floatval !=0} -{convertPrice price=$productPriceWithoutReduction-$productPrice|floatval} {/if} </span> </p> <p id="old_price"{if (!$product->specificPrice || !$product->specificPrice.reduction) && $group_reduction == 0} class="hidden"{/if}> {if $priceDisplay >= 0 && $priceDisplay <= 2} {hook h="displayProductPriceBlock" product=$product type="old_price"} <span id="old_price_display">{if $productPriceWithoutReduction > $productPrice}{convertPrice price=$productPriceWithoutReduction}{/if}</span> <!-- {if $tax_enabled && $display_tax_label == 1}{if $priceDisplay == 1}{l s='tax excl.'}{else}{l s='tax incl.'}{/if}{/if} --> {/if} </p> {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> <!-- end prices --> En esta parte coloca todos los ids de los productos en los que no quieres que se visualice el precio si estar logeado array(6,4,3)) // Product ids No lo he probado pero debería funcionar Link to comment Share on other sites More sharing options...
angelillu Posted January 21, 2015 Author Share Posted January 21, 2015 Muchisimas Gracias Ventura¡¡¡ Si que funciona simplemente con el IF y el array que indicas y cerrandolo al final.... Indago más para ver como ocultar el boton de agregar al carrito (con el mismo sistema) y como ocultarlo en la lista de productos de categoria.... Supongo que será parecido¡¡¡ MILLONES DE GRACIAS VENTURA. Link to comment Share on other sites More sharing options...
ventura Posted January 21, 2015 Share Posted January 21, 2015 (edited) Para el product-list.tpl lo mismo pero esta parte asi {if in_array($product.id, array(6,4,3)) && !$is_logged} en vez de asi {if in_array($product->id, array(6,4,3)) && !$is_logged} Edited January 21, 2015 by ventura (see edit history) Link to comment Share on other sites More sharing options...
angelillu Posted January 21, 2015 Author Share Posted January 21, 2015 Gracias gracias gracias¡¡¡¡ Link to comment Share on other sites More sharing options...
Recommended Posts