diff --git a/tests/Selenium/helpers/checkout.js b/tests/Selenium/helpers/checkout.js index e3834cb5582c5..862e257315174 100644 --- a/tests/Selenium/helpers/checkout.js +++ b/tests/Selenium/helpers/checkout.js @@ -5,7 +5,7 @@ import fixtures from '../fixtures'; export function addSomeProductToCart () { return browser .url(fixtures.urls.aCategoryWithProducts) - .click('.product-miniature:nth-of-type(2) a.product-thumbnail') + .click('.products :nth-of-type(2) a.product-thumbnail') .click('[data-button-action="add-to-cart"]') .waitForVisible('#blockcart-modal') ; diff --git a/themes/classic/modules/ps_bestsellers/views/templates/hook/ps_bestsellers.tpl b/themes/classic/modules/ps_bestsellers/views/templates/hook/ps_bestsellers.tpl index 66f1286083971..891a4cb4fd202 100644 --- a/themes/classic/modules/ps_bestsellers/views/templates/hook/ps_bestsellers.tpl +++ b/themes/classic/modules/ps_bestsellers/views/templates/hook/ps_bestsellers.tpl @@ -26,11 +26,7 @@

{l s='Best Sellers' d='Shop.Theme.Catalog'}

-
- {foreach from=$products item="product"} - {include file="catalog/_partials/miniatures/product.tpl" product=$product} - {/foreach} -
+ {include file="catalog/_partials/productlist.tpl" products=$products} {l s='All best sellers' d='Shop.Theme.Catalog'} diff --git a/themes/classic/modules/ps_categoryproducts/views/templates/hook/ps_categoryproducts.tpl b/themes/classic/modules/ps_categoryproducts/views/templates/hook/ps_categoryproducts.tpl index 3139444804cda..932e56d5f2f39 100644 --- a/themes/classic/modules/ps_categoryproducts/views/templates/hook/ps_categoryproducts.tpl +++ b/themes/classic/modules/ps_categoryproducts/views/templates/hook/ps_categoryproducts.tpl @@ -30,9 +30,5 @@ {l s='%s other products in the same category:' sprintf=[$products|@count] d='Shop.Theme.Catalog'} {/if} -
- {foreach from=$products item="product"} - {include file="catalog/_partials/miniatures/product.tpl" product=$product} - {/foreach} -
+ {include file="catalog/_partials/productlist.tpl" products=$products} diff --git a/themes/classic/modules/ps_crossselling/views/templates/hook/ps_crossselling.tpl b/themes/classic/modules/ps_crossselling/views/templates/hook/ps_crossselling.tpl index 020b16d5cbf02..d3f9d15f8da71 100644 --- a/themes/classic/modules/ps_crossselling/views/templates/hook/ps_crossselling.tpl +++ b/themes/classic/modules/ps_crossselling/views/templates/hook/ps_crossselling.tpl @@ -25,9 +25,5 @@ diff --git a/themes/classic/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl b/themes/classic/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl index a3213fbc0270d..a113ccb47440b 100644 --- a/themes/classic/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl +++ b/themes/classic/modules/ps_featuredproducts/views/templates/hook/ps_featuredproducts.tpl @@ -26,11 +26,7 @@

{l s='Popular Products' d='Shop.Theme.Catalog'}

-
- {foreach from=$products item="product"} - {include file="catalog/_partials/miniatures/product.tpl" product=$product} - {/foreach} -
+ {include file="catalog/_partials/productlist.tpl" products=$products} {l s='All products' d='Shop.Theme.Catalog'} diff --git a/themes/classic/modules/ps_newproducts/views/templates/hook/ps_newproducts.tpl b/themes/classic/modules/ps_newproducts/views/templates/hook/ps_newproducts.tpl index 0bb9779458d08..3490f795b66c1 100644 --- a/themes/classic/modules/ps_newproducts/views/templates/hook/ps_newproducts.tpl +++ b/themes/classic/modules/ps_newproducts/views/templates/hook/ps_newproducts.tpl @@ -27,11 +27,7 @@

{l s='New products' d='Shop.Theme.Catalog'}

-
- {foreach from=$products item="product"} - {include file="catalog/_partials/miniatures/product.tpl" product=$product} - {/foreach} -
+ {include file="catalog/_partials/productlist.tpl" products=$products} {l s='All new products' d='Shop.Theme.Catalog'} diff --git a/themes/classic/modules/ps_specials/views/templates/hook/ps_specials.tpl b/themes/classic/modules/ps_specials/views/templates/hook/ps_specials.tpl index 0671ada3df6e2..239118bac9114 100644 --- a/themes/classic/modules/ps_specials/views/templates/hook/ps_specials.tpl +++ b/themes/classic/modules/ps_specials/views/templates/hook/ps_specials.tpl @@ -27,11 +27,7 @@

{l s='On sale' d='Shop.Theme.Catalog'}

-
- {foreach from=$products item="product"} - {include file="catalog/_partials/miniatures/product.tpl" product=$product} - {/foreach} -
+ {include file="catalog/_partials/productlist.tpl" products=$products} {l s='All sale products' d='Shop.Theme.Catalog'} diff --git a/themes/classic/modules/ps_viewedproduct/views/templates/hook/ps_viewedproduct.tpl b/themes/classic/modules/ps_viewedproduct/views/templates/hook/ps_viewedproduct.tpl index a8be2f3d75dbd..df227e0dfba19 100644 --- a/themes/classic/modules/ps_viewedproduct/views/templates/hook/ps_viewedproduct.tpl +++ b/themes/classic/modules/ps_viewedproduct/views/templates/hook/ps_viewedproduct.tpl @@ -24,9 +24,5 @@ *} diff --git a/themes/classic/templates/catalog/_partials/miniatures/product.tpl b/themes/classic/templates/catalog/_partials/miniatures/product.tpl index d830b3fd3010e..02a20c1855355 100644 --- a/themes/classic/templates/catalog/_partials/miniatures/product.tpl +++ b/themes/classic/templates/catalog/_partials/miniatures/product.tpl @@ -23,7 +23,9 @@ * International Registered Trademark & Property of PrestaShop SA *} {block name='product_miniature_item'} -
+
+ +
{block name='product_thumbnail'} {if $product.cover} @@ -44,9 +46,9 @@
{block name='product_name'} {if $page.page_name == 'index'} -

