forked from brooksbingham/theme-elegance
refactor: simplify the product card
parent
46491a333c
commit
83a427381d
|
@ -23,6 +23,43 @@
|
||||||
* International Registered Trademark & Property of PrestaShop SA
|
* International Registered Trademark & Property of PrestaShop SA
|
||||||
*}
|
*}
|
||||||
{block name='product_miniature_item'}
|
{block name='product_miniature_item'}
|
||||||
|
<a href="{$product.url}" class="group w-full flex flex-col">
|
||||||
|
{block name='product_thumbnail'}
|
||||||
|
{if $product.cover}
|
||||||
|
<div class="thumbnail product-thumbnail w-full aspect-[342/513] bg-gray-100">
|
||||||
|
<img
|
||||||
|
src="{$product.cover.bySize.home_default.url}"
|
||||||
|
alt="{if !empty($product.cover.legend)}{$product.cover.legend}{else}{$product.name|truncate:30:'...'}{/if}"
|
||||||
|
data-full-size-image-url="{$product.cover.large.url}"
|
||||||
|
class="object-cover w-full h-full"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
{else}
|
||||||
|
<div class="thumbnail product-thumbnail w-full aspect-[342/513]">
|
||||||
|
<img class="object-fit w-full h-full" src="{$urls.no_picture_image.bySize.home_default.url}" />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
{/block}
|
||||||
|
<div class="product-description flex flex-col pt-4 group-hover:text-gray-950 gap-1">
|
||||||
|
{block name='product_price_and_shipping'}
|
||||||
|
<div class="flex w-full justify-between items-center">
|
||||||
|
{if $product.has_discount}
|
||||||
|
<span class="regular-price line-through text-red-700/50 leading-none">{$product.regular_price}</span>
|
||||||
|
{/if}
|
||||||
|
<div class="font-semibold text-lg">
|
||||||
|
<span>{$product.price}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{/block}
|
||||||
|
{block name='product_name'}
|
||||||
|
<span class="text-xl" itemprop="name">{$product.name|truncate:30:'...'}</span>
|
||||||
|
{/block}
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
{/block}
|
||||||
|
|
||||||
|
{**
|
||||||
|
|
||||||
<article class="product-miniature js-product-miniature flex flex-col shrink-0" data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}" itemscope itemtype="http://schema.org/Product">
|
<article class="product-miniature js-product-miniature flex flex-col shrink-0" data-id-product="{$product.id_product}" data-id-product-attribute="{$product.id_product_attribute}" itemscope itemtype="http://schema.org/Product">
|
||||||
<div class="thumbnail-container flex flex-col gap-4">
|
<div class="thumbnail-container flex flex-col gap-4">
|
||||||
{block name='product_thumbnail'}
|
{block name='product_thumbnail'}
|
||||||
|
@ -89,4 +126,4 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</article>
|
</article>
|
||||||
{/block}
|
*}
|
||||||
|
|
Loading…
Reference in New Issue