Tagged: 

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1475794

    I want to remove the new products section on the empty cart page and change it to a button (see attached image)
    ask-cart-page

    Please help me and thanks.

    #1475796

    Hey marketbiz,
    To remove the new products section on the empty cart page add this css to your Quick CSS:

    .woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-product-new,.woocommerce-cart .wp-block-woocommerce-empty-cart-block .wp-block-heading:not(.wc-block-cart__empty-cart__title) {
    	display:none;
    }

    Then to add the button add this code to the end of your child theme functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
      <script>
    (function($){
      var button = $('<div class="avia-button-wrap av-m6cpztd3-7c60bd307536e2939b17d69a432c4593-wrap avia-button-center  avia-builder-el-56  el_after_av_button  avia-builder-el-last "><style type="text/css" data-created_by="avia_inline_auto" id="style-css-av-m6cpztd3-7c60bd307536e2939b17d69a432c4593">#top #wrap_all .avia-button.av-m6cpztd3-7c60bd307536e2939b17d69a432c4593{border-radius:20px 20px 20px 20px;transition:all 0.4s ease-in-out;}#top #wrap_all.avia-button.av-m6cpztd3-7c60bd307536e2939b17d69a432c4593:hover .avia_button_background{border-radius:20px 20px 20px 20px;}</style><a href="#" class="avia-button av-m6cpztd3-7c60bd307536e2939b17d69a432c4593 av-link-btn avia-icon_select-no avia-size-x-large avia-position-center avia-color-dark" title="Dashboard" aria-label="Dashboard"><span class="avia_iconbox_title">Dashboard</span></a></div>');
      if ($("body").hasClass("woocommerce-cart") && $(".wp-block-woocommerce-empty-cart-block .wc-block-grid").hasClass("wp-block-woocommerce-product-new") == true) {
      $(button).appendTo('.wp-block-woocommerce-cart');
      } else {}
    })(jQuery);
    </script>
      <?php
    }
    add_action( 'wp_footer', 'custom_script', 99 );

    Please ensure to copy the code from the forum and not an email notification so the symbols are not converted.
    Then adjust the button URL to suit.
    Screen Shot 2025 01 25 at 5.05.08 PM

    Best regards,
    Mike

    #1475806

    Perfect!
    Thank you, I reallly appreciate

    #1475816

    Hi,
    Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Need help removing New Product section from empty cart page’ is closed to new replies.