Product image in product list page should link to product-view page
-
12-12-2019 - |
Question
please visit this link : http://gas1.newtrendzonline.com/index.php/shop-for-products.html
here, only by clicking on products name, we can view "products-view" page.
what I need is ,If we click on "Products-images" , it should link "products-view" page.
this is list.phtml => http://pastebin.com/qkrUmmGR
please help me to find solution.
thanks in advance.
Solution
You can try below code for link to product view page.
I have check your structure. When you hover the Image then one layer will be coming so we need to give url to that link.
<div class="product-inner" onClick="window.open('<?php echo $_product->getProductUrl() ?>');">
<h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($_product->getName(), null, true) ?>"><?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?></a></h2>
<?php if($_product->getRatingSummary()): ?>
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>
<?php endif; ?>
<div class="product-des">
<?php echo $_helper->productAttribute($_product, $_product->getShortDescriptionGrid(), 'short_description_grid') ?>
</div>
<div class="actions">
<ul class="add-to-links">
<?php if($_product->isSaleable()): ?>
<?php else: ?>
<li><p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p></li>
<?php endif; ?>
</ul>
<div class="price-box-item">
</div>
More Focus on line no one <div class="product-inner" onClick="window.open('<?php echo $_product->getProductUrl() ?>');">
.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange