folkifoon Posted July 18, 2014 Share Posted July 18, 2014 When i see my webshop in search results, behind the price of a product is says the product is sold out (uitverkocht in dutch).I disabled inventory management because we can always deliver the products. How can i fix this? Link to comment Share on other sites More sharing options...
nhelliwell Posted July 18, 2014 Share Posted July 18, 2014 Seems to me itemProp="availability" is only displayed when quantity is greater than 0. I've just changed {if $product->quantity > 0}<link itemprop="availability" itemtype="http://schema.org/InStock"/>{/if} to {if ($product->quantity > 0) || ($allow_oosp)}<link itemprop="availability" itemtype="http://schema.org/InStock"/>{/if} In product.tpl in my theme, to solve that immediate problem. A bigger problem is that if you have price combinations, no schema prices are detected by google at all, from what I can see it's because the html is updated locally by javascript. The HTML that google pulls to scan for schema tags, doesn't exist. Link to comment Share on other sites More sharing options...
folkifoon Posted July 19, 2014 Author Share Posted July 19, 2014 Hi, I use default theme. I cant find that exact code, i see:<link itemprop="availability" {if $product->quantity <= 0}href="http://schema.org/OutOfStock"{else}href="http://schema.org/InStock"{/if}>What can i change? thanks Link to comment Share on other sites More sharing options...
nhelliwell Posted July 19, 2014 Share Posted July 19, 2014 You could reverse the logic: <link itemprop="availability" {if ($product->quantity > 0) || ($allow_oosp)}href="http://schema.org/InStock"{else}href="http://schema.org/OutOfStock"{/if}> I haven't tested that, btw. Are you using product quantities, or just checked the Available to Order check box in product definition. Link to comment Share on other sites More sharing options...
folkifoon Posted July 21, 2014 Author Share Posted July 21, 2014 I have stock monitoring disabled. I can deliver directly from a fabric, so i dont need stock control. I would like Google not to show quantities (in this case it shows "sold out") at all. Link to comment Share on other sites More sharing options...
nhelliwell Posted July 21, 2014 Share Posted July 21, 2014 Sounds similar to how mine is setup. To allow ordering, as far as I'm aware, you would still need to check the "Available to Order" checkbox on the product definition. which should still get picked up by the code above. This is the code block I added to my product.tpl, which pretty much forces the meta data, and certainly isn't the best way to do it. But it's been useful for testing that the test live data option in google picks it up. NB. I've had to do this because I have price affecting product combinations, which updates code via javascript on local browser, so none of the original product.tpl meta data in the form gets picked up by google. This may not be best option for other implementations. Added before the <form id="buy_block"{if $PS_CATALOG_MODE line in product.tpl <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"> <link content="In Stock" itemprop="availability" itemtype="http://schema.org/InStock"/> <meta itemprop="price" content="{convertPrice price=$productPrice}"/> <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> <div itemprop="priceSpecification" itemscope itemtype="http://schema.org/PriceSpecification" <meta itemprop="minPrice" content="{convertPrice price=$productPrice}"/> <meta itemprop="priceCurrency" content="{$currency->iso_code}" /> <meta itemprop="valueAddedTaxIncluded" content="true"/> </div> </div> Link to comment Share on other sites More sharing options...
Recommended Posts