Title: Switch from HTTP &gt; HTTPS WC Assets not Linking to HTTPS
Last modified: August 30, 2016

---

# Switch from HTTP > HTTPS WC Assets not Linking to HTTPS

 *  [JohnGrefe](https://wordpress.org/support/users/johngrefe/)
 * (@johngrefe)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/switch-from-http-https-wc-assets-not-linking-to-https/)
 * Hey there,
 * I’ve done my best over the last few hours to try to figure out how this is being
   broken.
 * When switching over to HTTPS for everything, I’m getting Mixed Content errors
   and Front end “Variable product” not loading (no add to cart button on product
   pages).
 * On my single product page, I have 12 errors, all WC JS and CSS files.
 * I have re=installed woocommerce. I’ve also grep’d a backup to find these sitting
   in plain text.
 * Unfortunately I don’t think I understand how WC registered scripts for later 
   use. I have looked at the file that registers these scripts and they use relative
   path’ing, so I can only think this is from the switch. When the WC plugin runs
   the following, where is it stored? How do you purge it? Or am I not understanding
   this process correctly?
    `self::register_script( 'wc-add-to-cart-variation', 
   $frontend_script_path . 'add-to-cart-variation' . $suffix . '.js' );` in `woocommerce/
   includes/class-wc-frontend-scripts.php`
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/switch-from-http-https-wc-assets-not-linking-to-https/#post-6476703)
 * The scripts are not the issue; they are relative anyway, they start with // so
   will match the page they are output on.
 * If the entire site is being served over SSL, ensure you change the URLs to https
   in Settings > General.
 *  Thread Starter [JohnGrefe](https://wordpress.org/support/users/johngrefe/)
 * (@johngrefe)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/switch-from-http-https-wc-assets-not-linking-to-https/#post-6476824)
 * So I ended up re-writing class-wc-frontend-scripts.php to use ‘$src’ and longer
   paths that remained relative to woocommerce, and this fixed the http / https 
   issue. It seems to have something to do with the custom relative url functions
   for how WC classes assets and front end scripts.
 *  Thread Starter [JohnGrefe](https://wordpress.org/support/users/johngrefe/)
 * (@johngrefe)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/switch-from-http-https-wc-assets-not-linking-to-https/#post-6476825)
 * ‘// Register any scripts for later use, or used as dependencies
    self::register_script(‘
   jquery-blockui’, $src . ‘/wp-content/plugins/woocommerce/assets/js/jquery-blockui/
   jquery.blockUI’ . $suffix . ‘.js’, array( ‘jquery’ ), ‘2.70’ ); self::register_script(‘
   jquery-payment’, $src . ‘/wp-content/plugins/woocommerce/assets/js/jquery-payment/
   jquery.payment’ . $suffix . ‘.js’, array( ‘jquery’ ), ‘1.2.4’ ); self::register_script(‘
   jquery-cookie’, $src . ‘/wp-content/plugins/woocommerce/assets/js/jquery-cookie/
   jquery.cookie’ . $suffix . ‘.js’, array( ‘jquery’ ), ‘1.4.1’ ); self::register_script(‘
   wc-credit-card-form’, $frontend_script_path . ‘credit-card-form’ . $suffix . ‘.
   js’, array( ‘jquery’, ‘jquery-payment’ ) ); self::register_script( ‘wc-add-to-
   cart-variation’, $src . ‘/wp-content/plugins/woocommerce/assets/js/frontend/add-
   to-cart-variation’ . $suffix . ‘.js’ ); self::register_script( ‘wc-single-product’,
   $src . ‘/wp-content/plugins/woocommerce/assets/js/frontend/single-product’ . 
   $suffix . ‘.js’ ); self::register_script( ‘wc-country-select’, $src . ‘/wp-content/
   plugins/woocommerce/assets/js/frontend/country-select’ . $suffix . ‘.js’ ); self::
   register_script( ‘wc-address-i18n’, $src . ‘/wp-content/plugins/woocommerce/assets/
   js/frontend/address-i18n’ . $suffix . ‘.js’ ); ‘
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/switch-from-http-https-wc-assets-not-linking-to-https/#post-6476860)
 * As I mentioned, we use `//` which is relative to however the page is viewed. 
   Are you sure no other plugin was changing the paths in the source?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Switch from HTTP > HTTPS WC Assets not Linking to HTTPS’ is closed to
new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [HTTP](https://wordpress.org/support/topic-tag/http/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [SSL](https://wordpress.org/support/topic-tag/ssl/)
 * [switch](https://wordpress.org/support/topic-tag/switch/)

 * 4 replies
 * 2 participants
 * Last reply from: [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/switch-from-http-https-wc-assets-not-linking-to-https/#post-6476860)
 * Status: not resolved