{$product.name|truncate:30:'...'}

+

{else} -

{$product.name|truncate:30:'...'}

+

{/if} {/block} @@ -68,7 +70,11 @@ {hook h='displayProductPriceBlock' product=$product type="before_price"} {l s='Price' d='Shop.Theme.Catalog'} - {$product.price} + {$product.price} + {hook h='displayProductPriceBlock' product=$product type='unit_price'} @@ -99,4 +105,5 @@
+
{/block} diff --git a/themes/classic/templates/catalog/_partials/productlist.tpl b/themes/classic/templates/catalog/_partials/productlist.tpl new file mode 100644 index 0000000000000..945443efd903c --- /dev/null +++ b/themes/classic/templates/catalog/_partials/productlist.tpl @@ -0,0 +1,29 @@ +{** + * 2007-2019 PrestaShop and Contributors + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License 3.0 (AFL-3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * https://opensource.org/licenses/AFL-3.0 + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@prestashop.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade PrestaShop to newer + * versions in the future. If you wish to customize PrestaShop for your + * needs please refer to https://www.prestashop.com for more information. + * + * @author PrestaShop SA + * @copyright 2007-2019 PrestaShop SA and Contributors + * @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0) + * International Registered Trademark & Property of PrestaShop SA + *} +
+ {foreach from=$products item="product" key="position"} + {include file="catalog/_partials/miniatures/product.tpl" product=$product position=$position} + {/foreach} +
\ No newline at end of file diff --git a/themes/classic/templates/catalog/_partials/products.tpl b/themes/classic/templates/catalog/_partials/products.tpl index 6089cf71a14c4..226fe72bf3c60 100644 --- a/themes/classic/templates/catalog/_partials/products.tpl +++ b/themes/classic/templates/catalog/_partials/products.tpl @@ -23,13 +23,7 @@ * International Registered Trademark & Property of PrestaShop SA *}
-
- {foreach from=$listing.products item="product"} - {block name='product_miniature'} - {include file='catalog/_partials/miniatures/product.tpl' product=$product} - {/block} - {/foreach} -
+ {include file="catalog/_partials/productlist.tpl" products=$listing.products cssClass="row"} {block name='pagination'} {include file='_partials/pagination.tpl' pagination=$listing.pagination} diff --git a/themes/classic/templates/catalog/product.tpl b/themes/classic/templates/catalog/product.tpl index 609533c4b8812..a750ae8dfa7cb 100644 --- a/themes/classic/templates/catalog/product.tpl +++ b/themes/classic/templates/catalog/product.tpl @@ -230,10 +230,10 @@ {if $accessories}

{l s='You might also like' d='Shop.Theme.Catalog'}

-
- {foreach from=$accessories item="product_accessory"} +
+ {foreach from=$accessories item="product_accessory" key="position"} {block name='product_miniature'} - {include file='catalog/_partials/miniatures/product.tpl' product=$product_accessory} + {include file='catalog/_partials/miniatures/product.tpl' product=$product_accessory position=$position} {/block} {/foreach}