-
AuthorPosts
-
August 10, 2017 at 3:29 pm #837016
Hi,
after moving the woocommerce Cart in the Main Menu Container (see Code below).
It doubles the amount of items in the cart_counter.After a few hours of debugging i found out that
<nav class="main_menu">…</nav>
is beeing duplicated. (I use Header Bottom Menu)
this is the reason why the amount of items is displayed twice as many.// **********************************************************************// // Move Cart To Main Menu Area // **********************************************************************// add_action('init', 'ec_move_cart_dropdown', 5); function ec_move_cart_dropdown() { remove_action( 'init', 'avia_woocommerce_cart_placement', 10); add_action( 'ava_inside_main_menu', 'avia_woocommerce_cart_dropdown', 5); }
is there a workarround for that? THANKS!
- This topic was modified 7 years, 3 months ago by Innovie.
August 12, 2017 at 9:27 pm #838026Hey Innovie,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaAugust 14, 2017 at 9:16 am #838495Hi Victoria,
Please check out the english version only as it is the current one.
- This reply was modified 7 years, 3 months ago by Victoria.
August 14, 2017 at 2:24 pm #838659Hi Innovie,
I am seeing only one. The other one is a sub menu, and has that class “sub_menu”. If you’re seeing it different, please attach a few screenshots here.
Best regards,
VictoriaAugust 28, 2017 at 12:12 pm #844767Hi,
this is only visible in code!
to replicate the bug. Please add ONE Item to the cart.
You will see to Items in Cart (see screenshot).September 1, 2017 at 7:26 am #846648Hi,
Please remove the modification then go to the Enfold > Shop Options panel. Set the “Header Shopping Cart Icon” to the third option.
Best regards,
IsmaelSeptember 14, 2017 at 11:07 am #851978Hi Ismael,
thats not possible without breaking the layout!
it would look like in the screenshot attached.September 15, 2017 at 9:58 am #852438Hi,
Thank you for the update.
We can adjust the position of the cart icon with css. Please remove the modification then post the login details here so that we can inspect the element.
Best regards,
IsmaelSeptember 15, 2017 at 10:36 am #852464Hi Ismael,
due to my client i can only exclude it for debug purposes conditionally.
By adding a GET Variable you can access it without the modification.
See URL below.September 16, 2017 at 6:40 am #852799Hi,
Where did you add the cart modification? I can’t find it in the functions.php file. The problem is that the cart dropdown is duplicated. There’s one inside the header_main container and the other inside header_main_alternate container. How did you move the cart inside the “header_main_alternate”?
Best regards,
IsmaelSeptember 18, 2017 at 8:54 am #853315Hi,
this is the function I implemented:
// **********************************************************************// // Move Cart To Main Menu Area // **********************************************************************// add_action('init', 'ec_move_cart_dropdown', 5); function ec_move_cart_dropdown() { if($_GET['cart_debug'] != 1): remove_action( 'init', 'avia_woocommerce_cart_placement', 10); add_action( 'ava_inside_main_menu', 'avia_woocommerce_cart_dropdown', 5); endif; }
as in my first post described,
<nav class="main_menu">…</nav>
is duplicated by JavaScript (avia.js).September 19, 2017 at 6:58 am #853718Hi,
The nav “main_menu” contains the original cart icon. You have to create a script to remove the cart inside the “main_menu”.
Best regards,
IsmaelSeptember 19, 2017 at 11:49 am #853802Hi,
Could you please be more specific? What do you mean by creating a script to remove the cart inside the “main_menu”?
“main_menu” exists twice.
“#header_main_alternate > .main_menu” is the one i need to display in my case.
But “.av-logo-container .main_menu” is responsible for that bug.how can i remove it there (PHP/JS)?
- This reply was modified 7 years, 2 months ago by Innovie.
September 20, 2017 at 7:09 am #854193Hi,
as in my first post described, main_menu is duplicated by JavaScript (avia.js).
What is the js script that you use to duplicate the “main_menu”? The cart icon is inside the main_menu container so it’s duplicated as well. You have to remove the cart icon first before duplicating the “main_menu”.
Best regards,
IsmaelSeptember 20, 2017 at 10:16 am #854281Hi,
What is the js script that you use to duplicate the “main_menu”?
I DON’t duplicate “main_menu”. That happens by Enfold, which copies “main_menu” to #header_main_alternate!
I thought you would know that ;-)The cart icon is inside the main_menu container so it’s duplicated as well. You have to remove the cart icon first before duplicating the “main_menu”.
How does that work?
September 21, 2017 at 12:04 pm #854770Hi,
I see. I was not aware of that. We added this code in the functions.php file to remove the first cart icon.
// custom script add_action( 'wp_footer', 'ava_custom_script' ); function ava_custom_script() { ?> <script type="text/javascript"> (function($) { setTimeout(function() { $(".av-logo-container #menu-item-shop").remove(); }, 500); })(jQuery); </script> <?php }
Please remove browser cache before checking the page.
Best regards,
IsmaelSeptember 21, 2017 at 12:09 pm #854774Thanks! I can see that it is working for product page! but after switching to an other page it shows 2 items again instead of 1….
could you please have a look! Appreciate your support!
- This reply was modified 7 years, 2 months ago by Innovie.
September 22, 2017 at 7:58 am #855221Hi,
I found the issue in the config-woocommerce > woocommerce-mod.js file, look for this code around line 84:
menu_cart = jQuery('.cart_dropdown'),
Replace it with:
menu_cart = jQuery('.av-logo-container .cart_dropdown'),
Please remove the other modifications. We’ll report the issue to Kriesi.
Best regards,
IsmaelSeptember 22, 2017 at 6:43 pm #855510Hi,
i removed the custom script from above and edit woocommerce-mod.js as described
but still having the same issue. did I forget something?!
September 23, 2017 at 3:48 am #855670Hi,
Yes, we forgot to update the “update_cart_dropdown” function line 118.
menu_cart = jQuery('.cart_dropdown'),
Replace it with:
menu_cart = jQuery('.av-logo-container .cart_dropdown'),
Best regards,
IsmaelSeptember 26, 2017 at 9:47 am #856836Great! Thats it!
line 84 & line 118 in config-woocommerce > woocommerce-mod.js have to be changed!
Could you please fix it in your next update so I dont loose the change in the future releases.
thanks a lot!September 27, 2017 at 5:05 am #857257 -
AuthorPosts
- You must be logged in to reply to this topic.