WooCommerce, Remote Work & Other Fancy Stuff

Just another WordPress site

Troubleshooting WooCommerce HTTP Requests

March 1, 2023 by Will Leave a Comment

The WordPress codebase exposes some extraordinarily useful hooks for troubleshooting within the WP_Http class. In particular the http_api_debug action which passes the response to the request or an instance of WP_Error on failure. Combining that with the WC_Logger could be used to implement a basic HTTP debug logger. Something along the lines of: If one […]

Filed Under: Troubleshooting, WooCommerce

Authorize Subscription Renewal Payments

January 6, 2023 by Will Leave a Comment

By default, the WooCommerce Stripe Payment Gateway captures payments rather than authorizing and this works well for most use-cases. However, imagine you’re a merchant who has issues with chargebacks related to subscription renewal orders and would rather authorize the payments to give the customer a few days. How can this be done? The WP-Http class […]

Filed Under: WooCommerce Tagged With: snippet, snippets

WooCommerce & Colorado Retail Delivery Fee

June 17, 2022 by Will 6 Comments

If you’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, […]

Filed Under: WooCommerce Tagged With: snippet, snippets

Remove “via WooCommerce” From Express Checkout

January 26, 2022 by Will Leave a Comment

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 […]

Filed Under: WooCommerce Tagged With: snippet, snippets

Date Based Person Cost Adjustment

April 21, 2021 by Will Leave a Comment

If you’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’s booking cost. If […]

Filed Under: Bookings, WooCommerce Tagged With: snippet, snippets

Hide Shipping Methods – Payment Request

March 29, 2021 by Will Leave a Comment

It’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 […]

Filed Under: Stripe, WooCommerce Tagged With: apple-pay, google-pay, payment-request-button, snippet, snippets

One Coupon Code – Two Discounts

March 23, 2021 by Will Leave a Comment

WooCommerce Subscriptions provides a couple of coupon types that are specific to subscription type products. These are documented here Subscription Coupons – 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 […]

Filed Under: WooCommerce Subscriptions Tagged With: snippet, snippets

Conditionally Allow Customer Registration

November 10, 2020 by Will Leave a Comment

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 “Allow customers to create an account during checkout” option is disabled in combination with WooCommerce Subscriptions requiring an account at checkout. Effectively, customers are locked out […]

Filed Under: WooCommerce, WooCommerce Subscriptions Tagged With: snippet, snippets

Logging XHR Requests

October 31, 2020 by Will Leave a Comment

If your WooCommerce site is having problems at checkout, but you’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 […]

Filed Under: Troubleshooting, WooCommerce

WooCommerce Bookings Block Number Discount

October 21, 2020 by Will Leave a Comment

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 […]

Filed Under: Bookings, WooCommerce Tagged With: snippet, snippets

  • 1
  • 2
  • 3
  • …
  • 7
  • Next Page »

© 2023 ยท WooCommerce, Remote Work & Other Fancy Stuff · Epstein didn't kill himself