Page 1 of 1

Template support - Cart icon

Posted: Mon Aug 20, 2018 9:29 pm
by eddy-r3
Hi guys, ive styled my cart icon, updated the common.js to reflect the changes as well for adding/removing/editing cart, which all works fine.

For some reason though, if i add an item to the cart, the icon reverts back to old code, rather than using the new one...

See below :

cart.twig :

Code: Select all

<button type="button" data-toggle="dropdown" data-loading-text="{{ text_loading }}" class="cartBtn dropdown-toggle">
    <i class="fa fa-shopping-cart cartIcon"></i>
    <div class="badge"><span id="cart-total">{{ text_items }}</span></div>
  </button>
What is displayed when adding product :

Code: Select all

<button type="button" data-toggle="dropdown" data-loading-text="Loading..." class="cartBtn dropdown-toggle" aria-expanded="false">
<span id="cart-total"><i class="fa fa-shopping-cart"></i> 3</span></button>
So for some reason, my "badge" class isnt being added to the code when adding an item to the cart. I've checked everywhere, updated everything i can think of, and its still not working. Removing an item from the cart, the icon stays the same, as it should, its just on adding an item...

Any ideas where to look?

Many thanks!

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 6:07 am
by straightlight
For some reason though, if i add an item to the cart, the icon reverts back to old code, rather than using the new one...
FAQ: viewtopic.php?f=176&p=731764#p718325

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 6:12 am
by eddy-r3
Appreciate the reply, but i assure you thats been done 100's of times today....

Fact is, the code i have put into cart.twig is there, you can see it in the source code, when you add an item, it changes...if you then refresh the page, it reverts back to the new code....

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 6:16 am
by straightlight
It the code reverts back, it's either a cache issue from the server or from the client-server end. Either way, it's a cache issue. Where is your storage folder located?

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 6:31 am
by eddy-r3
Its not so much it reverts back, its as though the code is being changed dynamically via jquery...

Nothing in cart - my code is there
Add to cart - my code is removed
Remove something from cart - my code returns

I've updated all the cart information/code in common.js that references the cart code, also, updated both my altered theme template files and also the default files as well. Checked the modification folder, cleared all cache, refreshed/rebuilt cache in the admin/dashboard area, so now, im unsure of where to even look! LOL

Thanks again for the replies!

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 7:48 am
by straightlight
im unsure of where to even look! LOL
The last question is still unanswered regarding the storage folder location.

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 7:50 am
by eddy-r3
this is in /public_html/storage

Re: Template support - Cart icon

Posted: Tue Aug 21, 2018 9:44 am
by straightlight
Ensure to follow these steps: viewtopic.php?f=176&p=718325#p717782