title: woocommerece Add to cart button and buy now button on custom product page
body: <p>I'm trying to set "Add-to-cart" and "Buy Now" buttons in my product page:</p>
  
  <ul>
  <li>Add-to-cart button: Simply add product in cart  </li>
  <li>Buy Now button:Add-to-cart and redirect to checkout page</li>
  </ul>
  
  <p>I've tried this solution found on blogs:</p>
  
  <pre><code> function dj_redirect_checkout( $url ) {
          global $woocommerce;
          $checkout_url = $woocommerce-&gt;cart-&gt;get_checkout_url();
          return $checkout_url;
      }
  add_filter( 'add_to_cart_redirect', 'dj_redirect_checkout' );
  </code></pre>
  
  <p>After adding the above code, add-to-cart also redirects link to checkout page. How to accomplish this for both buttons in the product page?</p>