FROM CACHE - en_header

NEED CODE HELP! TRYING TO REMOVE ORIGINAL REVIEW SECTION

Solved
probikelock
Tourist
3 0 1

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 

Screen Shot 2020-08-19 at 4.43.37 PM.png

Accepted Solution (1)

Accepted Solutions
diego_ezfy
Shopify Partner
2791 526 714

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.

View solution in original post

Replies 7 (7)
diego_ezfy
Shopify Partner
2791 526 714

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.

probikelock
Tourist
3 0 1

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!! 🙂

diego_ezfy
Shopify Partner
2791 526 714
probikelock
Tourist
3 0 1

@diego_ezfy wow, much appreciated!!

Have a great day as well.

whiteandblu
Excursionist
18 0 4

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:

Screenshot 2021-07-12 at 21.02.19.png

https://www.whiteandblujewellery.com/collections/gold-finished-rings/products/mykonos-ring

Thanks

diego_ezfy
Shopify Partner
2791 526 714

@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>

 

diego_ezfy_0-1626125387188.png

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

whiteandblu
Excursionist
18 0 4

Worked! Thanks Diego for your help really appreciate it!