Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport classic fixes since making hummingbird #397

Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions config/theme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ global_settings:
- ps_linklist
hooks:
modules_to_hook:
displayAdminCustomers:
- blockwishlist
displayCustomerAccount:
- blockwishlist
displayMyAccountBlock:
- blockwishlist
displayNav1:
- ps_contactinfo
displayNav2:
Expand Down Expand Up @@ -97,6 +103,8 @@ global_settings:
- ps_featuredproducts
displayCrossSellingShoppingCart:
- ps_featuredproducts
displayProductActions:
- blockwishlist

image_types:
cart_default:
Expand Down
12 changes: 7 additions & 5 deletions templates/_partials/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
<div class="{$headerBottomName}">
<div class="container {$headerBottomName}__container">
<div id="_desktop_logo" class="logo logo-desktop order-1 order-xl-0">
{if $page.page_name == 'index'}<h1>{/if}
<a class="navbar-brand" href="{$urls.pages.index}">
<img class="logo img-fluid" src="{$shop.logo_details.src}" alt="{$shop.name}" loading="lazy" width="{$shop.logo_details.width}" height="{$shop.logo_details.height}">
</a>
{if $page.page_name == 'index'}</h1>{/if}
{if $shop.logo_details}
{if $page.page_name == 'index'}<h1>{/if}
<a class="navbar-brand" href="{$urls.pages.index}">
{renderLogo}
</a>
{if $page.page_name == 'index'}</h1>{/if}
{/if}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this? How does it react?

I'll pull up the branch in a few minutes to do a few checks

We will need to think about it for the picture tag feature

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes i tested it, it behaves the same as before, i only sent a correction, because i left the tag in the tag

</div>

{hook h='displayTop'}
Expand Down
16 changes: 16 additions & 0 deletions templates/_partials/helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}

{function renderLogo}
<a href="{$urls.pages.index}">
<img
class="logo img-fluid"
src="{$shop.logo_details.src}"
alt="{$shop.name}"
width="{$shop.logo_details.width}"
height="{$shop.logo_details.height}"
>
</a>
{/function}
JBLach marked this conversation as resolved.
Show resolved Hide resolved
28 changes: 15 additions & 13 deletions templates/_partials/microdata/head-jsonld.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
"@type": "Organization",
"name" : "{$shop.name}",
"url" : "{$urls.pages.index}",
"logo": {
"@type": "ImageObject",
"url":"{$shop.logo_details.src}"
}
{if $shop.logo_details}
"logo": {
"@type": "ImageObject",
"url":"{$shop.logo_details.src}"
}
{/if}
}
</script>

