What is the problem with these lines of code?

I would recommend trying to add an output buffer. I find a lot of times if I’m echoing something in WordPress and it doesn’t show up, adding the output buffering does the trick. <?php add_action(‘woocommerce_archive_description’ , ‘sample’ ); function sample(){ ob_start(); echo “Hello World”; return ob_get_clean(); } ?>

List of JS events in the WooCommerce frontend

On a hunt for the same I took a little dive into the JS source files. Woocommerce Javascript events Woocommerce Checkout JS events $( document.body ).trigger( ‘init_checkout’ ); $( document.body ).trigger( ‘payment_method_selected’ ); $( document.body ).trigger( ‘update_checkout’ ); $( document.body ).trigger( ‘updated_checkout’ ); $( document.body ).trigger( ‘checkout_error’ ); $( document.body ).trigger( ‘applied_coupon_in_checkout’ ); $( document.body … Read more

Make e-Mail optional on Woocommerce sign up

Try this code in functions.php. Since it is a requirement in billing, we need to set it as false. // For billing email – Make them not required add_filter( ‘woocommerce_billing_fields’, ‘filter_billing_fields’, 20, 1 ); function filter_billing_fields( $billing_fields ) { // Only on checkout page if( ! is_checkout() ) return $billing_fields; $billing_fields[‘billing_email’][‘required’] = false; return $billing_fields; … Read more