Any solution to completely hide product price of sold item, in category, product details page of front end?
Any solution to completely hide product price of sold item, in category, product details page of front end?
You can find this code
{capture name="price_`$obj_id`"}
{if $show_price_values}
{if $show_price}
{hook name="products:prices_block"}
{if $product.price|floatval || $product.zero_price_action == "P" || ($hide_add_to_cart_button == "Y" && $product.zero_price_action == "A")}
{include file="common/price.tpl" value=$product.price span_id="discounted_price_`$obj_prefix``$obj_id`" class="ty-price-num" live_editor_name="product:price:{$product.product_id}" live_editor_phrase=$product.base_price}
{elseif $product.zero_price_action == "A" && $show_add_to_cart}
{assign var="base_currency" value=$currencies[$smarty.const.CART_PRIMARY_CURRENCY]}
{__("enter_your_price")}:
{if $base_currency.after != "Y"}{$base_currency.symbol nofilter}{/if}
{if $base_currency.after == "Y"}{$base_currency.symbol nofilter}{/if}
{elseif $product.zero_price_action == "R"}
<span class="ty-no-price">{__("contact_us_for_price")}</span>
{assign var="show_qty" value=false}
{/if}
{/hook}
{/if}
{elseif $settings.General.allow_anonymous_shopping == "hide_price_and_add_to_cart" && !$auth.user_id}
<span class="ty-price">{__("sign_in_to_view_price")}</span>
{/if}
<!--price_update_{$obj_prefix}{$obj_id}--></span>
{/capture}
in the design/themes/YOUR_THEME/templates/common/product_data.tpl and replace it with this code:
{capture name="price_`$obj_id`"}
{if $product.amount}
z
{if $show_price_values}
{if $show_price}
{hook name="products:prices_block"}
{if $product.price|floatval || $product.zero_price_action == "P" || ($hide_add_to_cart_button == "Y" && $product.zero_price_action == "A")}
{include file="common/price.tpl" value=$product.price span_id="discounted_price_`$obj_prefix``$obj_id`" class="ty-price-num" live_editor_name="product:price:{$product.product_id}" live_editor_phrase=$product.base_price}
{elseif $product.zero_price_action == "A" && $show_add_to_cart}
{assign var="base_currency" value=$currencies[$smarty.const.CART_PRIMARY_CURRENCY]}
{__("enter_your_price")}:
{if $base_currency.after != "Y"}{$base_currency.symbol nofilter}{/if}
{if $base_currency.after == "Y"}{$base_currency.symbol nofilter}{/if}
{elseif $product.zero_price_action == "R"}
<span class="ty-no-price">{__("contact_us_for_price")}</span>
{assign var="show_qty" value=false}
{/if}
{/hook}
{/if}
{elseif $settings.General.allow_anonymous_shopping == "hide_price_and_add_to_cart" && !$auth.user_id}
<span class="ty-price">{__("sign_in_to_view_price")}</span>
{/if}
<!--price_update_{$obj_prefix}{$obj_id}--></span>
{/if}
{/capture}
We recommend you to use the products:prices_block and products:old_price hooks for this feature
Any solution to completely hide product price of sold item, in category, product details page of front end?
Does it apply to a product that is out of stock Darius ?
Did not test this solution so far.
Does it apply to a product that is out of stock Darius ?