0

I using Shopware 5.5.10 on my shop. I try to set "priceValidUntil" for each product for google search console because warning on it.

enter image description here

shopware told in version 5.5.8 update

Added rich-snippets for priceValidUntil , url, image and gtin13

I have folloowing part in details/index.tpl

{block name='frontend_detail_index_buy_container_inner'}
                        <div itemprop="offers" itemscope itemtype="{if $sArticle.sBlockPrices}http://schema.org/AggregateOffer{else}http://schema.org/Offer{/if}" class="buybox--inner">
                            {* Product name *}
                            {block name='frontend_detail_index_name'}
                                <h1 class="product--title" itemprop="name" style="margin: 0px 0px 20px 0px; margin: 0rem 0rem 1.25rem 0rem;">
                                    {$sArticle.articleName}
                                </h1>
                            {/block}

How I can add the 'priceValidUntil' rich-snippets to my products?

1 Answers1

0

Shopware does not have a function that allows you to configure time-controlled prices. Accordingly there is only one template block where plugins that offer this functionality can add their rich snippets. Since the snippet is only recommended in cases where the price will be discontinued after a certain time.

This is the block: https://github.com/shopware/shopware/blob/8b4a754307c24cb26630ee72559b15b337e7ceff/themes/Frontend/Bare/frontend/detail/content/buy_container.tpl#L84

You can add your own data like this:

{extends file="parent:frontend/detail/content/buy_container.tpl"}

{block name="frontend_detail_index_data_price_valid_until"}
    {$smarty.block.parent}
    <meta itemprop="priceValidUntil" content="your-time" />
{/block} 

Those are simple template adjustments that are described in the template tutorial of shopware. It is not recommended on normal prices, since they won't end at a certain time.

//EDIT:

https://github.com/shopware/shopware/blob/fe95215f7bb9da24f4b78a86300579b340f4a1c2/themes/Frontend/Bare/frontend/detail/content/header.tpl#L14

On the product detail page shopware will use the first image of the product automatically. There are not adjustments needed - if you want to change this behavior you can use the syntax like before and change the block you want to overwrite.

https://github.com/shopware/shopware/blob/fe95215f7bb9da24f4b78a86300579b340f4a1c2/themes/Frontend/Bare/frontend/detail/content/header.tpl#L20

The same thing with ean. Shopware will use the Ean field as gtin and check the length of the input. You can use simple template adjustments to overwrite this logic.

https://github.com/shopware/shopware/blob/96161effd05153d4b95f4a9324998c047988724c/themes/Frontend/Bare/frontend/_includes/rating.tpl#L77

And the same with rating too.

mnaczenski
  • 1,508
  • 7
  • 12
  • url, image and gtin? my question ask about this, please update to accept. –  Jun 20 '19 at 20:41
  • With my answer above you should already be able to make those adjustments, because it works the same way on every template change. Even on stackoverflow one might not get everything completely done by others ;) I added an additional comment on my answer above. – mnaczenski Jun 21 '19 at 13:20