Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #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.
    #838026

    Hey Innovie,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #838495

    Hi 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.
    #838659

    Hi 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,
    Victoria

    #844767

    Hi,

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

    #846648

    Hi,

    Please remove the modification then go to the Enfold > Shop Options panel. Set the “Header Shopping Cart Icon” to the third option.

    Best regards,
    Ismael

    #851978

    Hi Ismael,

    thats not possible without breaking the layout!
    it would look like in the screenshot attached.

    #852438

    Hi,

    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,
    Ismael

    #852464

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

    #852799

    Hi,

    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,
    Ismael

    #853315

    Hi,

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

    #853718

    Hi,

    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,
    Ismael

    #853802

    Hi,

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

    Hi,

    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,
    Ismael

    #854281

    Hi,

    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?

    #854770

    Hi,

    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,
    Ismael

    #854774

    Thanks! 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.
    #855221

    Hi,

    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,
    Ismael

    #855510

    Hi,

    i removed the custom script from above and edit woocommerce-mod.js as described

    but still having the same issue. did I forget something?!

    #855670

    Hi,

    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,
    Ismael

    #856836

    Great! 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!

    #857257

    Hi,

    Yes, we have reported the issue and our devs found a much better fix. For now, please leave the modifications.

    Best regards,
    Ismael

Viewing 22 posts - 1 through 22 (of 22 total)
  • You must be logged in to reply to this topic.