//HOOK REVSLIDER add_filter( 'storefront_before_content', 'add_revslider' ); function add_revslider( $rev_slider ) { if ( is_front_page() ) { echo do_shortcode('[rev_slider alias="revslider"]'); } return $rev_slider; }
Free
Fix collapsed related products
//FIX COLLAPSED RELATED PRODUCTS add_filter( 'woocommerce_after_single_product_summary', 'add_clear_both' ); function add_clear_both( $clear_both ) { echo '<div class="clear"></div>'; return $clear_both; }
Add text with function
//ADD TEXT VIA FUNCTION add_filter( 'ultimatum_print_footer', 'add_barion_banner' ); function add_barion_banner( $barion_banner ) { echo 'TESZT'; return $barion_banner; }
Product category shortcode
[product_category category=”” per_page=”40″ columns=”3″ orderby=”rand”]
New order e-mail custom text if coupon is used
// New order e-mail custom text if coupon is used add_filter( 'woocommerce_email_after_order_table', 'add_custom_email_text' ); function add_custom_email_text($order) { if ($order->get_used_coupons()){ echo ''; } else{ echo ''; } }
Redirect after registration
//Redirect after registration add_filter( 'woocommerce_registration_redirect', 'custom_redirection_after_registration', 10, 1 ); function custom_redirection_after_registration( $redirection_url ){ if ( WC()->cart->get_cart_contents_count() == 0 ) { $redirection_url = get_permalink( wc_get_page_id( 'shop' ) ); }else{ // Change the redirection Url $redirection_url = wc_get_checkout_url(); //Checkout } return $redirection_url; // Always return something } /* "Home" Url: $redirection_url = get_home_url(); "Shop" Url: $redirection_url = get_permalink( wc_get_page_id( 'shop' ) ); "Cart" Url: $redirection_url = wc_get_cart_url(); "Checkout" Url: $redirection_url = wc_get_checkout_url(); "Account" $redirection_url = get_permalink( wc_get_page_id( 'myaccount' ) ); "ID": $redirection_url = get_permalink( $post_id ); (where $post_id is the id of the post or the page) Get post or pages by path (example): $redirection_url = home_url('/product/ninja/'); */