Please submit a private ticket if you need to share sensitive information, such as license details and admin credentials.

Okay
  Public Ticket #2343062
Styling sometimes not loading for woofc-menu-item
Closed

Comments

  • Coen de Waal started the conversation

    Hi!

    I'm using a menu link which has the class woofc-menu-item. The button functionality always works, but sometimes the styling is not loaded during page load.

    Not sure if this could be relevant but: I'm using asset cleanup pro but have left all your settings as you have initially set them. Some other plugins, css, js are being deferred / asynched.

    Do you know a way to fix this?

    If there is any info you need from me please ask.


    All the best,

    Coen

  •  767
    Janilyn replied

    Hi Coen, 

    Thank you for contacting WPClever Support Forum. We’ve received your ticket and assigned one of our developers to help you with that. 

    He’ll be looking into your question and responding with specific instructions as soon as possible. Please stay in touch as he might need discuss further with you. 

    Best regards.

    Janilyn T. - WPClever Support Agent

  •  1,223
    Dustin replied

    Hi Coen,

    If you use the custom menu item with class "woofc-menu-item", this item only will be shown correctly after page loaded because it uses "WooCommerce Cart Fragments".

    Please use below PHP code instead:

    if ( class_exists( 'WPCleverWoofc' ) ) {
        WPCleverWoofc::woofc_get_cart_link( true );
    }

    Best regards,
    Dustin

  • Coen de Waal replied

    Hi Frankie,


    Thanks! It seems to work, but haven't tested it extensively.

    I've added it as a function in functions.php, I guess that's how it works in wordpress? Please correct me if I'm wrong.


    All the best

  •  1,223
    Dustin replied

    Please add this code directly to where you want to show the cart link.

    Example on Storefront theme, I added it here https://prnt.sc/rsb1c8 and the result https://prnt.sc/rsb1w9

    Best regards,
    Dustin