Cart icon and label disappear after page is loaded
-
Hello,
I’m using Astra 4.0.2 theme with Elementor and WooCommerce (among other plugins).
I recently changed from the legacy menu to the newer menu so that I could display both a search icon and a cart icon. I tested this change in my Staging site, and configured the cart icon to look how I wanted.
About a week later I am configuring the same changes on my production site. The production site has all the same plugins and same versions. When I configure the cart under “Customize” it looks good in the preview window. But when I click Update to publish the changes, it doesn’t work well on the live site. The homepage takes about 2 seconds to load, and at first everything looks great until the page finishes loading and the icon (and label) disappear, leaving only the count number and what looks like the handle of the shopping bag icon (even though I picked the cart icon).
In the browser console, I can see that as the page finishes loading, some script runs and changes the DOM somehow (it’s too fast to see the exact change made, and I’m not able to tell which script it is). The resulting HTML markup is not at all like the markup shown in the preview view nor in my staging site.
I’m just wondering if anyone else has seen this and if there is a way to fix it so that I can display the cart on my production site in the top menu?
Rendered HTML on Staging and in Preview mode (correct version):
<div class="ast-builder-layout-element site-header-focus-item ast-header-woo-cart" data-section="section-header-woo-cart"> <div id="ast-site-header-cart" class="ast-site-header-cart ast-menu-cart-with-border ast-menu-cart-outline"> <div class="ast-site-header-cart-li "> <a href="#" class="cart-container ast-cart-desktop-position- ast-cart-mobile-position- ast-cart-tablet-position- "> <div class="ast-addon-cart-wrap ast-desktop-cart-position- ast-cart-mobile-position- ast-cart-tablet-position- "> <i class="astra-icon ast-icon-shopping-cart " data-cart-total="1"></i> </div> </a> </div>
Rendered HTML on production (incorrect version)
<div class="ast-builder-layout-element site-header-focus-item ast-header-woo-cart" data-section="section-header-woo-cart"> <div id="ast-site-header-cart" class="ast-site-header-cart ast-menu-cart-with-border ast-menu-cart-outline"> <div class="ast-site-header-cart-li "> <a href="#" class="cart-container ast-cart-desktop-position- ast-cart-mobile-position- ast-cart-tablet-position- "> <div class="ast-cart-menu-wrap"> <span class="count"> <span class="ast-count-text"> 4 </span> </span> </div> </a> </div>
- The topic ‘Cart icon and label disappear after page is loaded’ is closed to new replies.