Ryan_Glass Posted October 30, 2013 Share Posted October 30, 2013 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. Link to comment Share on other sites More sharing options...
PascalVG Posted October 31, 2013 Share Posted October 31, 2013 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 More sharing options...
Ryan_Glass Posted October 31, 2013 Author Share Posted October 31, 2013 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 More sharing options...
PascalVG Posted November 1, 2013 Share Posted November 1, 2013 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 More sharing options...
Ryan_Glass Posted November 4, 2013 Author Share Posted November 4, 2013 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 More sharing options...
Ryan_Glass Posted November 11, 2013 Author Share Posted November 11, 2013 Bumping the last post... Is there a way to make the prices appear rather than 'sold' as I need people to see the prices that items were sold at in the past. Link to comment Share on other sites More sharing options...
PascalVG Posted November 11, 2013 Share Posted November 11, 2013 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 More sharing options...
Ryan_Glass Posted November 11, 2013 Author Share Posted November 11, 2013 This did the trick! Many thanks for your help - much appreciated Link to comment Share on other sites More sharing options...
PascalVG Posted November 11, 2013 Share Posted November 11, 2013 Great! I'll mark the topic as solved :-) pascal 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