<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>WooCommerce, Remote Work &amp; Other Fancy Stuff</title>
	<atom:link href="https://www.thathandsomebeardedguy.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.thathandsomebeardedguy.com</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Fri, 17 Jun 2022 03:30:27 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.9.3</generator>
<site xmlns="com-wordpress:feed-additions:1">107620791</site>	<item>
		<title>WooCommerce &#038; Colorado Retail Delivery Fee</title>
		<link>https://www.thathandsomebeardedguy.com/woocommerce-colorado-retail-delivery-fee/</link>
					<comments>https://www.thathandsomebeardedguy.com/woocommerce-colorado-retail-delivery-fee/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Fri, 17 Jun 2022 03:30:02 +0000</pubDate>
				<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=574</guid>

					<description><![CDATA[<p>If you&#8217;re a merchant selling goods to customers in Colorado, SB 21-260 establishes a retail delivery fee that merchants are required to collect and remit to the state of Colorado. If you wish to continue to sell to customers in Colorado, you will need a solution to collect this fee. Until a proper solution exists, [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/woocommerce-colorado-retail-delivery-fee/">WooCommerce &#038; Colorado Retail Delivery Fee</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>If you&#8217;re a merchant selling goods to customers in Colorado, <a href="https://leg.colorado.gov/sites/default/files/documents/2021A/bills/fn/2021a_sb260_r4.pdf">SB 21-260</a> establishes a retail delivery fee that merchants are required to collect and remit to the state of Colorado. If you wish to continue to sell to customers in Colorado, you will need a solution to collect this fee. Until a proper solution exists, this code snippet will serve as a band-aid solution.</p>


<script src="https://gist.github.com/4aee2e5762bc424357409461d95231d5.js"></script>



<p></p>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/woocommerce-colorado-retail-delivery-fee/">WooCommerce &#038; Colorado Retail Delivery Fee</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/woocommerce-colorado-retail-delivery-fee/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">574</post-id>	</item>
		<item>
		<title>Remove &#8220;via WooCommerce&#8221; From Express Checkout</title>
		<link>https://www.thathandsomebeardedguy.com/remove-via-woocommerce-from-express-checkout/</link>
					<comments>https://www.thathandsomebeardedguy.com/remove-via-woocommerce-from-express-checkout/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Wed, 26 Jan 2022 03:25:32 +0000</pubDate>
				<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=568</guid>

					<description><![CDATA[<p>WooCommerce Payments express checkout modal injects WooCommerce branding into the checkout experience of your shop. If you would like to remove that, this can be achieved via a filter named wcpay_payment_request_total_label_suffix and an example of that can be seen below: Not sure what to do with code snippets? See What Do I Do With These [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/remove-via-woocommerce-from-express-checkout/">Remove &#8220;via WooCommerce&#8221; From Express Checkout</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>WooCommerce Payments express checkout modal injects WooCommerce branding into the checkout experience of your shop. If you would like to remove that, this can be achieved via a filter named <code>wcpay_payment_request_total_label_suffix</code> and an example of that can be seen below:</p>


<script src="https://gist.github.com/f1c960936a78d6e541a000d1700addd3.js"></script>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/remove-via-woocommerce-from-express-checkout/">Remove &#8220;via WooCommerce&#8221; From Express Checkout</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/remove-via-woocommerce-from-express-checkout/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">568</post-id>	</item>
		<item>
		<title>Date Based Person Cost Adjustment</title>
		<link>https://www.thathandsomebeardedguy.com/date-based-person-cost-adjustment/</link>
					<comments>https://www.thathandsomebeardedguy.com/date-based-person-cost-adjustment/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Wed, 21 Apr 2021 23:16:09 +0000</pubDate>
				<category><![CDATA[Bookings]]></category>
		<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=562</guid>

					<description><![CDATA[<p>If you&#8217;re using WooCommerce Bookings and you are trying to add a cost adjustment to one particular person type based on dates, you will find that this is not possible as the only cost adjustments available via the product configuration options will apply to the bookable block as opposed to the person&#8217;s booking cost. If [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/date-based-person-cost-adjustment/">Date Based Person Cost Adjustment</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>If you&#8217;re using <a href="https://woocommerce.com/products/woocommerce-bookings/?aff=10486&amp;cid=1131038">WooCommerce Bookings</a> and you are trying to add a cost adjustment to one particular person type based on dates, you will find that this is not possible as the only cost adjustments available via the product configuration options will apply to the bookable block as opposed to the person&#8217;s booking cost.</p>



<p>If your pricing model requires this type of granular adjustment, this can be achieved via some custom code. Bookings provides a filter named <code>woocommerce_product_booking_person_type_get_block_cost</code> which could be used in conjunction with posted data to dynamically adjust the person type block cost. You will need to glean the ID of the person type that you are trying to target. That is listed in the person type panel, e.g.:</p>



<figure class="wp-block-image size-large"><img src="https://d.pr/i/SRUJcS+" alt=""/></figure>



<p>With that, if you were trying to adjust the block cost for that person type by $10 during the month of July &amp; August, something like this code snippet would do the trick:</p>


<script src="https://gist.github.com/a9de421335528c6ace13e63fc8a220b2.js"></script>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/date-based-person-cost-adjustment/">Date Based Person Cost Adjustment</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/date-based-person-cost-adjustment/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">562</post-id>	</item>
		<item>
		<title>Hide Shipping Methods &#8211; Payment Request</title>
		<link>https://www.thathandsomebeardedguy.com/hide-shipping-methods-payment-request/</link>
					<comments>https://www.thathandsomebeardedguy.com/hide-shipping-methods-payment-request/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Mon, 29 Mar 2021 04:32:09 +0000</pubDate>
				<category><![CDATA[Stripe]]></category>
		<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[apple-pay]]></category>
		<category><![CDATA[google-pay]]></category>
		<category><![CDATA[payment-request-button]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=560</guid>

					<description><![CDATA[<p>It&#8217;s possible to conditionally remove shipping methods on the checkout page and there are several examples of how this can be done with code. Some of these examples can be seen here: https://docs.woocommerce.com/document/hide-other-shipping-methods-when-free-shipping-is-available/ However, what if we want to hide those shipping methods only if the purchase is done via a WooCommerce Stripe provided payment [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/hide-shipping-methods-payment-request/">Hide Shipping Methods &#8211; Payment Request</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>It&#8217;s possible to conditionally remove shipping methods on the checkout page and there are several examples of how this can be done with code. Some of these examples can be seen here: https://docs.woocommerce.com/document/hide-other-shipping-methods-when-free-shipping-is-available/</p>



<p>However, what if we want to hide those shipping methods only if the purchase is done via a WooCommerce Stripe provided payment request button, Google Pay, Apple Pay, et. al.?</p>



<p>The WooCommerce Stripe payment gateway fires an AJAX action when it retrieves the available shipping methods. One can hook into this same action and on a callback to that, hook into an appropriate WooCommerce filter hook. The examples linked seem to favor filtering <code>woocommerce_package_rates</code> which is fine, but I&#8217;m lazy and that&#8217;s too much work. For my purposes, the <code>woocommerce_shipping_methods</code> filter is much more efficient.</p>



<p>Suppose I wanted to remove Free Shipping as an available shipping method if a customer is using the payment request button to pay. In code, that might look similar to:</p>


<script src="https://gist.github.com/a612a91aaf83e42c16b97275d26cc09a.js"></script>



<p></p>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/hide-shipping-methods-payment-request/">Hide Shipping Methods &#8211; Payment Request</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/hide-shipping-methods-payment-request/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">560</post-id>	</item>
		<item>
		<title>One Coupon Code &#8211; Two Discounts</title>
		<link>https://www.thathandsomebeardedguy.com/one-coupon-code-two-discounts/</link>
					<comments>https://www.thathandsomebeardedguy.com/one-coupon-code-two-discounts/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Tue, 23 Mar 2021 23:45:55 +0000</pubDate>
				<category><![CDATA[WooCommerce Subscriptions]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=555</guid>

					<description><![CDATA[<p>WooCommerce Subscriptions provides a couple of coupon types that are specific to subscription type products. These are documented here Subscription Coupons &#8211; however, it is often desirable to be able to offer a promotional code that would apply a discount to both a sign-up fee and a recurring discount. The use case would be for [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/one-coupon-code-two-discounts/">One Coupon Code &#8211; Two Discounts</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>WooCommerce Subscriptions provides a couple of coupon types that are specific to subscription type products. These are documented here <a href="https://docs.woocommerce.com/document/subscriptions/store-manager-guide/#section-9">Subscription Coupons</a> &#8211; however, it is often desirable to be able to offer a promotional code that would apply a discount to both a sign-up fee and a recurring discount. The use case would be for listing specials on coupon code sites or specials on groupon, etc. Unfortunately, there is currently no way to combine two different types of discounts into one coupon. At least not out-of-the-box.</p>



<p>WooCommerce Subscriptions hooks into the WooCommerce provided <code>woocommerce_coupon_get_discount_amount</code> filter to do its magic. One can hook into that same filter but on a lower priority to also apply a different discount type.</p>



<p>Consider a scenario similar to:</p>



<ol><li>A synced subscription so no payment would be collected at sign-up without a sign-up fee.</li><li>Offer a discount on both the sign-up fee that is used to cover the first installment of the subscription product and for some number of renewals in the future with one coupon code.</li></ol>



<p>Given a coupon code of <code>recurringandsignupdiscount</code> which may be configured similarly to:</p>



<figure class="wp-block-image size-large"><a href="https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32.png"><img loading="lazy" width="1024" height="394" src="https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32-1024x394.png" alt="" class="wp-image-556" srcset="https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32-1024x394.png 1024w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32-300x115.png 300w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32-768x295.png 768w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32-1536x590.png 1536w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2021/03/Screen-Shot-2021-03-23-at-13.01.32-2048x787.png 2048w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>The <code>woocommerce_coupon_get_discount_amount</code> filter can be implemented similar to:</p>


<script src="https://gist.github.com/df9a83e931d560788c3a0a4502e059e4.js"></script>



<p>To achieve the desired effect of one coupon being used for two discount types.</p>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/one-coupon-code-two-discounts/">One Coupon Code &#8211; Two Discounts</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/one-coupon-code-two-discounts/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">555</post-id>	</item>
		<item>
		<title>Conditionally Allow Customer Registration</title>
		<link>https://www.thathandsomebeardedguy.com/conditionally-allow-customer-registration/</link>
					<comments>https://www.thathandsomebeardedguy.com/conditionally-allow-customer-registration/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Tue, 10 Nov 2020 05:33:57 +0000</pubDate>
				<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[WooCommerce Subscriptions]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=547</guid>

					<description><![CDATA[<p>A recent change in WooCommerce has resulted in some cases where customers may be unable to check out if their cart contains a subscription product. This happens if the &#8220;Allow customers to create an account during checkout&#8221; option is disabled in combination with WooCommerce Subscriptions requiring an account at checkout. Effectively, customers are locked out [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/conditionally-allow-customer-registration/">Conditionally Allow Customer Registration</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>A <a href="https://developer.woocommerce.com/2020/11/05/woocommerce-4-6-2-fix-release/">recent change</a> in WooCommerce has resulted in some cases where customers may be unable to check out if their cart contains a subscription product. This happens if the &#8220;Allow customers to create an account during checkout&#8221; option is disabled in combination with WooCommerce Subscriptions <a href="https://docs.woocommerce.com/document/subscriptions/faq/#section-6">requiring an account at checkout</a>. Effectively, customers are locked out of the checkout page unless they log in. This also has an unfortunate side-effect of allowing folks who merchants would rather not have an account the opportunity to create that account.</p>



<p>The implementation of the WooCommerce provided filter named <code>woocommerce_checkout_registration_enabled</code> provides a way to take the behavior back to what may have been experienced with the earlier version of WooCommerce. See below:</p>


<script src="https://gist.github.com/f1e3e27ecfdb6744c50da78b6d6cd2c0.js"></script>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/conditionally-allow-customer-registration/">Conditionally Allow Customer Registration</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/conditionally-allow-customer-registration/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">547</post-id>	</item>
		<item>
		<title>Logging XHR Requests</title>
		<link>https://www.thathandsomebeardedguy.com/logging-xhr-requests/</link>
					<comments>https://www.thathandsomebeardedguy.com/logging-xhr-requests/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Sat, 31 Oct 2020 08:11:10 +0000</pubDate>
				<category><![CDATA[Troubleshooting]]></category>
		<category><![CDATA[WooCommerce]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=537</guid>

					<description><![CDATA[<p>If your WooCommerce site is having problems at checkout, but you&#8217;re not really sure what is behind it (i.e. steps to reproduce have not been identified) logging XHR requests (and JavaScript errors) from the checkout page can provide some insight into what is happening. This technique would require that you had a listener setup somewhere [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/logging-xhr-requests/">Logging XHR Requests</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>If your WooCommerce site is having problems at checkout, but you&#8217;re not really sure what is behind it (i.e. steps to reproduce have not been identified) logging XHR requests (and JavaScript errors) from the checkout page can provide some insight into what is happening.</p>



<p>This technique would require that you had a listener setup somewhere to receive the data and process it. That is outside the scope of this article.</p>



<p>Injecting something like the following JavaScript perhaps using the conditional <code>is_checkout</code> would do the trick</p>


<script src="https://gist.github.com/c3708c1e9ad612050f62c91e5aa815a5.js"></script>

	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/logging-xhr-requests/">Logging XHR Requests</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/logging-xhr-requests/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">537</post-id>	</item>
		<item>
		<title>WooCommerce Bookings Block Number Discount</title>
		<link>https://www.thathandsomebeardedguy.com/woocommerce-bookings-block-number-discount/</link>
					<comments>https://www.thathandsomebeardedguy.com/woocommerce-bookings-block-number-discount/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Wed, 21 Oct 2020 00:03:16 +0000</pubDate>
				<category><![CDATA[Bookings]]></category>
		<category><![CDATA[WooCommerce]]></category>
		<category><![CDATA[snippet]]></category>
		<category><![CDATA[snippets]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=531</guid>

					<description><![CDATA[<p>If we visit the wayback machine and look at the changelog for WooCommerce Bookings we can see that in November of 2015 a new coupon type was added to discount bookable persons. There is no equivalent coupon to discount by some number of blocks. Fortunately, the WooCommerce Coupon class provides a filter that can be [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/woocommerce-bookings-block-number-discount/">WooCommerce Bookings Block Number Discount</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p>If we visit the wayback machine and look at the changelog for WooCommerce Bookings we can see that in November of 2015 a new coupon type was added to discount bookable persons. There is no equivalent coupon to discount by some number of blocks.</p>



<p>Fortunately, the WooCommerce Coupon class provides a filter that can be used to return a discount amount that is calculated dynamically based on the block cost of the bookable product.</p>



<p>The filter passes 6 parameters, the discount amount which is the value to be filtered and the amount that is being discounted, the cart item, a boolean to indicate whether or not this should apply to only one quantity or the entire line regardless of quantity, and an object representation of the coupon. We&#8217;ll need to use all of those in a callback function in order to be able to retrieve the coupon code.</p>



<p>The get_code method of the coupon class can be used to retrieve the coupon code of the current coupon. This can be used to conditionally target a specific coupon.</p>



<p>The cart item array contains an object representation of the bookable product with an array key of &#8216;data&#8217;. This object can be used to call the methods against the bookable product and get the block cost for this particular product.</p>



<p>Once all of that is put together, a new discount amount can be calculated based on the block cost and some arithmetic and assigned to the same variable name that the callback will return. All of that might look like this:</p>


<script src="https://gist.github.com/cb4c7e87fb6326b0d2cbe7d4728cf5e7.js"></script>



<figure class="wp-block-image size-large"><img src="https://d.pr/i/haPhEj+" alt=""/></figure>
<p>Not sure what to do with code snippets? See <a href="https://www.thathandsomebeardedguy.com/what-do-i-do-with-these-code-snippets/" title="What Do I Do With These Code Snippets?">What Do I Do With These Code Snippets?</a></p>
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/woocommerce-bookings-block-number-discount/">WooCommerce Bookings Block Number Discount</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/woocommerce-bookings-block-number-discount/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">531</post-id>	</item>
		<item>
		<title>Jetpack SSO &#038; WooCommerce</title>
		<link>https://www.thathandsomebeardedguy.com/jetpack-sso-woocommerce/</link>
					<comments>https://www.thathandsomebeardedguy.com/jetpack-sso-woocommerce/#respond</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Wed, 17 Jun 2020 00:48:13 +0000</pubDate>
				<category><![CDATA[WooCommerce]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=523</guid>

					<description><![CDATA[<p>Jetpack SSO provides many benefits for ease of use of the site as well as security. By default, the &#8216;Log in with WordPress.com&#8217; button is only output on wp-admin. WooCommerce does not output that button on the my account login form. However, WooCommerce does provide an action hook (or two) that could be used to [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/jetpack-sso-woocommerce/">Jetpack SSO &#038; WooCommerce</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<p><a href="https://jetpack.com/support/sso/">Jetpack SSO</a> provides many benefits for ease of use of the site as well as security. By default, the &#8216;Log in with WordPress.com&#8217; button is only output on wp-admin. WooCommerce does not output that button on the my account login form. However, WooCommerce does provide an action hook (or two) that could be used to output the Jetpack SSO button. Here&#8217;s an example of how that might be done</p>


<script src="https://gist.github.com/1f736fdd3329c86489e64a1a38b9f603.js"></script>

	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/jetpack-sso-woocommerce/">Jetpack SSO &#038; WooCommerce</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/jetpack-sso-woocommerce/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">523</post-id>	</item>
		<item>
		<title>I&#8217;d Love To ❤️ You More</title>
		<link>https://www.thathandsomebeardedguy.com/id-love-to-%e2%9d%a4%ef%b8%8f-you-more/</link>
					<comments>https://www.thathandsomebeardedguy.com/id-love-to-%e2%9d%a4%ef%b8%8f-you-more/#comments</comments>
		
		<dc:creator><![CDATA[Will]]></dc:creator>
		<pubDate>Fri, 01 Nov 2019 05:59:31 +0000</pubDate>
				<category><![CDATA[Other Fancy Stuff]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[productivity]]></category>
		<category><![CDATA[workflow]]></category>
		<guid isPermaLink="false">https://www.thathandsomebeardedguy.com/?p=487</guid>

					<description><![CDATA[<p>I&#8217;ve become interested in expanding my music appreciation lately and as a result, I&#8217;m listening to a lot of things that I haven&#8217;t had any exposure to previously. A great deal of my music listening happens while I&#8217;m working and that work can often require very intense focus. Task switching is a productivity killer. Moving [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/id-love-to-%e2%9d%a4%ef%b8%8f-you-more/">I&#8217;d Love To ❤️ You More</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></description>
										<content:encoded><![CDATA[
	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p>
<figure class="wp-block-image"><img loading="lazy" width="836" height="1024" src="https://www.thathandsomebeardedguy.com/wp-content/uploads/2019/11/Screen-Shot-2019-10-31-at-18.33.44-836x1024.png" alt="" class="wp-image-488" srcset="https://www.thathandsomebeardedguy.com/wp-content/uploads/2019/11/Screen-Shot-2019-10-31-at-18.33.44-836x1024.png 836w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2019/11/Screen-Shot-2019-10-31-at-18.33.44-245x300.png 245w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2019/11/Screen-Shot-2019-10-31-at-18.33.44-768x941.png 768w, https://www.thathandsomebeardedguy.com/wp-content/uploads/2019/11/Screen-Shot-2019-10-31-at-18.33.44.png 1040w" sizes="(max-width: 836px) 100vw, 836px" /><figcaption>To be clear, the hearts here are what I&#8217;m talking about</figcaption></figure>



<p>I&#8217;ve become interested in expanding my music appreciation lately and as a result, I&#8217;m listening to a lot of things that I haven&#8217;t had any exposure to previously. A great deal of my music listening happens while I&#8217;m working and that work can often require very intense focus. Task switching is a productivity killer. Moving completely out of the context of my workspace to &#8220;like&#8221; a song just isn&#8217;t going to happen. But if I don&#8217;t, it may be gone forever.</p>



<p>I wanted a way to quickly mark a groovy track for later exploration and more listening. I wasn&#8217;t able to find any out-of-the-box solution that met my needs. I should have stopped there.</p>



<p>I decided to try to hack something together. Spotify has a quite nice web API. The Spotify Web API equivalent of &#8216;liking&#8217; a song is called <a href="https://developer.spotify.com/console/put-current-user-saved-tracks/">Save Tracks for Current User</a>. I also found a <a href="https://github.com/thelinmichael/spotify-web-api-node">node wrapper for the Spotify API</a> and so at first glance, it looked easy enough to just generate my access token on the Spotify developer &#8216;try it out&#8217; page and hard code that into a few lines of JavaScript and be done with it. And that worked! For awhile <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>So it turns out, the access token is only valid for an hour. The access token can be refreshed so long as it is still valid. Refreshing the token requires that a <a href="https://auth0.com/docs/tokens/refresh-token/current">refresh token</a> is issued in addition to an access token. I definitely should have stopped there.</p>



<p>The access token needs to be refreshed before it expires and if I can&#8217;t be bothered to switch to an app to press a button, I certainly can&#8217;t be bothered to run a series of commands every 45 minutes or so, 24 hours a day.</p>



<p>The solution I finally cobbled together is a two part solution <em>edit: I changed this up a bit. see comments</em>. Part one is tasked with keeping the access token fresh:</p>



<ol><li>Some JavaScript resides on a server somewhere. It&#8217;s on a cron schedule to run every 30 minutes.</li><li>That script refreshes the access token and writes the new access token to a file.</li><li>It also reads that same file for its own access token. The code looks something like this:</li></ol>


<script src="https://gist.github.com/aab6bf4c80839cb85cdcead1e962578a.js"></script>



<p>Part two does the actual job of &#8216;liking&#8217; a song.</p>



<ol><li>Takes some input in the form of a spotify song URI, e.g.: spotify:track:4675yUu8AUbE72T94BkLCD </li><li>strips the <code>spotify:track:</code> bit off of that</li><li>Uses <a href="https://linux.die.net/man/1/scp">scp</a> (via <a href="https://www.npmjs.com/package/scp">node scp</a>) to fetch token.txt from the remote server and writes that locally.</li><li>Reads the token file and sets that to the access token.</li><li>Does this: <img src="https://s.w.org/images/core/emoji/13.1.0/72x72/2764.png" alt="❤" class="wp-smiley" style="height: 1em; max-height: 1em;" /> to a song.</li></ol>



<p>That bit looks like this:</p>


<script src="https://gist.github.com/249be31fc58b55e70900c7107ea86db8.js"></script>



<p><em>Just a side note, the Spotify track URI is fetched via </em><a href="https://github.com/hnarayanan/shpotify"><em>shpotify</em></a><em>.</em></p>



<p>And here&#8217;s how it all works</p>



<figure class="wp-block-image"><img src="https://cld.wthms.co/FYtj4W+" alt=""/></figure>



<p>And, of course I have a voice command so now, all I need to do is say &#8220;heart song&#8221; and the magic happens in the background.</p>



<p>That&#8217;s where I stopped.</p>

	<p><script>
	CoinWidgetCom.go({currency: "bitcoin",
			counter: "hide",
			wallet_address: "bc1qt4cmxxkpcv7dd0u855nzrfwazpfja50apv5kwp",
			qrcode: true,
			auto_show: false,
			lbl_button: "Donate Bitcoin",
			lbl_address: "Donate Bitcoin to this Address:",
			lbl_count: "donations",
			lbl_amount: "BTC"
		});
	</script></p><p>The post <a rel="nofollow" href="https://www.thathandsomebeardedguy.com/id-love-to-%e2%9d%a4%ef%b8%8f-you-more/">I&#8217;d Love To ❤️ You More</a> appeared first on <a rel="nofollow" href="https://www.thathandsomebeardedguy.com">WooCommerce, Remote Work &amp; Other Fancy Stuff</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.thathandsomebeardedguy.com/id-love-to-%e2%9d%a4%ef%b8%8f-you-more/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">487</post-id>	</item>
	</channel>
</rss>
