• 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/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mike Jolley (a11n)

    (@mikejolley)

    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

    (@johngrefe)

    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

    (@johngrefe)

    ‘// 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 Author Mike Jolley (a11n)

    (@mikejolley)

    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.