Side cart hooks
-
Hey Xootix, thanks for your great work.
I was wondering if it’s possible to use/reference custom hooks with your Side cart plugin?
I have successfully used the code snippet below to display this dynamic box on the cart page, for example.
If I can get this to display on the side cart with Pro only I’ll happily make the upgrade.
// Woocommerce - cart page notification add_action( 'woocommerce_before_cart_table', 'cart_page_notice' ); function cart_page_notice() { $min_amount = 20; //This is the amount of your free shipping threshold. Change according to your free shipping settings $current = WC()->cart->subtotal; if ( $current < $min_amount ) { $added_text = '<div class="woocommerce-message">Spend ' . wc_price( $min_amount - $current ) . ' more to get fast & free shipping<br/>'; // This is the message shown on the single product page $return_to = wc_get_page_permalink( 'shop' ); $notice = sprintf( '%s<a href="%s">%s</a>', $added_text, esc_url( $return_to ), 'Continue shopping</div>' ); // This is the text shown below the notification. Link redirects to the shop page echo $notice; } }
- The topic ‘Side cart hooks’ is closed to new replies.