Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

Commit

Permalink
🚑 SEO
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentinG committed May 11, 2021
1 parent 83160c6 commit ec0d079
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
<span class="text-sm share-product-title">{l s='Share' d='Shop.Theme.Actions'}</span>
<div class="space-x-3">
{foreach from=$social_share_links item='social_share_link'}
<a href="{$social_share_link.url}" class="text-hide" title="{$social_share_link.label}" target="_blank">
{if $social_share_link.class === 'facebook'} <i class="fab fa-facebook-f"></i>
{elseif $social_share_link.class === 'twitter'} <i class="fab fa-twitter"></i>
{else} <i class="fab fa-pinterest-p"></i> {/if}
<a href="{$social_share_link.url}" class="text-hide" title="{$social_share_link.label}" target="_blank"
rel="noopener noreferrer" aria-label="{$social_share_link.label}">
{if $social_share_link.class === 'facebook'} <i class="fab fa-facebook-f"></i><span
class="hidden">{$social_share_link.label}</span>
{elseif $social_share_link.class === 'twitter'} <i class="fab fa-twitter"></i><span
class="hidden">{$social_share_link.label}</span>
{elseif $social_share_link.class === 'pinterest'} <i class="fab fa-pinterest-p"></i><span
class="hidden">{$social_share_link.label}</span> {/if}
</a>
{/foreach}
</div>
Expand Down
5 changes: 3 additions & 2 deletions src/templates/_partials/breadcrumb.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
<meta itemprop="position" content="{$smarty.foreach.breadcrumb.iteration}">
</li>
{elseif isset($path.title)}
<li class="inline text-gray-500">
<span>> {$path.title}</span>
<li class="inline text-gray-500" itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
<span itemprop="name">{if not $smarty.foreach.breadcrumb.first}> {/if}{$path.title}</span>
<meta itemprop="position" content="{$smarty.foreach.breadcrumb.iteration}">
</li>
{/if}
{/block}
Expand Down
18 changes: 4 additions & 14 deletions src/templates/catalog/_partials/miniatures/product.tpl
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{block name='product_miniature_item'}
<div itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
{if isset($position)}
<meta itemprop="position" content="{$position}" />{/if}
<article data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}"
itemprop="item" itemscope itemtype="https://schema.org/Product">
<div>
<article data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}">
<div class="relative w-full bg-white border border-solid border-gray-200 rounded">
{block name='product_thumbnail'}
{if $product.cover}
Expand All @@ -22,11 +19,9 @@
<div class="relative w-full p-2 border-t border-solid border-gray-200">
{block name='product_name'}
{if $page.page_name == 'index'}
<h3 class="text-sm text-gray-500 text-center" itemprop="name"><a href="{$product.url}" itemprop="url"
content="{$product.url}">{$product.name|truncate:30:'...'}</a></h3>
<h3 class="text-sm text-gray-500 text-center"><a href="{$product.url}">{$product.name|truncate:30:'...'}</a></h3>
{else}
<h2 class="text-sm text-gray-500 text-center" itemprop="name"><a href="{$product.url}" itemprop="url"
content="{$product.url}">{$product.name|truncate:30:'...'}</a></h2>
<h2 class="text-sm text-gray-500 text-center"><a href="{$product.url}">{$product.name|truncate:30:'...'}</a></h2>
{/if}
{/block}

Expand Down Expand Up @@ -56,11 +51,6 @@
{/if}
</span>

<div itemprop="offers" itemscope itemtype="https://schema.org/Offer" class="invisible">
<meta itemprop="priceCurrency" content="{$currency.iso_code}" />
<meta itemprop="price" content="{$product.price_amount}" />
</div>

{hook h='displayProductPriceBlock' product=$product type='unit_price'}

{hook h='displayProductPriceBlock' product=$product type='weight'}
Expand Down
3 changes: 2 additions & 1 deletion src/templates/catalog/_partials/product-prices.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

{block name='product_price'}
<div
class="text-xl h5 {if $product.has_discount}{/if}"
class="text-xl{if $product.has_discount}{/if}"
itemprop="offers"
itemscope
itemtype="https://schema.org/Offer"
>
<link itemprop="url" href="{$product.link}" />
<link itemprop="availability" href="{$product.seo_availability}"/>
<meta itemprop="priceCurrency" content="{$currency.iso_code}">

Expand Down
6 changes: 2 additions & 4 deletions src/templates/catalog/_partials/productlist.tpl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{if $page.page_name == 'index' || $page.page_name == 'cart' || $page.page_name == 'order-confirmation' || $page.page_name == 'search'}
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-5" itemscope
itemtype="https://schema.org/ItemList">
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-5">
{foreach from=$products item="product" key="position"}
{include file="catalog/_partials/miniatures/product.tpl" product=$product position=$position}
{/foreach}
</div>
{else}
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5" itemscope
itemtype="https://schema.org/ItemList">
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5">
{foreach from=$products item="product" key="position"}
{include file="catalog/_partials/miniatures/product.tpl" product=$product position=$position}
{/foreach}
Expand Down

0 comments on commit ec0d079

Please sign in to comment.