Refactor CSS and JavaScript for product comparison and wishlist functionality
- Updated `dr_materac.scss` to hide the compare/wishlist button by default. - Enhanced JavaScript in `detail1526395446.tpl` to safely add an event listener for the opinions section link, ensuring it only attaches if the element exists. - Cleaned up the `product-add-to-cart.tpl` by uncommenting the compare/wishlist button section for better visibility in the UI.
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5904,4 +5904,8 @@ body:not(#index) {
|
||||
a {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
|
||||
.leo-compare-wishlist-button {
|
||||
display: none !important;
|
||||
}
|
||||
@@ -500,8 +500,15 @@
|
||||
{/if}
|
||||
</div>
|
||||
<script>
|
||||
document.querySelector('a[href="#opinions-sections"]').addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const opinionLink = document.querySelector('a[href="#opinions-sections"]');
|
||||
|
||||
// Nadal warto dodać sprawdzenie 'if', na wypadek gdyby elementu w ogóle nie było
|
||||
if (opinionLink) {
|
||||
opinionLink.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<a href="#opinions-sections" style="display:flex; gap:10px;">
|
||||
|
||||
@@ -66,10 +66,10 @@
|
||||
<i class="material-icons shopping-cart"></i>
|
||||
{l s='Add to cart' d='Shop.Theme.Actions'}
|
||||
</button>
|
||||
<!-- <div class="leo-compare-wishlist-button">
|
||||
<div class="leo-compare-wishlist-button">
|
||||
{hook h='displayLeoWishlistButton' product=$product}
|
||||
{hook h='displayLeoCompareButton' product=$product}
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
Reference in New Issue
Block a user