Tag Info

Hot answers tagged

1

Try this - Add your button inside a form and write down script to add product to the cart and redirect user directly to the checkout page. Suppose, following is the button that you can put on single product page using a WooCommerce hook. <button name="checkout_now"> Checkout Now </button> PHP code: global $woocommerce; $post_id = ...


1

Arrrrg a WooCommerce question... quick burn him at the stake! There's a couple of problems with your callback function above: you are not declaring global $woocommerce so you do not have access to the $woocommerce global variable. and $woocommerce->customer holds the state of the WC_Customer class however this class does not contain a get_role() ...



Only top voted, non community-wiki answers of a minimum length are eligible