Jump to content

Adding product price to product screen : How?


BrainSuperGlue

Recommended Posts

Hi,

Using PS 1.6.1.0 with default Bootstrap theme.

I hope someone can point me in the right direction to fix this.

We have our furniture store up and running in catalogue mode. All well and good but I need to show the price of a product on the product screen.

For instance, we have a kitchen island table which when it shows on the Featured Items part of the front page, it shows the price and it gives a mouseover showing a More button and still the price.
post-1227072-0-99320200-1505259420_thumb.png

When the product screen is shown, the price doesn't show. I'd like the price to be in the area where the red square has been drawn.
post-1227072-0-36511600-1505259422_thumb.png

I had a look at the page using Inspect and it says the area in question is using a div of pb-centre-column.
post-1227072-0-05929500-1505259423_thumb.png

I take it the fix would be to add code for the product price into a tpl file so that the pb-centre-column would show it for each product.

That's where I get stuck.

Any help would be gratefully received.

Many thanks

BSG

Link to comment
Share on other sites

You need to edit product.tpl and product-list.tpl in order to have price display even in catalog mode.

Both of these files use come condition check to avoid price display if the shop is in catalog mode.

 

Removing occurences of this condition should do the job:

$PS_CATALOG_MODE

This variable might be used more than once in the files mentionned. Example:

 

From

    <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && 
    !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) ||
    !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>

Make

    <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && 
    !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || 
    !$product->available_for_order } style="display: none;"{/if}>
Edited by Scully (see edit history)
Link to comment
Share on other sites

 

You need to edit product.tpl and product-list.tpl in order to have price display even in catalog mode.

Both of these files use come condition check to avoid price display if the shop is in catalog mode.

 

Removing occurences of this condition should do the job:

$PS_CATALOG_MODE

This variable might be used more than once in the files mentionned. Example:

 

From

    <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && 
    !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) ||
    !$product->available_for_order || $PS_CATALOG_MODE} style="display: none;"{/if}>

Make

    <p id="availability_statut"{if !$PS_STOCK_MANAGEMENT || ($product->quantity <= 0 && 
    !$product->available_later && $allow_oosp) || ($product->quantity > 0 && !$product->available_now) || 
    !$product->available_for_order } style="display: none;"{/if}>

Hi,

 

OK, I remember a year ago that in order to make the prices show up in Featured Products and New Arrivals, on the home screen that I went into product.tpl and product-list.tpl.

 

Digging deeper, putting the price on the individual product screen whilst in catalogue mode isn't as easy as removing $PS_CATALOG_MODE.

 

From what I can make out, to show the price on the individual product screen there is a section called the buy_block. If you just enable this by removing $PS_CATALOG_MODE the whole cart block appears rather than just the price.

 

It's just finding the code only to display the price.

 

<div class="pb-right-column col-xs-12 col-sm-4 col-md-3">
			{if ($product->show_price && !isset($restricted_country_mode)) || isset($groups) || $product->reference || (isset($HOOK_PRODUCT_ACTIONS) && $HOOK_PRODUCT_ACTIONS)}
			<!-- add to cart form-->
			<form id="buy_block"{if $PS_CATALOG_MODE && !isset($groups) && $product->quantity > 0} class="hidden"{/if} action="{$link->getPageLink('cart')|escape:'html':'UTF-8'}" method="post">
				<!-- hidden datas -->
				<p class="hidden">
					<input type="hidden" name="token" value="{$static_token}" />
					<input type="hidden" name="id_product" value="{$product->id|intval}" id="product_page_product_id" />
					<input type="hidden" name="add" value="1" />
					<input type="hidden" name="id_product_attribute" id="idCombination" value="" />
				</p>
				<div class="box-info-product">
					<div class="content_prices clearfix">
						{if $product->show_price && !isset($restricted_country_mode) }
							<!-- prices -->
							<div>
								<p class="our_price_display" itemprop="offers" itemscope itemtype="http://schema.org/Offer">{strip}
									{if $product->quantity > 0}<link itemprop="availability" href="http://schema.org/InStock"/>{/if}
									{if $priceDisplay >= 0 && $priceDisplay <= 2}
										<span id="our_price_display" class="price" itemprop="price" content="{$productPrice}">{convertPrice price=$productPrice|floatval}</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}" />
										{hook h="displayProductPriceBlock" product=$product type="price"}
									{/if}
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...