Expand Down Expand Up @@ -54,14 +56,14 @@
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [
{foreach from=$breadcrumb.links item=path name=breadcrumb}
{
"@type": "ListItem",
"position": {$smarty.foreach.breadcrumb.iteration},
"name": "{$path.title}",
"item": "{$path.url}"
}{if !$smarty.foreach.breadcrumb.last},{/if}
{/foreach}]
}
{foreach from=$breadcrumb.links item=path name=breadcrumb}
{
"@type": "ListItem",
"position": {$smarty.foreach.breadcrumb.iteration},
"name": "{$path.title}",
"item": "{$path.url}"
}{if !$smarty.foreach.breadcrumb.last},{/if}
{/foreach}]
}
</script>
{/if}
111 changes: 64 additions & 47 deletions templates/_partials/microdata/product-jsonld.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
{assign var=hasAggregateRating value=false}
{if !empty($product.productComments.averageRating) && !empty($product.productComments.nbComments)}
{assign var=hasAggregateRating value=true}
{assign var=ratingValue value=$product.productComments.averageRating}
{assign var=ratingReviewCount value=$product.productComments.nbComments}
{/if}
{if !empty($ratings.avg) && !empty($nbComments)}
{assign var=hasAggregateRating value=true}
{assign var=ratingValue value=$ratings.avg}
{assign var=ratingReviewCount value=$nbComments}
{/if}
{assign var=hasWeight value=false}
{if isset($product.weight) && ($product.weight != 0)}
{assign var=hasWeight value=true}
{/if}
{assign var=hasOffers value=$product.show_price}
<script type="application/ld+json">
{
"@context": "https://schema.org/",
Expand All @@ -11,59 +27,60 @@
"category": "{$product.category_name}",
{if !empty($product.cover)}"image" :"{$product.cover.bySize.home_default.url}",{/if}
"sku": "{if $product.reference}{$product.reference}{else}{$product.id}{/if}",
"mpn": "{if $product.mpn}{$product.mpn}{elseif $product.reference}{$product.reference}{else}{$product.id}{/if}",
{if $product.ean13}"gtin13": "{$product.ean13}",{else if $product.upc}"gtin13": "{$product.upc}",{/if}
{if $product_manufacturer->name OR $shop.name}"brand": {
"@type": "Brand",
"mpn": "{if $product.mpn}{$product.mpn}{elseif $product.reference}{$product.reference}{else}{$product.id}{/if}"
{if $product.ean13},"gtin13": "{$product.ean13}"
{else if $product.upc},"gtin13": "{$product.upc}"
{/if}
{if $product_manufacturer->name OR $shop.name},
"brand": {
"@type": "Thing",
"name": "{if $product_manufacturer->name}{$product_manufacturer->name|escape:'html':'UTF-8'}{else}{$shop.name}{/if}"
},{/if}
{if isset($nbComments) && $nbComments && $ratings.avg}"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{$ratings.avg|round:1|escape:'html':'UTF-8'}",
"reviewCount": "{$nbComments|escape:'html':'UTF-8'}"
}
{else if !empty($product.productComments.averageRating) && !empty($product.productComments.nbComments)}
"aggregateRating": {
{/if}
{if $hasAggregateRating},
"aggregateRating": {
"@type": "AggregateRating",
"ratingValue": "{$product.productComments.averageRating|round:1|escape:'html':'UTF-8'}",
"reviewCount": "{$product.productComments.nbComments|escape:'html':'UTF-8'}"
},{/if}
{if isset($product.weight) && ($product.weight != 0)}
"weight": {
"ratingValue": "{$ratingValue|round:1|escape:'html':'UTF-8'}",
"reviewCount": "{$ratingReviewCount|escape:'html':'UTF-8'}"
}
{/if}
{if $hasWeight},
"weight": {
"@context": "https://schema.org",
"@type": "QuantitativeValue",
"value": "{$product.weight}",
"unitCode": "{$product.weight_unit}"
},{/if}
{if $product.show_price}
"offers": {
"@type": "Offer",
"priceCurrency": "{$currency.iso_code}",
"name": "{$product.name|strip_tags:false}",
"price": "{$product.price_amount}",
"url": "{$product.url}",
"priceValidUntil": "{($smarty.now + (int) (60*60*24*15))|date_format:"%Y-%m-%d"}",
{if $product.images|count> 0}
"image": {strip}[
{foreach from=$product.images item=p_img name="p_img_list"}
"{$p_img.large.url}"{if not $smarty.foreach.p_img_list.last},{/if}
{/foreach}
]{/strip},
{/if}
"sku": "{if $product.reference}{$product.reference}{else}{$product.id}{/if}",
"mpn": "{if $product.mpn}{$product.mpn}{elseif $product.reference}{$product.reference}{else}{$product.id}{/if}",
{if $product.ean13}"gtin13": "{$product.ean13}",{else if $product.upc}"gtin13": "0{$product.upc}",{/if}
{if $product.condition == 'new'}"itemCondition": "https://schema.org/NewCondition",{/if}
{if $product.show_condition> 0}
{if $product.condition == 'used'}"itemCondition": "https://schema.org/UsedCondition",{/if}
{if $product.condition == 'refurbished'}"itemCondition": "https://schema.org/RefurbishedCondition",{/if}
{/if}
"availability": "{$product.seo_availability}",
"seller": {
"@type": "Organization",
"name": "{$shop.name}"
}
}
}
{/if}
{if $hasOffers},
"offers": {
"@type": "Offer",
"priceCurrency": "{$currency.iso_code}",
"name": "{$product.name|strip_tags:false}",
"price": "{$product.price_amount}",
"url": "{$product.url}",
"priceValidUntil": "{($smarty.now + (int) (60*60*24*15))|date_format:"%Y-%m-%d"}",
{if $product.images|count > 0}
"image": {strip}[
{foreach from=$product.images item=p_img name="p_img_list"}
"{$p_img.large.url}"{if not $smarty.foreach.p_img_list.last},{/if}
{/foreach}
]{/strip},
{/if}
}
"sku": "{if $product.reference}{$product.reference}{else}{$product.id}{/if}",
"mpn": "{if $product.mpn}{$product.mpn}{elseif $product.reference}{$product.reference}{else}{$product.id}{/if}",
{if $product.ean13}"gtin13": "{$product.ean13}",{else if $product.upc}"gtin13": "0{$product.upc}",{/if}
{if $product.condition == 'new'}"itemCondition": "https://schema.org/NewCondition",{/if}
{if $product.show_condition > 0}
{if $product.condition == 'used'}"itemCondition": "https://schema.org/UsedCondition",{/if}
{if $product.condition == 'refurbished'}"itemCondition": "https://schema.org/RefurbishedCondition",{/if}
{/if}
"availability": "{$product.seo_availability}",
"seller": {
"@type": "Organization",
"name": "{$shop.name}"
}
}
{/if}
}
</script>
19 changes: 10 additions & 9 deletions templates/_partials/microdata/product-list-jsonld.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"@context": "https://schema.org",
"@type": "ItemList",
"itemListElement": [
{foreach from=$listing.products item=item key="position" name=productsForJsonLd}
{
"@type": "ListItem",
"position": {$position},
"name": "{$item.name}",
"url": "{$item.url}"
}{if !$smarty.foreach.productsForJsonLd.last},{/if}
{/foreach}]
}
{foreach from=$listing.products item=item name=productsForJsonLd}
{
"@type": "ListItem",
"position": {$smarty.foreach.productsForJsonLd.iteration},
"name": "{$item.name}",
"url": "{$item.url}"
}{if !$smarty.foreach.productsForJsonLd.last},{/if}
{/foreach}
]
}
</script>
8 changes: 7 additions & 1 deletion templates/catalog/_partials/product-cover-thumbnails.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@

