Post by eddy-r3 » Mon Aug 20, 2018 9:29 pm

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!

Active Member

Posts

Joined
Tue Jan 31, 2012 4:46 am

Post by straightlight » Tue Aug 21, 2018 6:07 am

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

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by eddy-r3 » Tue Aug 21, 2018 6:12 am

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....

Active Member

Posts

Joined
Tue Jan 31, 2012 4:46 am

Post by straightlight » Tue Aug 21, 2018 6:16 am

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?

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by eddy-r3 » Tue Aug 21, 2018 6:31 am

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!

Active Member

Posts

Joined
Tue Jan 31, 2012 4:46 am

Post by straightlight » Tue Aug 21, 2018 7:48 am

im unsure of where to even look! LOL
The last question is still unanswered regarding the storage folder location.

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by eddy-r3 » Tue Aug 21, 2018 7:50 am

this is in /public_html/storage

Active Member

Posts

Joined
Tue Jan 31, 2012 4:46 am

Post by straightlight » Tue Aug 21, 2018 9:44 am

Ensure to follow these steps: viewtopic.php?f=176&p=718325#p717782

The most generated errors being found on Opencart forum originates from contributed programming. The increased counters are caused by posted redundancies of the same solutions that were already provided prior.

F. Rules:

- viewtopic.php?f=176&t=200480
- viewtopic.php?f=176&t=200804


Regards,
Straightlight


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: No registered users and 21 guests