Additional button after adding to cart - by Peter

This topic has 2 replies, 2 voices, and was last updated 6 days, 8 hours ago ago by Jack Richardson

  • Avatar: Peter
    Peter
    Participant
    May 29, 2026 at 06:37

    Hi,
    1. I need to add an additional button in the selected area. After adding a product to the cart, a window pops up, and I’d like an additional “continue shopping” button.
    2. And underneath, I’d like a “recommended products” slider to appear in one line.

    How do I do this?

    Content is visible for topic creator and
    support staff only.
    1 Answer
    Avatar: Jack Richardson
    Jack Richardson
    Support staff
    May 29, 2026 at 07:39

    Hello @Peter,

    Please note that this is an additional customization request that is not included in our basic support. However, we can provide you with some code snippets that you may try to achieve the desired result: https://gyazo.com/f5437621e64759cef84b2e1b69c85f12 (please note that custom CSS should also be added to adjust the styling).

    To display the “Continue shopping” button you can add the following snippet to your child theme’s functions.php file:

    add_action('woocommerce_widget_shopping_cart_before_buttons', function() {  
        if ( wc_get_page_id( 'shop' ) > 0 )  
            echo '' . esc_html__('Continue shopping', 'xstore') . '';  
    }, 999);

    To display the additional products you can add the following snippet to your child theme’s functions.php file:

    add_action('etheme_after_mini_cart_footer', function() {
    	if ( !function_exists('etheme_slider') ) return;
    
    	$meta_query = WC()->query->get_meta_query();
    	$posts_per_page = 2;
    	$hide_out_stock = true;
    			
    	$args = array(
    		'post_type'           => array( 'product', 'product_variation' ),
    		'ignore_sticky_posts' => 1,
    		'no_found_rows'       => 1,
    		'posts_per_page'      => $posts_per_page,
    		'post__in'            => array(757, 721), // ids to include 
    		'post__not_in'        => array(765), // ids to exclude 
    		'meta_query'          => $meta_query,
    	);
    			
    	if ( $hide_out_stock ) {
    		$args['meta_query'] = array_merge($args['meta_query'], array(
    			array(
    				'key'     => '_stock_status',
    				'value'   => 'instock',
    				'compare' => '='
    			),
    		));
    	}
    
    	$slider_args = array(
    				'before'          => '<h4 class="widget-title"><span>' . esc_html__( 'You may also like...', 'xstore' ) . '</span></h4>',
    				'slider_autoplay' => false,
    				'slider_speed'    => '0',
    				'autoheight'      => false,
    				'large'           => 2,
    				'notebook'        => 2,
    				'tablet_land'     => 2,
    				'tablet_portrait' => 1,
    				'mobile'          => 1,
    				'echo'            => false,
    
    				'attr'            => 'data-space="0"',
                    'widget'          => true,
                    'wrap_widget_items_in_div' => true
    			);
    
    	echo '<div class="sidebar-slider">' . etheme_slider( $args, 'product', $slider_args ) . '</div>';
    
    });

    Please, note that if you require additional customization we kindly suggest you to submit your request on our trusted partner WP Kraken.

    You’ll get:

    – fast quote & timeline
    – turnkey implementation by a vetted team
    – warranty on delivered work

    We’re confident this will help—hope you can make use of it shortly.

    Best regards,
    Jack Richardson
    The 8Theme’s Team

    Content is visible for topic creator and
    support staff only.
  • Viewing 2 results - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.Log in/Sign up

We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.