How To Archives - CheckoutWC https://www.checkoutwc.com/doc-cats/how-to/ Tue, 13 Feb 2024 17:21:35 +0000 en-US hourly 1 How To Fix Problems With The Bluehost Plugin https://www.checkoutwc.com/documentation/how-to-fix-problems-with-the-bluehost-plugin/ Tue, 13 Feb 2024 17:21:22 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=117720 Bluehost provides a plugin named The Bluehost Plugin. This plugin must be deactivated to prevent problems with CheckoutWC. The reason it must be deactivated is that the plugin forcibly swaps the billing and shipping checkout fields if the default shipping destination is set to the shipping address which causes all sorts of problems. Related GitHub […]

The post How To Fix Problems With The Bluehost Plugin appeared first on CheckoutWC.

]]>
Bluehost provides a plugin named The Bluehost Plugin. This plugin must be deactivated to prevent problems with CheckoutWC.

The reason it must be deactivated is that the plugin forcibly swaps the billing and shipping checkout fields if the default shipping destination is set to the shipping address which causes all sorts of problems.

Related GitHub issue: https://github.com/bluehost/bluehost-wordpress-plugin/issues/905

The post How To Fix Problems With The Bluehost Plugin appeared first on CheckoutWC.

]]>
How To Configure Payment Plugins for Stripe WooCommerce To Work With Express Checkout https://www.checkoutwc.com/documentation/how-to-configure-payment-plugins-for-stripe-woocommerce-to-work-with-express-checkout/ Mon, 30 Oct 2023 19:33:56 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=110630 Payment Plugins for Stripe WooCommerce is our preferred Stripe gateway. We’ve worked with the Payment Plugins team to ensure our customers get the best Stripe experience with CheckoutWC. There are two configuration steps you need to take to ensure maximum compatibility. Configuring Payment Plugins Stripe for WooCommerce for Express Checkout  Enable ‘Top of Checkout’ for […]

The post How To Configure Payment Plugins for Stripe WooCommerce To Work With Express Checkout appeared first on CheckoutWC.

]]>
Payment Plugins for Stripe WooCommerce is our preferred Stripe gateway. We’ve worked with the Payment Plugins team to ensure our customers get the best Stripe experience with CheckoutWC.

There are two configuration steps you need to take to ensure maximum compatibility.

Configuring Payment Plugins Stripe for WooCommerce for Express Checkout 

Enable ‘Top of Checkout’ for each express button

Go to WP Admin > WooCommerce > Settings > Payments and find the settings for each express button. Example: 
Apple Pay (Stripe) by Payment Plugins

Find the setting called Payment Sections and enable Top of Checkout.

Click Save changes and repeat for any other express buttons you want to enable.

 

The post How To Configure Payment Plugins for Stripe WooCommerce To Work With Express Checkout appeared first on CheckoutWC.

]]>
How To Deselect Initial WooCommerce Payment Method (Comply With Finnish Regulations in 2023) https://www.checkoutwc.com/documentation/how-to-deselect-initial-woocommerce-payment-method-comply-with-finnish-regulations-in-2023/ Wed, 13 Sep 2023 17:04:00 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=107460 To help customers comply with new regulations in Finland that require that the checkout page is loaded without a payment gateway selected, we have added two new filters to 8.2.11.  Both are required. Please review the examples below. PHP Filter: cfw_ensure_selected_payment_method This is a standard WordPress filter with receives a boolean value that determines whether […]

The post How To Deselect Initial WooCommerce Payment Method (Comply With Finnish Regulations in 2023) appeared first on CheckoutWC.

]]>
To help customers comply with new regulations in Finland that require that the checkout page is loaded without a payment gateway selected, we have added two new filters to 8.2.11. 

Both are required. Please review the examples below.

PHP Filter: cfw_ensure_selected_payment_method

This is a standard WordPress filter with receives a boolean value that determines whether or not a gateway will be selected by default. (Default: true)

JS Filter: cfw_js_ensure_selected_payment_method

This is a JS filter using @wordpress/hooks. Our JS action and filter hooks use the global wp.hooks object that is available on the window object.

Just like the PHP version, it receives a boolean value that determines whether a payment gateway should be opportunistically selected if none is selected. (Default: true)

How To Deselect Initial Payment Method with WooCommerce and CheckoutWC

Step 1: Add the following code to WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets

Step 2: Add the following code to WP Admin > CheckoutWC > Advanced > Scripts > Checkout (subsection) > Header Scripts:

The post How To Deselect Initial WooCommerce Payment Method (Comply With Finnish Regulations in 2023) appeared first on CheckoutWC.

]]>
Hot To Add Custom HTML To The WooCommerce Checkout Page https://www.checkoutwc.com/documentation/hot-to-add-custom-html-to-the-woocommerce-checkout-page/ Wed, 23 Aug 2023 15:26:58 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=106076 Adding custom HTML to the checkout page is pretty simple, but it does take a small amount of PHP.  Step 1: Where do you want to add the custom HTML? You first need to decide where you want to output your custom HTML. The easiest way to do this is to look at our Visual […]

The post Hot To Add Custom HTML To The WooCommerce Checkout Page appeared first on CheckoutWC.

]]>
Adding custom HTML to the checkout page is pretty simple, but it does take a small amount of PHP. 

Step 1: Where do you want to add the custom HTML?

You first need to decide where you want to output your custom HTML. The easiest way to do this is to look at our Visual Hook Guide. This allows you to see exactly where each action hook outputs.

Simply pick an action hook and proceed to step 2.

For our purposes, we’ll use this one: cfw_after_cart_summary

Step 2: Write a PHP snippet to output your custom HTML

Using the WordPress Action Hook API we can insert our HTML anywhere.

Here’s an example using cfw_after_cart_summary:

You can modify this example to suit your needs.

Step 3: Deploy your custom HTML block

To deploy your custom HTML block, you have a few options:

  1. You can add it as a PHP Snippet here: WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets
  2. You can add it to your child theme’s functions.php file
  3. You can use a plugin like Code Snippets.

The post Hot To Add Custom HTML To The WooCommerce Checkout Page appeared first on CheckoutWC.

]]>
How To Ensure Your WordPress Cron Is Working Properly https://www.checkoutwc.com/documentation/how-to-ensure-your-wordpress-cron-is-working-properly/ Tue, 16 May 2023 15:17:45 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=100135 WordPress includes a system for processing repeated tasks, often called cron jobs. (Cron stands for Command Run On – it’s a very Unix name) But whatever it stands for, it’s job is to make sure that background tasks are consistently run. Within WordPress, this is accomplished by default in a less than ideal way. Instead […]

The post How To Ensure Your WordPress Cron Is Working Properly appeared first on CheckoutWC.

]]>
WordPress includes a system for processing repeated tasks, often called cron jobs. (Cron stands for Command Run On – it’s a very Unix name) But whatever it stands for, it’s job is to make sure that background tasks are consistently run.

Within WordPress, this is accomplished by default in a less than ideal way. Instead of having a system level cron job that reliably executes any tasks that are due every minute, WordPress has a different approach: whenever someone visits your site, it spins up its own cron mechanism in the background. This happens at the end of the PHP request, so as to cause as little disruption as possible.

When wp-cron spins up, it checks for any behind schedule tasks and processes them. There are two major issues with this approach, which you may have already anticipated:

  1. If your site is not accessed frequently (or is cached), the WP cron jobs will run infrequently (or never at all)
  2. If a cron job takes awhile to run, it could lock up multiple PHP threads reducing the number of available resources for your visitors.

Fortunately there are a few of straight forward ways to fix this.

Note: If you’re using a WordPress managed host, chances are they already manage your cron setup for you and you won’t need to do anything. When it doubt, ask your host.

Step 1: Disable WP Cron

Disabling the WP cron doesn’t prevent tasks from running, it disables the normal method those tasks are executed. To disable WP cron, add the following to your wp-config.php file:

define('DISABLE_WP_CRON', true);

Step 2: Setup properly functioning cron scheduling

Option 1: Use cron-job.org (Difficulty: Easy)

cron-job.org solves issue 1: infrequently executed cron jobs

You can use cron-job.org to regularly call WP’s cron script and make sure it executes reliably. Here’s how to do it:

1. Create an account

Create an account, verify your email address, and login. (You don’t need help with this part!)

2. Create a cronjob

Here are the settings you should use for your new cronjob:

Title: Your Awesome Site!
Address: https://yoursite.com/wp-cron.php?doing_wp_cron 
Schedule: Every 1 minute(s)

 

These are example values. Replace yoursite.com with your site’s domain. 

Once you’ve created the cronjob, you are done. Cron jobs should execute properly. 

Note: Some hosts might improperly detect the once-every-sixty-seconds page load as a threat. You can ensure that this isn’t a problem by asking your host to whitelist these IPs:

  • 195.201.26.157
  • 116.203.134.67
  • 116.203.129.16
  • 23.88.105.37

Option 2: Use cpanel (Difficulty: Medium)

If your host uses cpanel, you can add scheduled tasks right from your hosting control panel. 

Here is how you can do it:

Set up a Cron job in cPanel: Log in to your cPanel account and look for the Cron jobs tool. This tool is often found in the “Advanced” section. After you open the tool, follow these steps:

  • In the “Common Settings” dropdown, select Every Minute (* * * * *).
  • In the command field, you need to add the command that will run the wp-cron.php file. The command should look like this:
    /usr/local/bin/php /path/to/public_html/wp-cron.php >/dev/null 2>&1
  • After you’ve added the command, click on the Add New Cron Job button. The cron job is now set up and will run the wp-cron.php file every minute.

Please note that the PHP cli command might not work on all servers. If it doesn’t work on your server, you can try using one of the following commands:

  • For servers with wget installed:
    wget -q -O – http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
  • For servers that have curl installed:
    curl http://yourwebsite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Replace `yourwebsite.com` with your actual website URL!

This setup will reduce the load on your server and ensure that scheduled tasks are run on time, even if your website doesn’t receive much traffic.

Option 3: The best option: Use a real cron job with WP CLI (Difficulty: Hardest)

To set up WP Cron using WP CLI and the system’s crontab, you’ll first need to ensure that WP CLI is installed on your server. WP CLI is a command line interface for WordPress that allows you to manage your site from the command line. Installing WP CLI is outside of the scope of this document – check with your hosting provider.

Here are the steps to do it:

Configure Cron using WP CLI and crontab

  1. SSH into your server
  2. Open your crontab for editing. You can do this by executing the following command in your terminal:
    crontab -e

    This will open your crontab file in your default text editor.

    Note: This is the user you are using to SSH into the server’s crontab file. It can only do things your user can do.

  3. Next, you need to add a new line to your crontab that tells it to run WP CLI’s cron event runner. This line should look something like this:
    * * * * * cd /path/to/your/wordpress/install && wp cron event run –due-now >/dev/null 2>&1

    Replace `/path/to/your/wordpress/install` with the actual directory path of your WordPress installation.

  4. This line tells the system to:

    • Navigate to your WordPress directory (cd /path/to/your/wordpress/install)
    • Run the WP CLI command (wp cron event run –due-now)
    • Run this command every minute (* * * * * is crontab syntax for “run this command every minute”)
    • Discard any output from the command (>/dev/null 2>&1)
  • Save your changes and exit the text editor to save the crontab.

Now, your server will run any due WordPress cron events every minute. This is a more reliable method than the default WordPress cron, especially for sites that don’t receive a lot of traffic.

The post How To Ensure Your WordPress Cron Is Working Properly appeared first on CheckoutWC.

]]>
How To Disable CheckoutWC Templates for WordPress User Role https://www.checkoutwc.com/documentation/how-to-disable-checkoutwc-templates-for-wordpress-user-role/ Mon, 08 Aug 2022 21:02:52 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=85346 To disable CheckoutWC templates for a particular user role, you can use this snippet of code: To find the right role name, go to WP Admin > Users and click on the role you want to exclude.  Then check the page URL for the role name. Example URL: https://yourstore.test/wp-admin/users.php?role=wholesale For this example, you would change […]

The post How To Disable CheckoutWC Templates for WordPress User Role appeared first on CheckoutWC.

]]>
To disable CheckoutWC templates for a particular user role, you can use this snippet of code:

To find the right role name, go to WP Admin > Users and click on the role you want to exclude. 

Then check the page URL for the role name. Example URL:

https://yourstore.test/wp-admin/users.php?role=wholesale

For this example, you would change the value of $role_to_disable to ‘wholesale’;

The post How To Disable CheckoutWC Templates for WordPress User Role appeared first on CheckoutWC.

]]>
How To Configure Payment Plugins for PayPal WooCommerce To Work With Express Checkout https://www.checkoutwc.com/documentation/how-to-configure-payment-plugins-paypal-for-woocommerce-for-express-checkout/ Wed, 13 Jul 2022 17:32:07 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=83337 Payment Plugins for PayPal WooCommerce is our preferred PayPal gateway. We’ve worked with the Payment Plugins team to ensure our customers get the best PayPal experience with CheckoutWC. There are two configuration steps you need to take to ensure maximum compatibility. Configuring Payment Plugins PayPal for WooCommerce for Express Checkout  Enable ‘Express Checkout’ under PayPal Payment […]

The post How To Configure Payment Plugins for PayPal WooCommerce To Work With Express Checkout appeared first on CheckoutWC.

]]>
Payment Plugins for PayPal WooCommerce is our preferred PayPal gateway. We’ve worked with the Payment Plugins team to ensure our customers get the best PayPal experience with CheckoutWC.

There are two configuration steps you need to take to ensure maximum compatibility.

Configuring Payment Plugins PayPal for WooCommerce for Express Checkout 

Enable ‘Express Checkout’ under PayPal Payment Sections

Go to WP Admin > WooCommerce > Settings > Payments > PayPal Gateway and add ‘Express Checkout’ to the PayPal Payment Sections option.

The post How To Configure Payment Plugins for PayPal WooCommerce To Work With Express Checkout appeared first on CheckoutWC.

]]>
How To Add The Product SKU To The Side Cart and Checkout Cart Summary https://www.checkoutwc.com/documentation/how-to-add-the-product-sku-to-the-side-cart-and-checkout-cart-summary/ Thu, 07 Jul 2022 20:46:07 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=81515 This snippet will help you add the product SKU to the side cart and checkout cart summary: To use, add the above code to WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets It will look something like this:

The post How To Add The Product SKU To The Side Cart and Checkout Cart Summary appeared first on CheckoutWC.

]]>
This snippet will help you add the product SKU to the side cart and checkout cart summary:

To use, add the above code to WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets

It will look something like this:

The post How To Add The Product SKU To The Side Cart and Checkout Cart Summary appeared first on CheckoutWC.

]]>
How To Change ‘No shipping methods available’ Text https://www.checkoutwc.com/documentation/how-to-change-no-shipping-methods-available-text/ Sat, 18 Jun 2022 12:28:50 +0000 https://www.checkoutwc.com/?post_type=bonita-doc&p=81358 When the entered address doesn’t match any shipping methods, the cart summary shows an abbreviated message indicating there are no shipping methods available: You can change the ‘No shipping methods available’ in the cart totals area of checkout with this filter: cfw_shipping_total_not_available_text Example of how to use the filter:  You can add this snippet to […]

The post How To Change ‘No shipping methods available’ Text appeared first on CheckoutWC.

]]>
When the entered address doesn’t match any shipping methods, the cart summary shows an abbreviated message indicating there are no shipping methods available:

You can change the ‘No shipping methods available’ in the cart totals area of checkout with this filter:

cfw_shipping_total_not_available_text

Example of how to use the filter: 

You can add this snippet to WP Admin > CheckoutWC > Advanced > Scripts > PHP Snippets and adjust the wording to whatever you prefer.

The post How To Change ‘No shipping methods available’ Text appeared first on CheckoutWC.

]]>