New Landing How can we help? Themeforest Theme Support Uplift Woocommerce css not loading on HTTPS

Viewing 7 posts - 1 through 7 (of 7 total)
  • Posted in: Uplift
  • #282259
    HB
    Member
    Post count: 76

    Hi Team,

    We’re having issues with styles and ajax not loading on certain pages when they are forced to HTTPS. Our site is forced to HTTPS. We’ve had to implement this temporary code. Any idea how to do a permanent fix?

    Cheers

    A

    /* TEMP – Fix lost Wooocommmerce Styles (stars etc)
    ================================================== */

    function wdm_add_woocommerce_styles(){
    return array(
    ‘woocommerce-layout’ => array(
    ‘src’ => str_replace( array( ‘http:’, ‘https:’ ), ”, WC()->plugin_url() ) . ‘/assets/css/woocommerce-layout.css’,
    ‘deps’ => ”,
    ‘version’ => WC_VERSION,
    ‘media’ => ‘all’
    ),
    ‘woocommerce-smallscreen’ => array(
    ‘src’ => str_replace( array( ‘http:’, ‘https:’ ), ”, WC()->plugin_url() ) . ‘/assets/css/woocommerce-smallscreen.css’,
    ‘deps’ => ‘woocommerce-layout’,
    ‘version’ => WC_VERSION,
    ‘media’ => ‘only screen and (max-width: ‘ . apply_filters( ‘woocommerce_style_smallscreen_breakpoint’, $breakpoint = ‘768px’ ) . ‘)’
    ),
    ‘woocommerce-general’ => array(
    ‘src’ => str_replace( array( ‘http:’, ‘https:’ ), ”, WC()->plugin_url() ) . ‘/assets/css/woocommerce.css’,
    ‘deps’ => ”,
    ‘version’ => WC_VERSION,
    ‘media’ => ‘all’
    ),
    );
    }
    add_filter( ‘woocommerce_enqueue_styles’, ‘wdm_add_woocommerce_styles’,15);

    #282366
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Hi,
    Please install this plugin https://wordpress.org/support/plugin/wordpress-https. It will help you.
    Thanks
    Mohammad

    #282407
    HB
    Member
    Post count: 76

    We already have that installed : )

    It seems that SF is removing woocommerce scripts if it doesn’t find woocommerce css classes on the page.

    Dev feedback

    After analysis, we found that the WooCommerce’s JS( like woocommerce.min.js , add-to-cart.min.js, etc ) are not loading on site pages. The code of dequeuing this scripts in theme (themes/uplift/swift-framework/core/sf-woocommerce.php From function sf_remove_woo_scripts Line – 44) . Here it checks if the body on the page contains CSS class woocommerce and depending on this condition it dequeues the script on unnecessary pages.

    Cheers,

    A

    #282518
    Kyle – SUPPORT
    Moderator
    Post count: 35880

    Will forward this to the developer

    – Kyle

    #282589
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @HB

    That is true – if you don’t want that functionality, you can disable it in Theme Options > General > Performance > Swift Smart Script => Off.

    – Ed

    #284133
    calebweeks
    Member
    Post count: 61

    Hi Swift Team,

    Question 1: Would you all be willing to explain a little more of what this means?

    Question 2: Are you saying that if we use WooCommerce and “Force HTTPS on checkout” (or the My-Account Page, etc.) that we need to turn of the Swift Smart Script?

    Question 3: Is there a way where you guys could update it so that it could work with HTTPS or is that too hard?

    We would love to use the Smart Script but we definitely need HTTPS for checkout/credit card payments, etc.

    Thanks guys!

    #284560
    Swift Ideas – Ed
    Keymaster
    Post count: 15264

    Hi @calebweeks

    The SmartScript functionality should only remove scripts from pages where they aren’t needed. Such as the “add to cart variations script”, from the cart/checkout pages (where they aren’t used).

    If you are having issues / your dev is saying that is the issue, then please try disabling that option and seeing if it resolves it. We can then look to adjust from there if it’s something we need to change our end.

    Hope that explains it.

    – Ed

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register