forked from PrestaShop/hummingbird
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproduct.tpl
More file actions
114 lines (99 loc) · 4.95 KB
/
product.tpl
File metadata and controls
114 lines (99 loc) · 4.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
{**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*}
{$componentName = 'product-miniature'}
{block name='product_miniature_item'}
<article
class="{$componentName} js-{$componentName}"
data-id-product="{$product.id_product}"
data-id-product-attribute="{$product.id_product_attribute}"
>
<div class="{$componentName}__inner">
{block name='product_miniature_top'}
<div class="{$componentName}__top">
{include file='catalog/_partials/product-flags.tpl'}
{include file='catalog/_partials/miniatures/product-image.tpl'}
{include file='catalog/_partials/miniatures/product-quickview.tpl'}
</div>
{/block}
{block name='product_miniature_bottom'}
<div class="{$componentName}__bottom">
<div class="{$componentName}__infos">
{block name='product_name'}
<a class="{$componentName}__title" href="{$product.url}" aria-label="{l s='View product %product_name%' sprintf=['%product_name%' => $product.name] d='Shop.Theme.Catalog'}">{$product.name}</a>
{/block}
{block name='product_variants'}
{if $product.main_variants}
<div class="{$componentName}__variants">
{include file='catalog/_partials/variant-links.tpl' variants=$product.main_variants}
</div>
{/if}
{/block}
{if $product.show_price}
<div class="{$componentName}__prices">
{block name='product_price'}
{hook h='displayProductPriceBlock' product=$product type="before_price"}
<div class="{$componentName}__price" aria-label="{l s='Price' d='Shop.Theme.Catalog'}">
{capture name='custom_price'}{hook h='displayProductPriceBlock' product=$product type='custom_price' hook_origin='products_list'}{/capture}
{if '' !== $smarty.capture.custom_price}
{$smarty.capture.custom_price nofilter}
{else}
{$product.price}
{/if}
</div>
{hook h='displayProductPriceBlock' product=$product type='unit_price'}
{hook h='displayProductPriceBlock' product=$product type='weight'}
{/block}
{block name='product_discount_price'}
{if $product.show_price}
<div class="{$componentName}__discount-price">
{if $product.has_discount}
{hook h='displayProductPriceBlock' product=$product type="old_price"}
<span class="{$componentName}__regular-price" aria-label="{l s='Regular price' d='Shop.Theme.Catalog'}">{$product.regular_price}</span>
{/if}
</div>
{/if}
{/block}
</div>
{/if}
{block name='product_reviews'}
{hook h='displayProductListReviews' product=$product}
{/block}
</div>
<div class="{$componentName}__actions">
{if $product.add_to_cart_url}
<form class="{$componentName}__form" action="{$urls.pages.cart}" method="post">
<input type="hidden" value="{$product.id_product}" name="id_product">
<input type="hidden" name="token" value="{$static_token}">
<div class="quantity-button js-quantity-button">
{include file='components/qty-input.tpl'
attributes=[
"id" => "quantity_wanted_{$product.id_product}",
"value" => "{$product.minimal_quantity}",
"min" => "{$product.minimal_quantity}"
]
}
</div>
<button
data-button-action="add-to-cart"
class="product-miniature__add btn btn-primary btn-square-icon"
aria-label="{l s='Add to cart %product_name%' sprintf=['%product_name%' => $product.name] d='Shop.Theme.Actions'}"
title="{l s='Add to cart %product_name%' sprintf=['%product_name%' => $product.name] d='Shop.Theme.Actions'}"
data-ps-ref="add-to-cart"
>
<i class="material-icons" aria-hidden="true"></i>
<span class="product-miniature__add-text">{l s='Add to cart' d='Shop.Theme.Actions'}</span>
</button>
</form>
{else}
<a href="{$product.url}" class="product-miniature__details btn btn-outline-primary" aria-label="{l s='View product %product_name%' sprintf=['%product_name%' => $product.name] d='Shop.Theme.Catalog'}">
{l s='See details' d='Shop.Theme.Actions'}
</a>
{/if}
</div>
</div>
{/block}
</div>
</article>
{/block}