
// define the woocommerce_created_customer callback function action_woocommerce_created_customer( $customer_id, $new_customer_data, $password_generated ) { // make action magic happen here... }; // add the action add_action( 'woocommerce_created_customer', 'action_woocommerce_created_customer', 10, 3 );
// Change add to cart text on archives depending on product type add_filter( 'woocommerce_product_add_to_cart_text' , 'custom_woocommerce_product_add_to_cart_text' ); function custom_woocommerce_product_add_to_cart_text() { global $product; $product_type = $product->product_type; switch ( $product_type ) { case 'external': return __( 'Add to cart', 'woocommerce' ); break; case 'grouped': return __( 'Add to cart', 'woocommerce' ); break; case 'simple': return __( 'Add to cart', 'woocommerce' ); break; case 'variable': return __( 'Add to cart', 'woocommerce' ); break; default: return __( 'Add to cart', 'woocommerce' ); } };
// Hide WooCommerce Cart Icon When Empty add_action( 'wp_footer', function() { if ( WC()->cart->is_empty() ) { echo '<style type="text/css">.head-cart{ display: none; }</style>'; } });
// Show Excerpt on Shop Page add_action( 'woocommerce_after_shop_loop_item', 'woo_show_excerpt_shop_page', 5 ); function woo_show_excerpt_shop_page() { global $product; echo '<div class="text">'.$product->post->post_excerpt.'</div>'; }
Loading...
No more items to load