[Resolved] 0 cart number doesnt get displayed

Home Forums Support [Resolved] 0 cart number doesnt get displayed

Home Forums Support 0 cart number doesnt get displayed

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #1797068
    johnaps

    Hello GP Team!

    I got a problem with my cart amount number!
    When it is 0, it is briefly diplayed and then it disappears…
    See it here https://drive.google.com/file/d/17R5Gyrt8zYL8WZ6dFwt75eIMNs9cA1pF/view

    i have tested with disabled wp-rocket and asset cleanup and i still got the same problem!

    #1797567
    Leo
    Staff
    Customer Support

    Hi there,

    Have you tried some debugging tests like disabling all plugins except GP Premium and WooCommerce to test?

    This is unlikely a theme issue.

    #1800041
    johnaps

    I disabled all plugins except woocommerce and gp-premium and i still got the same problem!

    Note: this issue applies for all pages except homepage (there i have implemented a custom cart, so dont look there)

    example: https://staging-sofianosorthopedikagr.kinsta.cloud/product-category/%ce%bf%ce%be%cf%85%ce%b3%ce%bf%ce%bd%ce%bf%ce%b8%ce%b5%cf%81%ce%b1%cf%80%ce%b5%ce%af%ce%b1/%ce%bf%ce%be%cf%8d%ce%bc%ce%b5%cf%84%cf%81%ce%b1/

    #1800637
    Leo
    Staff
    Customer Support

    Can you try activating the parent theme?

    #1801103
    johnaps

    Now we can be 200% sure that something happens with gp!

    I activated gp parent theme and i still get the following output…
    <span class="number-of-items no-items"></span>
    is still like that, meaning with no number when 0 items in the cart.

    I believe there must be a filter that appends the 0 to the cart gp is implementing!

    #1802039
    Leo
    Staff
    Customer Support

    I’m a little confused. You can view the cart icon output of these two default installs:
    https://gpsites.co/shop/
    http://gpsites.co/seller/

    Are you seeing something different?

    #1802495
    johnaps

    If you add a product to the cart on my site you ll see the following:

    <span class="number-of-items no-items">1</span>

    But for 0 items it doesnt display:
    <span class="number-of-items no-items">0</span>
    It leaves it like this
    <span class="number-of-items no-items"></span>

    Thats what happens in your examples also, its the default functionality!!!

    Problem isnt if i can get a 0 to show up, cause i can with simple css…
    Problem is i cant figure out is why it outputs a 0 for a brief second and then takes it away… as i told you in my first message

    If i implement a 0 with css now, then in the loading of each page there will be 2 zeros showing up which is ugly!

    FYI i havent any kind of css for showing a 0 right now thats why the 0 appearing for a brief second is weird!!

    Please this matter is urgent and we are talking for 4 days now without any kind of progress or understanding…
    Tell me what else information you want me to give you today, cause if we respond like this 1 message/day we wont get to the bottom of this….
    You can see it on my live site as well (currently no optimization plugins are on)

    #1802850
    Leo
    Staff
    Customer Support

    Let’s take a step back so we can properly identify the issue.

    – By default, the menu item cart doesn’t show 0 when there is no item in the cart and there isn’t a built in option to turn that on.

    Take a look at the demo here:
    https://www.screencast.com/t/2wI8UCBt

    So what customization are you using to display the 0?

    There is no 0 added when there is no item:
    https://www.screencast.com/t/kQSFLXoo3P

    When an item is added, the no-item class is removed and the amount is added:
    https://www.screencast.com/t/q6Hzsigw9

    – The cart icon isn’t something built-in in GP:
    https://www.screencast.com/t/tVwukyJlm0

    How are you add the custom icon?

    The HTML markup of your custom cart:
    https://www.screencast.com/t/ewpm7zLSqjPA

    Is also different than the HTML markup of the default cart:
    https://www.screencast.com/t/abYn4i2KPECB

    Let me know if I’m missing anything here.

    #1802857
    Leo
    Staff
    Customer Support

    Just following up, when using the default icon without any customization, this CSS works for me:

    .cart-contents>span.number-of-items.no-items {
    	display: inline-block
    }
    .cart-contents>span.number-of-items.no-items::after {
    	content: "0";
    }

    See demo here:
    https://www.screencast.com/t/tjQHIuub0

    #1803271
    johnaps

    Hello Leo!

    Thank you for your effort but you overlooked the part that i said about my homepage that has a custom cart!

    Note: this issue applies for all pages except homepage (there i have implemented a custom cart, so dont look there)

    All this that we are talking about isnt about homepage! Homepage is working fine.
    The problem is about every other page which has the gp’s built-in cart!
    The cart icon is implemented with simple css and i have DONE NO CUSTOMIZATION WHATSOEVER IN THOSE PAGES to display the 0
    Now i ll tell you the problem once more for clear understanding (How the heck does the 0 get displayed for a brief second when loading the page, if i have all my cache disabled, all my optimization plugins disabled and i havent used any css to display the 0 in the class .no-items???)

    Look my first post for the video again!
    If you want to check live site ( check staging or live BUT NOT MY HOMEPAGE, because it has a custom cart)
    Every other page you can check though!

    Maybe this problem is a bit advanced!! If it is, in the sake of the time urgency, it would be very appreciated if you could forward this topic to Tom!

    Thank you again Leo for all your help!

    #1803665
    Ying
    Staff
    Customer Support

    Hi there,

    I just tested Leo’s css, it works on your single product page.
    https://www.screencast.com/t/ug08J7uDF6V1

    Let me know if there’s any specific page that doesn’t work.

    #1803732
    johnaps

    Guys really???
    All the info i have given you and you think that i am after how to implement a 0 on my cart???

    I am really disappointed, you dont even read my responses….

    You can test either on live or staging….
    My query isnt about how to implement a zero…

    Please forward this to Tom! He will understand what i am asking… and maybe even be able to help!

    Thank you

    #1803742
    Leo
    Staff
    Customer Support

    I understand what you are asking.

    However, I haven’t been able to replicate the issue on any of our default sites and there has been no other reports on this.

    Let’s take it from the start.

    Since you have a staging site, can you disable all plugins there except GP Premium and WooCommerce, activate the parent theme so we can see if the 0 still shows up for a second?

    Make sure to deactivate any code added in the elements module as well.

    GP doesn’t output a 0 in the HTML at all so I highly doubt that 0 is coming from GP.

    I’m going to take a wild guess that the issue is coming from the custom cart implemented on the home page as I see a 0 output in the HTML there.

    Also, if you can start another staging site with a fresh install and import a simple site like Seller and see if notice the same issue there, that would really help as well.

    We will get to the bottom of this 🙂

    #1804845
    johnaps

    I made a clone of my site. https://testsofianoslive.kinsta.cloud/
    And completely removed the custom cart functions from inside the functions.php!
    You ll confirm that by visiting its homepage and you ll see that the cart no longer works it is just a shortcode…
    Also on my tests i completely disabled optimization plugins (wprocket & assetcleanup)

    As i expected the problem didnt come from my custom cart function, because as you ‘ll see if you navigate the site around, the 0 still appears briefly when you load a page…

    After that i tried disabling elements from gp and that completely broke my layout so i am not very sure, but truth is the 0 wasnt seen if i disable elements…
    But i dont have anything there that should mess with that fuctionality…

    Any thoughts?

    Regards,
    John

    #1804864
    johnaps

    I further tested by disabling one by one each element that had global application!

    After testing everything the only one that by disabling broke my layout but made this go away was my global-custom-css file hook with the following code inside the hook

    <link rel="stylesheet" href="https://testsofianoslive.kinsta.cloud/wp-content/themes/generatepress_child/my-custom-css.css">
    

    Here is the css file
    https://testsofianoslive.kinsta.cloud/wp-content/themes/generatepress_child/my-custom-css.css

    I checked it all and there is no css rules inside my css file explaining this!
    Also another reason it doesnt explain it, is that i think the 0 that is displayed briefly isnt by any css, it is inside the html!!!

    Back to square 1!

    I am awaiting your thoughts!

Viewing 15 posts - 1 through 15 (of 17 total)
  • You must be logged in to reply to this topic.