{hook h='displayAfterProductThumbs' product=$product}
{else}
<img class="img-fluid" src="{$urls.no_picture_image.bySize.large_default.url}" loading="lazy">
<img
class="img-fluid"
src="{$urls.no_picture_image.bySize.large_default.url}"
width="{$urls.no_picture_image.bySize.large_default.width}"
height="{$urls.no_picture_image.bySize.large_default.height}"
loading="lazy"
>
{/if}
</div>
2 changes: 1 addition & 1 deletion templates/catalog/_partials/product-prices.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

{block name='product_ecotax'}
{if $product.ecotax.amount> 0}
<p class="product__ecotax-price">{l s='Including %amount% for ecotax' d='Shop.Theme.Catalog' sprintf=['%amount%' => $product.ecotax_tax_inc]}
<p class="product__ecotax-price">{l s='Including %amount% for ecotax' d='Shop.Theme.Catalog' sprintf=['%amount%' => $product.ecotax.value]}
{if $product.has_discount}
{l s='(not impacted by the discount)' d='Shop.Theme.Catalog'}
{/if}
Expand Down
24 changes: 9 additions & 15 deletions templates/catalog/listing/product-list.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,21 @@
<section id="products">
{if $listing.products|count}

<div>
{block name='product_list_top'}
{include file='catalog/_partials/products-top.tpl' listing=$listing}
{/block}
</div>
{block name='product_list_top'}
{include file='catalog/_partials/products-top.tpl' listing=$listing}
{/block}

{block name='product_list_active_filters'}
{$listing.rendered_active_filters nofilter}
{/block}

<div>
{block name='product_list'}
{include file='catalog/_partials/products.tpl' listing=$listing productClass="col-6 col-xl-4"}
{/block}
</div>
{block name='product_list'}
{include file='catalog/_partials/products.tpl' listing=$listing productClass="col-6 col-xl-4"}
{/block}

<div>
{block name='product_list_bottom'}
{include file='catalog/_partials/products-bottom.tpl' listing=$listing}
{/block}
</div>
{block name='product_list_bottom'}
{include file='catalog/_partials/products-bottom.tpl' listing=$listing}
{/block}

{else}
<div id="js-product-list-top"></div>
Expand Down
4 changes: 2 additions & 2 deletions templates/customer/_partials/my-account-links.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
* file that was distributed with this source code.
*}
{block name='my_account_links'}
<a href="{$urls.pages.my_account}" class="account-link">
<a href="{$urls.pages.my_account}" class="account-link" data-role="back-to-your-account">
<i class="material-icons">&#xE5CB;</i>
<span>{l s='Back to your account' d='Shop.Theme.Customeraccount'}</span>
</a>
<a href="{$urls.pages.index}" class="account-link">
<a href="{$urls.pages.index}" class="account-link" data-role="home">
<i class="material-icons">&#xE88A;</i>
<span>{l s='Home' d='Shop.Theme.Global'}</span>
</a>
Expand Down
35 changes: 35 additions & 0 deletions templates/errors/410.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
{extends file='page.tpl'}

{block name="breadcrumb"}{/block}

{block name="container_class"}container container--limited-md text-center{/block}

{block name='page_header_container'}
{block name='page_title'}
<div class="page-header mb-2">
<h1 class="display-1">{$page.title}</h1>
</div>
{/block}
{/block}

{capture assign="errorContent"}
<h4>{$page.title}</h4>
<p>
{l
s='If this is a recurring problem, please [1]contact us[/1]'
d='Shop.Theme.Catalog'
sprintf=[
'[1]' => "<a href='{$urls.pages.contact}' class='alert-link'>",
'[/1]' => "</a>"
]
}
</p>
{/capture}

{block name='page_content_container'}
{include file='errors/not-found.tpl' errorContent=$errorContent}
{/block}
JBLach marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions templates/layouts/layout-both-columns.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}

{include file='_partials/helpers.tpl'}

<!doctype html>
<html lang="{$language.locale}">
<head>
Expand Down