Liquid, JavaScript, themes, sales channels
I am using a VITALS app to add reviews from my supplier's site to my Shopify website, BUT I am having trouble removing the original "Reviews: 0", "Write a Review", and "Be the first to review this item" sections at the bottom of my product page (see image). Do you know how I could remove this in the code? Help would be so appreciated!!
Site: probikelock.com
Solved! Go to the solution
This is an accepted solution.
@probikelock
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset > theme.scss.liquid and paste this at the bottom of the file:
div#stamped-main-widget {
display: none !important;
}
Let me know whether it works.
This is an accepted solution.
@probikelock
1. In your Shopify Admin go to online store > themes > actions > edit code
2. Find Asset > theme.scss.liquid and paste this at the bottom of the file:
div#stamped-main-widget {
display: none !important;
}
Let me know whether it works.
You're awesome, dantepw!! Thank you so much for a quick response - and one that helped!! That whole section from my image went away when I added the coding you suggested.
I had tried a few other codes earlier that I saw on other posts but they didn't work for my situation. Thank you thank you!! 🙂
@probikelock
You're welcome! I'm glad I could be of help. Whenever you need feel free to e-mail me personally.
Wishing you a great day.
Hey Diego,
I am facing a similar issue: I use Judgme for the Reviews and they show successfully, however even if I have for example 16 review in a product, at the top it says "(0) REVIEWS" - check out this example:
https://www.whiteandblujewellery.com/collections/gold-finished-rings/products/mykonos-ring
Thanks
@whiteandblu,
1. In your Shopify Admin go to online store > themes > actions > edit code
2. In your theme.liquid file, find the </body> (press CTRL + F or command + F on Mac)
3. paste this code right above the </body> tag:
<script>
async function showTotalReviews(){
function _waitForElement(selector, delay = 50, tries = 250) {
const element = document.querySelector(selector);
if (!window[`__${selector}`]) {
window[`__${selector}`] = 0;
}
function _search() {
return new Promise((resolve) => {
window[`__${selector}`]++;
setTimeout(resolve, delay);
});
}
if (element === null) {
if (window[`__${selector}`] >= tries) {
window[`__${selector}`] = 0;
return Promise.reject(null);
}
return _search().then(() => _waitForElement(selector));
} else {
return Promise.resolve(element);
}
}
const $total = await _waitForElement(`[data-number-of-reviews]`);
if (!$total){
return;
}
const $tab = document.querySelector(`.Product__Tabs .Collapsible__Button:nth-child(1) .text--light`);
if (!$tab){
return
}
const totalReviews = $total.getAttribute(`data-number-of-reviews`).trim();
$tab.innerHTML = `(${totalReviews})`
}
showTotalReviews();
</script>
As long as the reviews are always on the very first tab, this will work. Thorough customizations to automatically find the correct review tab will require more complex coding.
Kind regards,
Diego
Worked! Thanks Diego for your help really appreciate it!
User | RANK |
---|---|
31 | |
31 | |
27 | |
17 | |
16 |
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By