Jump to content

[SOLVED] Prices Disappearing from Product List


Recommended Posts

I have a slight problem with a shop where the price is not showing in the product list.

 

I think that this is possibly quantities related because the price dissappears once an order is placed (and I think that this is when the quantity goes from 1 to 0). This only occurs in the product list - the price still shows on the product page.

 

I've attached a screenshot of the product list with some missing prices.

 

post-440367-0-82677400-1383154869_thumb.jpg

Link to comment
Share on other sites

Looks like you have a non-default theme, so hard to tell. Look in themes/<your theme folder>/product-list.tpl and look for price. There are probably some {if...} conditions around it, which may be the cause of this behaviour here. 

 

My 2 cents,

pascal

Link to comment
Share on other sites

Thanks for the reply Pascal - the theme is actually the default theme but I've adapted it to get a grid view and changed colours.

 

Here is the code related to price in the product-list.tpl (it should be the same as with the default theme as I haven't changed it) if that helps:

 

<div class="content_price">
 
				{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 isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}
			</div>
Link to comment
Share on other sites

Hi Ryan,

 

Question:

Do you use GeoLocation in your shop?

 

 

Not sure where one of the if-condition variables is set to false, but I can think of a working solution for you:

 

Change the code that you pasted above into this:

<div class="content_price">

{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 />
{else}
    <span class="price_not_available" style="display: inline;">{l s='Sold'}
    </span><br />
{/if}
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
    <span class="availability">
    {if ($product.allow_oosp || $product.quantity > 0)}
        {l s='Available'}
    {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
        {l s='Product available with different options'}
    {else}
        {l s='Out of stock'}
    {/if}
    </span>
{/if}
</div>

As you may notice, I added this piece of code (and furthermore reformatted the code, to make it more readable...)

{else}
  <span class="price_not_available" style="display: inline;">{l s='Sold'}
  </span><br />

 

My solution assumes that your remark that it doesn't how the price when the quantity = 0 (i.e. the product is sold) is correct.

 

What it does is, when the price is not shown, it displays the text Sold.

 

You can decorate the text if needed with some css:

 

Add to the file: /themes/<your theme folder>/css/global.css something like this:

 

.price_not_available {

  font-size: 14px;

  color: red;

}

 

This will set a specific font size and text colour for the word 'Sold'.

 

You can add/change this as desired. (If you need help with this, let me know what you want, then I will write the code for it)

 

Hope this works for you,

pascal.

Link to comment
Share on other sites

Thanks for your reply Pascal - much appreciated!

 

The code looks like it did make 'sold' appear by these products so in a way it worked although this is not what I am looking for... Is there a way to make the price appear (instead of sold) as I need people to see the prices that items sold for in the past, even if these products are sold out. From what you say that would be to make the price show if the quantity was 0.

 

Re: You question about whether I use GeoLocation... I do use different localization zones and have created a UK zone with different shipping rules from Europe and North America. I'm not sure whether this is geolocation though.

Link to comment
Share on other sites

Hi Ryan,

Sorry for slow response. Was a busy week...

 

Maybe try this:

<div class="content_price">

    <span class="price" style="display: inline;">
        {if !$priceDisplay}
            {convertPrice price=$product.price}
        {else}
            {convertPrice price=$product.price_tax_exc}
        {/if}
    </span><br />
{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}
    <span class="availability">
        {if ($product.allow_oosp || $product.quantity > 0)}
            {l s='Available'}
        {elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}
            {l s='Product available with different options'}
        {else}
            {l s='Out of stock'}
        {/if}
    </span>
{/if}
</div>

As you can see, I took out the if statement, and everything of the else part:

 

<div class="content_price">

{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 />
{else}
<span class="price_not_available" style="display: inline;">Sold
</span><br />
{/if}

 

 

It then always just shows the price.

 

Hope this helps,

pascal

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...