In case you have a look round right here on my web site you’ll discover ca 250 totally different Woocommerce associated hacks. On this publish I’ll present you 27 of my favourite Woocommerce cart web page, checkout web page and my account web page associated hacks. So, let’s check out the 27 methods the best way to enhance your Woocommerce retailer.
One factor you must know beforehand, although. In case you don’t know the place so as to add these snippets right here beneath, then add them both to your little one theme’s capabilities.php file or higher but, use a snippet supervisor like Code Snippets
Video: 27 Methods Tips on how to Enhance Woocommerce Retailer
Tips on how to set Minimal Order Quantity in WooCommerce?
With the assistance of this snippet right here beneath we are going to set a minimal order quantity in Woocommerce to 1000 euros and can show an error message on the cart and checkout pages if the situations usually are not met (see the screenshot). Simply exchange the quantity contained in the code accordingly.
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
operate wc_minimum_order_amount() {
$minimal = 1000; // Set this variable to specify a minimal order worth
if ( WC()->cart->whole
// Set Minimal Order Quantity in WooCommerce
add_action( 'woocommerce_checkout_process', 'wc_minimum_order_amount' );
add_action( 'woocommerce_before_cart' , 'wc_minimum_order_amount' );
operate wc_minimum_order_amount() {
$minimal = 1000; // Set this variable to specify a minimal order worth
if ( WC()->cart->whole < $minimal ) {
if( is_cart() ) {
wc_print_notice(
sprintf( 'Your present order whole is %s — you will need to have an order with a minimal of %s to position your order ' ,
wc_price( WC()->cart->whole ),
wc_price( $minimal )
), 'error'
);
} else {
wc_add_notice(
sprintf( 'Your present order whole is %s — you will need to have an order with a minimal of %s to position your order' ,
wc_price( WC()->cart->whole ),
wc_price( $minimal )
), 'error'
);
}
}
}
Tips on how to present “XX to free delivery” notification in Woocommerce?
It’s a good suggestion to encourage your customers to purchase a bit extra with a view to get free delivery. This snippet right here beneath will add this textual content to your cart “Purchase XX€ value merchandise extra to get free delivery”
add_action( 'woocommerce_before_cart_table', 'cart_page_notice' );
operate cart_page_notice() {
$min_amount = 1000; //That is the quantity of your free delivery threshold. Change in response to your free delivery settings
$present = WC()->cart->subtotal;
if ( $present < $min_amount ) {
$added_text = '<div class="woocommerce-message"><sturdy>Purchase ' . wc_price( $min_amount – $present ) . ' value merchandise extra to get free delivery</sturdy>'; // That is the message proven on the cart web page
$return_to = wc_get_page_permalink( 'store' );
$discover = sprintf( '%s<a category="button" href="%s">%s</a>', $added_text, esc_url( $return_to ), 'Proceed buying
// Present "XX to free delivery" notification in Woocommerce
add_action( 'woocommerce_before_cart_table', 'cart_page_notice' );
operate cart_page_notice() {
$min_amount = 1000; //That is the quantity of your free delivery threshold. Change in response to your free delivery settings
$present = WC()->cart->subtotal;
if ( $present < $min_amount ) {
$added_text = '<div class="woocommerce-message"><sturdy>Purchase ' . wc_price( $min_amount - $present ) . ' value merchandise extra to get free delivery</sturdy>'; // That is the message proven on the cart web page
$return_to = wc_get_page_permalink( 'store' );
$discover = sprintf( '%s<a category="button" href="%s">%s</a>', $added_text, esc_url( $return_to ), 'Proceed buying</div>' ); // That is the textual content proven beneath the notification. Hyperlink redirects to the store web page
echo $discover;
}
}