{"id":726,"date":"2022-04-22T17:18:31","date_gmt":"2022-04-22T17:18:31","guid":{"rendered":"https:\/\/jmrowe.com\/blog\/?p=726"},"modified":"2022-04-22T17:31:30","modified_gmt":"2022-04-22T17:31:30","slug":"woocommerce-snippets","status":"publish","type":"post","link":"https:\/\/jmrowe.com\/blog\/woocommerce-snippets\/","title":{"rendered":"Woocommerce snippets"},"content":{"rendered":"<p>For <strong>SINGLE PRODUCTS<\/strong>&#8211; Skip Cart WooCommerce shopping cart altogether and send your buyers straight to the checkout page and Increase Conversions Instantly! The more steps you put your buyer through, the lower your conversions. Here are the 2 code snippets:<\/p>\n<p><strong>WooCommerce Skip Cart Code<\/strong><\/p>\n<p>This snippet allows the user to skip to the cart directly.<\/p>\n<pre class=\"lang:php decode:true\">add_filter( 'woocommerce_add_to_cart_redirect', 'skip_woo_cart' ); function skip_woo_cart() { return wc_get_checkout_url(); }\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong>Change WooCommerce Add to Cart Button Text to BUY NOW!<\/strong><\/p>\n<pre class=\"lang:php decode:true\">add_filter( 'woocommerce_product_single_add_to_cart_text', 'cw_btntext_cart' ); add_filter( 'woocommerce_product_add_to_cart_text', 'cw_btntext_cart' ); function cw_btntext_cart() { return __( 'Go To Checkout', 'woocommerce' ); }\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Both snippet will work on WooCommerce 4 and newer.<\/p>\n<p>Once you add these codes to your WooCommerce store, you\u2019ll see that your customers will be redirected to the checkout once they click on the Buy Now button.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>For SINGLE PRODUCTS&#8211; Skip Cart WooCommerce shopping cart altogether and send your buyers straight to the checkout page and Increase Conversions Instantly! The more steps you put your buyer through, the lower your conversions. Here are the 2 code snippets: WooCommerce Skip Cart Code This snippet allows the user to skip to the cart directly. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,11],"tags":[],"class_list":["post-726","post","type-post","status-publish","format-standard","hentry","category-php","category-wordpress"],"_links":{"self":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/comments?post=726"}],"version-history":[{"count":4,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/726\/revisions"}],"predecessor-version":[{"id":731,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/posts\/726\/revisions\/731"}],"wp:attachment":[{"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/media?parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/categories?post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jmrowe.com\/blog\/wp-json\/wp\/v2\/tags?post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}