- This topic has 16 replies, 3 voices, and was last updated 4 years, 1 month ago by
Leo.
-
AuthorPosts
-
May 25, 2021 at 2:56 am #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/viewi have tested with disabled wp-rocket and asset cleanup and i still got the same problem!
May 25, 2021 at 7:40 am #1797567Leo
StaffCustomer SupportHi there,
Have you tried some debugging tests like disabling all plugins except GP Premium and WooCommerce to test?
This is unlikely a theme issue.
May 27, 2021 at 4:41 am #1800041johnaps
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)
May 27, 2021 at 10:58 am #1800637Leo
StaffCustomer SupportCan you try activating the parent theme?
May 28, 2021 at 12:57 am #1801103johnaps
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!
May 28, 2021 at 1:31 pm #1802039Leo
StaffCustomer SupportI’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?
May 29, 2021 at 5:58 am #1802495johnaps
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 messageIf 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)May 29, 2021 at 9:34 am #1802850Leo
StaffCustomer SupportLet’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/2wI8UCBtSo what customization are you using to display the 0?
There is no 0 added when there is no item:
https://www.screencast.com/t/kQSFLXoo3PWhen 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/tVwukyJlm0How are you add the custom icon?
The HTML markup of your custom cart:
https://www.screencast.com/t/ewpm7zLSqjPAIs also different than the HTML markup of the default cart:
https://www.screencast.com/t/abYn4i2KPECBLet me know if I’m missing anything here.
May 29, 2021 at 9:45 am #1802857Leo
StaffCustomer SupportJust 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/tjQHIuub0May 30, 2021 at 3:44 am #1803271johnaps
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!
May 30, 2021 at 9:57 am #1803665Ying
StaffCustomer SupportHi there,
I just tested Leo’s css, it works on your single product page.
https://www.screencast.com/t/ug08J7uDF6V1Let me know if there’s any specific page that doesn’t work.
May 30, 2021 at 11:15 am #1803732johnaps
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
May 30, 2021 at 11:22 am #1803742Leo
StaffCustomer SupportI 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 🙂
May 31, 2021 at 8:56 am #1804845johnaps
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,
JohnMay 31, 2021 at 9:14 am #1804864johnaps
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.cssI 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!
-
AuthorPosts
- You must be logged in to reply to this topic.