Removing Wholesale Hero from your theme

Need to remove Wholesale Hero from your theme? 

Option 1. Publishing your original theme

The simplest way to achieve this is to publish the previous theme before we installed Wholesale Hero. This will bring your theme back to exactly how it was before Wholesale Hero was activated.

Option 2. Manually removing theme code

Please note the following:

1. Our theme updates are designed to allow your theme to work as expected even after uninstalling the app.

2. If you are moving to another Wholesale app and they have told you to remove this code yourself or they won't do it for you. I would suggest using another app instead 😊


If you would still like to proceed with uninstalling the app please see the following steps below:

A Walkthrough Video:

Code Details:

Helper files to be removed:

(XYZ will be a variable name)

- {% include 'wh_calculate_discount' with XYZ %}
- {% include 'wh_variant' with XYZ %}

Changing prices back to the original version:

Assuming the product variable is named product, change all of the following wh_ price variables back to the original format.

wh_price -> prouduct.price
wh_price_min -> product.price_min
wh_price_max -> product.price_max
wh_compare_at_price -> product.compare_at_price
wh_compare_at_price_min -> product.compare_at_price_min
wh_compare_at_price_max -> product.compare_at_price_max

Eg: {{wh_price | money}} becomes {{product.price | money}}

Assuming the variant variable is named variant, change all of the following wh_v_ price variables back to the original format.

wh_v_price -> variant.price
wh_v_compare_at_price -> variant.compare_at_price
loop_wh_v_price -> variant.price
loop_wh_v_compare_at_price -> variant.compare_at_price

Eg: {{wh_v_compare_at_price | money}} becomes {{variant.compare_at_price | money}}

Changing the Product JSON Snippet

{%- include 'wh_product_json' with product -%} -> {{ product | json }}

Eg: {%- include 'wh_product_json' with product -%} becomes {{ product | json }}<br>

Theme file update:

Within the <head> of the file, remove the following code

<script>
    {% comment %}Wholesale Hero JS{% endcomment %}
    window.wh_metafields = {};
    window.wh_discount_value = 1;
    window.settings = {{settings | json}};
    <<THERE CODE BE MORE CODE IN HERE>>
    {% if customer.tags.size > 0 %}
      window.wh_customer_tags = true;
      {% assign wh_logged_in = true %}      
    {% else %}
      {% assign wh_logged_out = true %}      
    {% endif %}
  </script>
  <style type="text/css">
    {% comment %}Wholesale Hero CSS{% endcomment %}
    .wh-hidden{display: none;}.wh-cart-total {font-weight: bold;display: inline-block;  margin-top: 5px;font-size: 22px;color: #000000;background-color: #FFFF4D;} .additional-notes{text-align:right;background-color: #FFFF4D;color: #000000;font-size: 14px;} .booster-messages{display:block;}
    #booster-discount-item{font-size:70%;padding-top: 5px;padding-bottom: 5px;} #booster-summary-item{font-size:70%;padding-top: 5px;padding-bottom: 5px;} input#booster-discount-code{max-width:200px;display:inline-block;} button#apply-booster-discount{display:inline-block;max-width:200px;}
    {% if customer.tags.size > 0 %}
      div.shopify-payment-button{display:none;}
    {% endif %}
  </style><br>
Below the </body> of the file, remove the following code
<!-- Wholesale Hero Start -->
      {% if customer.tags.size > 0 and template != 'cart' %}
        <script>
          $(function(){
            $(document).on('click', "a[href$='#cart'], input[name='checkout'], button[name='checkout'], input[name='goto_pp'], button[name='goto_pp'], input[name='goto_gc'], button[name='goto_gc'], [href$='checkout']", function(e){
              e.preventDefault();
              window.location = "/cart";
            });
          });
        </script>
      {% endif %}


      {% if customer.tags.size > 0 and template == 'cart' %}
        {% include 'wh_cart' %}
      {% endif %}
      <!-- Wholesale Hero End -->
      
 <script type='text/javascript'>
        <!-- WHTestJS Start-->
        (function() {
        if(window.location.search.includes('ws_test') || localStorage.getItem('ws_test')=='true'){
          console.log('whtestingjs');
          var head = document.getElementsByTagName('head')[0];
          var script = document.createElement('script');
          window.test_discount_group = true;
          script.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + "wh.ngrok.io/discount_group_test.js";
          script.type = 'text/javascript';
          head.appendChild(script);
        }
        })();
        <!-- WHTestJS End-->
      </script>

Still need help? Contact Us Contact Us