How do I remove Variant Option Product Options Code Manually?

June 2023: We updated our app to use app embeds which automatically remove the app code when you delete the app. If you installed our app after June you don’t need to do anything.

If you installed our app before June 2023 our app leaves behind code on your theme.liquid page. It doesn’t affect your site in any way but it is best practice to remove any code you aren’t using.

Manually Remove Code

To top

If you installed our quick load code or had us install this code for you (installs before 12/21) then you will need to remove this manually. Scroll down the page for information on how to do this.

You can remove our app’s code manually from your theme.liquid file

  1. First, navigate to your Shopify admin.
  2. Click Online Store.
  3. Next, go to the Actions dropdown and select Edit Code.
  4. Open the theme.liquid file.

On the theme.liquid page search for any code containing the text “bcpo”

Any line of code with the text bcpo is from our app and can be deleted. 

Here are a few examples of what our code looks like.

Below is the first two lines of code that our app needs to run. They will appear after your <head> tag near the top of the theme.liquid file

<link rel="stylesheet" href="https://obscure-escarpment-2240.herokuapp.com/stylesheets/bcpo-front.css">
<script>var bcpo_product={{ product | json }}; {% if product.metafields.bcpo.bcpo_data %}var bcpo_data={{ product.metafields.bcpo.bcpo_data }};{% endif %} {% if shop.metafields.bcpo.bcpo_settings %}var bcpo_settings={{ shop.metafields.bcpo.bcpo_settings }};{% endif %}var inventory_quantity = [];{% for v in product.variants %}inventory_quantity.push({{v.inventory_quantity}});{% endfor %}if(bcpo_product) { for (var i = 0; i < bcpo_product.variants.length; i += 1) { bcpo_product.variants[i].inventory_quantity = inventory_quantity[i]; }}window.bcpo = window.bcpo || {}; bcpo.cart = {{cart | json}}; bcpo.ogFormData = FormData;</script>

Below is the quickload code that must be removed. If you installed our app after 12/21 you don’t have to worry about this. After that date, we no longer added this code to themes.

<script src="https://obscure-escarpment-2240.herokuapp.com/js/best_custom_product_options.js?shop={{shop.permanent_domain}}"></script>

On installs after 12/21 we added code after the {{ content_for_header }} code which you can see below.

<script id="vopo-head">(function () { if (((document.documentElement.innerHTML.includes('asyncLoad') && !document.documentElement.innerHTML.includes('\/obscure' + '-escarpment-2240')) || (window.bcpo && bcpo.disabled)) && !window.location.href.match(/[&?]yesbcpo/)) return; var script = document.createElement('script'); script.src = "https://obscure-escarpment-2240.herokuapp.com/js/best_custom_product_options.js?shop={{shop.permanent_domain}}"; var vopoHead = document.getElementById('vopo-head'); vopoHead.parentNode.insertBefore(script, vopoHead); })();</script>
The only code that causes issues is the quick load code which was added to stores before 12/21. The other code won’t cause any issues in your theme but it is best practice to remove any code that you aren’t using.

If you need any help removing our code, please contact us.

Was this article helpful?
Dislike