Can woocommerse be used dynamically for billing from another plugin for payment processing?

It is possible, but you’re going to need a product to log in your orders. You could create a product ‘placeholder’ and then pass variables to the cart before checkout. This way the actual product already exists but everything else in WooCommerce will perform as normal. Orders don’t store a link to the current price … Read more

Plugin language always shows WP site language, not profile language

I found the solution: In the constructor I had to add this public function __construct() { // your code goes here add_action( ‘plugins_loaded’, [$this, ‘load_text_domain’] ); // your code goes here } public function load_text_domain() : void { load_plugin_textdomain(‘your-plugin-textdomain’); } This finally made sure that the language displayed followed the settings of the user profile … Read more

How to make my shortcode load scripts and styles, from within the plugin?

plugins_url expects the second parameter to be the main plugin file, which is why __FILE__ is used in examples, it’s assuming the code is in that file, but yours is not. To fix this, you will need to retrieve __FILE__ in your main plugin file, store it, and pass it to your shortcode objects for … Read more

Using AND and bracket grouping in SQL not working

You need 2 table joins since there are effectively 2 meta keys in your WHERE clause: SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_users.* FROM wp_users INNER JOIN wp_usermeta AS um1 ON (wp_users.ID = um1.user_id) INNER JOIN wp_usermeta AS um2 ON (wp_users.ID = um2.user_id) WHERE (wp_users.user_login LIKE ‘%little%’ OR wp_users.user_email LIKE ‘%little%’ OR wp_users.user_url LIKE ‘%little%’ OR wp_users.display_name LIKE … Read more

How to change WooCommerce loop product title HTML output in single product page and archive page

The main problems with what you’ve got are tha your close bracket } for the is_product() case is in the wrong place: it should be before the elseif not at the bottom of the block. (This is what Tom meant by indenting your code correctly: if you’d indented each {…}, which your IDE will do … Read more

Data not insert and update through ajax and jQuery in admin page?

I see that there’s an internal server error (see screenshot) when you tried to update a record in the database, and the error is likely because you incorrectly called $wpdb->update() which has the syntax of — and note that the first three parameters ($table, $data and $where) are required: wpdb::update( string $table, array $data, array … Read more