Created
December 17, 2020 14:34
-
-
Save IliasHad/43a3ab86eb6755bae03a89c3042d7397 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div > | |
<button onclick="openTabs('Description')">Description</button> | |
<button onclick="openTabs('Reviews')">Reviews</button> | |
<button onclick="openTabs('Shipping')">Shipping Policy</button> | |
</div> | |
<div style="margin:10px 0;" id="Description" class="tab"> | |
<h2>Description</h2> | |
{{ product.description }} | |
</div> | |
<div style="margin:10px 0;display:none" id="Reviews" class="tab" > | |
<h2>Reviews</h2> | |
<div id="shopify-product-reviews" data-id="{{product.id}}">{{ product.metafields.spr.reviews }}</div> | |
</div> | |
<div style="margin:10px 0;display:none;" id="Shipping" class="tab" > | |
<h2>Shipping Policy</h2> | |
{{pages['shipping-policy'].content}} | |
</div> | |
<script> | |
function openTabs(tabName) { | |
var i; | |
var x = document.getElementsByClassName("tab"); | |
for (i = 0; i < x.length; i++) { | |
x[i].style.display = "none"; | |
} | |
document.getElementById(tabName).style.display = "block"; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment