Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1136310

    Hi,

    I’m looking to disable the dropdown menu of cart items that displays when Header Shopping Cart Icon is moused over and contents are in the cart. What function would achieve this?

    #1136702

    Hey GCSkye,

    Could you please attach a mockup of what you’re trying to achieve?

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

    Best regards,
    Victoria

    #1136709

    View post on imgur.com

    This image is what the cart item looks like when you don’t mouse over it

    This is also what it should look like when it’s mouses over. No drop down…

    #1137172

    Hi GCSkye,

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

    Best regards,
    Victoria

    #1137179

    There’s a link…

    Add that item to your cart
    On the top right is a shopping cart icon that will have the number 1 next to it.
    hover over it…
    You’ll see a drop down showing the item in your cart…

    I do not want that drop down to appear and I do not want a css hack. Currently running the latest version of enfold.

    WooCommerce: Hide Mini-Cart Widget (Dropdown)

    The above guide is how to do it on the WordPress default theme… This should paint vivid picture for you. I’m looking for the exact same solution on enfold.

    I can’t paint a more vivid picture of how the enfold shopping cart system works or what I’m after. Please ask another agent for help if you’re confused.

    Thank you for your time!

    #1137852

    Hi GCSkye,

    The css hack that you don’t want:

    
    .dropdown_widget.dropdown_widget_cart {
      display: none !important;
    }
    

    You can modify this function here
    Image 2019-09-13 at 10.33.22.png

    in this file /enfold/config-woocommerce/config.php
    to not include the html for the dropdown widget.

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1138142

    I had found the function you posted, editing it will not fully solve my problem.

    This line drops the menu down but removing it also removes the numbers of items in the cart display:

    '<div class="widget_shopping_cart_content"></div>';

    What function is actually triggering the drop down? The one posted only creates the HTML structure for it.

    #1139033

    Hi,

    Thank you for the update.

    You can use the following snippet to remove the cart dropdown or to prevent it from rendering.

    add_action('after_setup_theme', function() {
       remove_action( 'ava_before_bottom_main_menu', 'avia_woocommerce_cart_dropdown', 10);
       remove_action( 'ava_inside_main_menu', 'avia_woocommerce_cart_dropdown', 10);
    });
    

    Add it in the functions.php file.

    Best regards,
    Ismael

    #1139227

    Hi Imael,

    It’s great to see you in the thread! Any issue I search, always has you resolving it very expertly.

    Please excuse my lack of clarification in this thread, I assumed I just wasn’t looking through the code properly. It was my expectation that removing something like a dropdown trigger would be simple. To avoid access code, I prefer not to use display:none.

    I greatly appreciate you providing this code. Regretfully, it has no effect on the site. I’ve tried it myself originally, also using ‘init’.

    If we did get it to work, I feel avia_woocommerce_cart_dropdown wouldn’t be the correct function to disable since I want the number of items in the cart to remain.

    I’ve continued looking but still have not had any luck – a lot of content is added inside:

    <div class=”widget_shopping_cart_content”></div>

    The function posted by Victoria is only the root of what we’re looking for. I checked the JS files and found nothing. What is filling <div class=”widget_shopping_cart_content”></div> with content? With this information, I can resolve the issue.

    #1139813

    Hi,

    Thank you for the update.

    This script should remove the drop down containers, but it would be much more simple if you use the css code @Victoria suggested above.

    function ava_remove_cart_widget(){
      ?>
      <script>
      (function($){
          $(document).ready(function(){
              $('.dropdown_widget_cart, .widget_shopping_cart_content').remove();
          })(jQuery);
      </script>
    <?php
    }
    add_action('wp_footer', 'ava_remove_cart_widget');
    

    If you decided to remove the counter as well, try this one.

    add_action('after_setup_theme', function() {
       remove_action( 'ava_main_header', 'avia_woocommerce_cart_dropdown', 10);
       remove_action( 'ava_before_bottom_main_menu', 'avia_woocommerce_cart_dropdown', 10);
       remove_action( 'ava_inside_main_menu', 'avia_woocommerce_cart_dropdown', 10);
    });
    

    Best regards,
    Ismael

    #1139925

    Thank you for those functions. I don’t want you guys to feel the need to keep re-coding the same answer and it not be the solution. Does anyone know what is populating the html code:

    ‘<div class=”widget_shopping_cart_content”></div>’;

    Inside of the function avia_woocommerce_cart_dropdown? I won’t need any code solutions if you can just point me in the direction of that. I’ll take care of the rest.

    #1140095

    Hey!

    That container is automatically populated by the woocommerce_mini_cart function or the ‘cart/mini-cart.php’ template.

    /**
    	 * Output the Mini-cart - used by cart widget.
    	 *
    	 * @param array $args Arguments.
    	 */
    	function woocommerce_mini_cart( $args = array() ) {
    
    		$defaults = array(
    			'list_class' => '',
    		);
    
    		$args = wp_parse_args( $args, $defaults );
    
    		wc_get_template( 'cart/mini-cart.php', $args );
    	}
    

    You can override that by defining the same function and return null.

    function woocommerce_mini_cart() {
       return null;
    }

    Cheers!
    Ismael

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