WP SITES

2948 Tutorials & 189 Plugins

Toggle Specific Payment Options Based on Product Category WooCommerce

$35.00
Watch Demo

This code enables you to show or hide payments options on the checkout page based on what category the product(s) are assigned to. In this case, we hide the COD payment option if the product is in category 1.

Code Settings

  • Line 17 swap out your product category slug
  • Line 33 swap out your payment gateway ID

Installation

Copy the PHP code to the end of your child themes functions file or custom functionality/code snippets plugin.

These solutions may also help :