In Woocommerce, I’m attempting to add a piece of custom meta to my products and I would like to pass it through to orders. We have a substantial amount of products and they are accountable to different cost centers so I need a select box inside the product admin that we can choice the cost centers that …
Tag: wordpress
WordPress: how to hook get_the_post_thumbnail_url() function
I’m new to WordPress. What I am trying to do is to hook the get_the_post_thumbnail_url() and return slightly different URL. I know that I can use WP add_action() for hooking. If I write my function …
Custom remove cart item functionality in Woocommerce
I have the add item function set-up, which looks like this:
Disable specific payment methods for specific shipping zones when cart subtotal reach a specific amount in Woocommerce
In Woocommerce, I’m trying to remove “Cash on delivery” payment method when cart subtotal is up to $250 for specific shipping zones names (Zone 1, Zone 4 and Zone 7). All others zones must not have …
Make US first in Woocommerce checkout countries select field
I already have US selected as my default country in the woocommerce checkout. In addition to that, I was asked to move ‘US’ to the very top of the country list in the checkout form. I created a new …
How to filter an object array in php by value of a parameter?
I’m new to php and I’m trying to filter an array of fields so that it only contains fields that have required property. In javascript I would do it simply by: fields.filter(field => field….
Passing the previous page title to a custom checkout field in Woocommerce
With Woocommerce, is it possible to pass the previous page title to a custom checkout fields?
How to disable Gutenberg / block editor for certain post types?
WordPress added Gutenberg / block editor in its 5th version and it’s enabled by default for Post and Page post types. It might be enabled by default for all custom post types in close future so as a WordPress developer I want to know how to disable this editor for my own custom post types? I want to kee…
Additional field on checkout for specific payment gateway in Woocommerce
I have a custom Woocommerce payment gateway and I need to add additional field on the checkout when the payment is selected. Basically, when the users click the custom payment gateway a “select” field should appear and they have to choose something from the select field. I have attached a screensh…
Remove some payment gateways if any coupon code is applied in Woocommerce
I started to work on small Woocommerce project. I have 3 payment gateways into this store: Paypal, Credit Card and Direct bank Transfer. What I would like is: If coupon code is used, I would like to disable (or remove) Paypal and Credit Card from available payment gateways, and just keep “Direct bank Tr…