Nico38
1
Hello i added hover effect , it work no problem.
my problem is that when I click on the image it does not redirect to the product page.
you have to click on the product title for it to work !
can you help me to make it work when we click on the image?
thx
Nico38
2
I would like to be able to click on the image and not just the product title
Product card grid liquid :
{% comment %}
Renders a product card using "Grid" style
Accepts:
- max_height: {Number} Maximum height of the product's image (required)
- product: {Object} Product Liquid object (required)
- show_vendor: {Boolean} Show the product's vendor depending on the section setting (optional)
Usage:
{% include 'product-card-grid', max_height: max_height, product: product, show_vendor: section.settings.show_vendor %}
{% endcomment %}
{{ product.title }}
{% capture img_id %}ProductCardImage-{{ section.id }}-{{ product.id }}{% endcapture %}
{% capture wrapper_id %}ProductCardImageWrapper-{{ section.id }}-{{ product.id }}{% endcapture %}
{%- assign preview_image = product.featured_media.preview_image -%}
{%- assign img_url = preview_image | img_url: '1x1' | replace: '_1x1.', '_{width}x.' -%}
{% unless preview_image == blank %}
{% include 'image-style', image: preview_image, height: max_height, wrapper_id: wrapper_id, img_id: img_id %}
{% endunless %}
{% assign days = 14 %}
{% assign period_time = days | times: 24 | times: 60 | times: 60 %}
{% assign date_now = 'now' | date:'%s' %}
{% assign date_finished = product.published_at | date:'%s' | plus: period_time | date:'%s' %}
{% if date_finished > date_now %}
New
{% endif %}
{% if product.compare_at_price_max > product.price %}
Promo -{{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0'}}%
{% endif %}
{% if product.images[1] != blank %}
{% else %}
{% endif %}
{% assign days = 14 %}
{% assign period_time = days | times: 24 | times: 60 | times: 60 %}
{% assign date_now = 'now' | date:'%s' %}
{% assign date_finished = product.published_at | date:'%s' | plus: period_time | date:'%s' %}
{% if date_finished > date_now %}
New
{% endif %}
{% if product.compare_at_price_max > product.price %}
Promo -{{ product.compare_at_price_max | minus: product.price | times: 100.0 | divided_by: product.compare_at_price_max | money_without_currency | times: 100 | remove: '.0'}}%
{% endif %}
{{ product.title | truncate:36 }}
{% include 'product-price', variant: product %}
{% render 'hextom_usb_coll', product: product %}
Scss:
/* ===============================================
// Reveal module
// =============================================== */
.reveal .hidden { display: block !important; visibility: visible !important;}
.product:hover .reveal img { opacity: 1; }
.reveal { position: relative; z-index: 99999999; }
.reveal .hidden {
position: absolute;
z-index: -1;
top: 0;
width: 100%;
height: 100%;
opacity: 0;
-webkit-transition: opacity 0.3s ease-in-out;
-moz-transition: opacity 0.3s ease-in-out;
-o-transition: opacity 0.3s ease-in-out;
transition: opacity 0.3s ease-in-out;
}
.reveal:hover .hidden {
z-index: 100000;
opacity: 1;
}
.reveal .caption {
position: absolute;
top: 0;
display: table;
width: 100%;
height: 100%;
background-color: white; /* fallback for IE8 */
background-color: transparent;
font: 13px/1.6 sans-serif;
text-transform: uppercase;
color: #333;
letter-spacing: 1px;
text-align: center;
text-rendering: optimizeLegibility;
}
.reveal .hidden .caption .centered {
display: table-cell;
vertical-align: middle;
}
@media (min-width: 480px) and (max-width: 979px) {
.reveal .caption {
font-size: 11px;
}
}