• Resolved sheldony

    (@sheldony)


    Hi. I’m not sure why this is happening. When I add an item to my cart, the cart sometimes appears to be 0 but only on certain pages, namely PRODUCTS, HOME, but all the other top nav sections do show the correct number of items in the cart.

    I am testing on safari on a mac os 13. All WP items and plugins are all up to date.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @sheldony,

    Are you using a cache plugin? If so, could you please tell me which one?

    Thread Starter sheldony

    (@sheldony)

    Hi. I am not using any cache plugin

    Thread Starter sheldony

    (@sheldony)

    hi @yordansoares do you have any thoughts on how to fix this?

    Thread Starter sheldony

    (@sheldony)

    I found the answer from another post in the forum using

    function enqueue_wc_cart_fragments() { wp_enqueue_script( ‘wc-cart-fragments’ ); }
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_wc_cart_fragments’ );

    and code snippet. Thanks anyway.

    hasankhan01

    (@hasankhan01)

    This issues still exsist please guide where to put this code? @sheldony

    Thank you

    Plugin Contributor Yordan Soares

    (@yordansoares)

    Hi @hasankhan01:

    If you have a child theme, you can add code snippets in its functions.php file, but don’t add code snippets to the functions.php file from your parent theme, because you may lose your customizations after updating your parent theme!

    Another way to add code snippets, that is safer in my humble opinion, is to use the Code Snippets plugin (or a similar alternative): This plugin stores the code snippets in your database, so you don’t have to worry about losing your customizations after updating your plugins or theme ??

    hasankhan01

    (@hasankhan01)

    i added and test this code in child theme as wel as code snippets but no success. this is the code ” function enqueue_wc_cart_fragments() { wp_enqueue_script( ‘wc-cart-fragments’ ); }
    add_action( ‘wp_enqueue_scripts’, ‘enqueue_wc_cart_fragments’ );” . i m using Phlox Pro ChildVersion: 1.0. could you guide where i am doing mistake?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cart sometimes displays empty despite item added to cart’ is closed to new replies.