-
AuthorPosts
-
March 8, 2015 at 8:01 pm #407735
Hi,
I’d like to add the cart count in front of the cart icon in the little cart object that appears on the right side of the menu once you have objects in your cart.March 9, 2015 at 5:54 pm #408294Hi radugidei!
Are you trying to display how many items are in your cart to the left of the icon? Something like this?
3x items in cart [cart icon]
Go ahead and take a screenshot highlighting exactly what your trying to do so we can get a better idea.
Best regards,
Elliott- This reply was modified 9 years, 8 months ago by Elliott.
March 9, 2015 at 6:00 pm #408300Hi Elliot,
yes, that’s exactly what I’m trying to do.March 10, 2015 at 2:12 pm #408822I’m also looking for a method of displaying the number of items in the cart, either where the existing cart option is, or in one of the top menus. Here are some woocommerce examples:
http://demo2.woothemes.com/?name=peddlar
http://demo2.woothemes.com/?name=fashionableMarch 11, 2015 at 4:30 pm #409936Hi!
Open up /enfold/config-woocommerce/config.php and around line 1465 you should see this.
$output .= "<ul {$id} class = 'cart_dropdown' data-success='".__('was added to the cart', 'avia_framework')."'><li class='cart_dropdown_first'>";
And this on the next line.
$output .= "<div class = 'price_display'>".$woocommerce->cart->cart_contents_count."x items in cart</div>";
And then add this to your custom CSS.
.price_display { position: absolute; right: 60px; top: 3px; width: 100px; }
Regards,
ElliottMarch 11, 2015 at 5:44 pm #409993Thanks for the reply Elliott. I found the code at 802 (I’m guessing you’re using a different file version or 1465 was a typo), and added the new line. It works in the parent theme, but I failed to get it to work when I moved a copy of the file to a child theme. It’s probably a little oversimplified in that there is no monetary total (I failed to mention this earlier), and it’s not set up to reflect ‘item’ versus ‘items’.
I’ve found an addon that helps on the larger resolutions (https://wordpress.org/plugins/woocommerce-menu-bar-cart/), but am still trying to figure out a solution for smartphone screen sizes (I’ve discovered that the default Enfold cart isn’t working well on portrait iPhone).
I feel that as Enfold stands currently it works well for a business site that also wants a discreet shop, but I doubt I’d try to use it again for a site that is predominantly a shop. I’m going to head over to your feature request area and add some requests ;-)
-
AuthorPosts
- The topic ‘Add cart count in front of cart symbol’ is closed to new replies.