Sending an SMS on new order placed – WooCommerce
Please try the woocommerce_checkout_order_processed or woocommerce_new_order
Please try the woocommerce_checkout_order_processed or woocommerce_new_order
if you can print your array why cant’ you just do a loop on this array and adding each line into your output_content. It will look like this <?php $myArray = Array ( 0 => Array ( 0 => “Color”, 1 => “Black”, ), 1 => Array ( 0 => “Size”, 1 => “M”, ), … Read more
The notes to translators aren’t required, as far as I can tell, but they will definitely help anyone out who’s trying to translate your plugin. You might want to think of them as best practices rather than requirements. As to your second question: Since WordPress 4.6 translations now take translate.wordpress.org as priority and so plugins … Read more
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
Nevermind, the last option was actually working, but in my own CSS code I found that I was overriding it. I cleaned up my CSS and it’s working with the function I posted above. I also found an alternative method using wp_add_inline_style() which got me to look at my CSS code in more depth. Example … Read more
There are multiple ways to make the slider dynamic. If you use the Gutenberg editor, you can add new style to the Gallery like this: register_block_style( ‘core/gallery’, [ ‘name’ => ‘swiper’, ‘label’ => __( ‘Swiper Slider’ ), ] ); Then create gallery and choose the Swiper style. It will add an extra class is-style-swiper to … Read more
It was a caching problem with composer. I retroactively changed my composer.json, so I had to open my terminal and run composer dumpautoload to correct the cache.
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
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
The function that you would want to use is sanitize_text_field() which among other things, strips all HTML tags, and remove line breaks, tabs and extra white space. // This worked fine for me – I got /directory/subdirectory/ $value = sanitize_text_field( ‘/directory/subdirectory/’ ); // And so does this one – I got /thisfile.min.js $value = sanitize_text_field( … Read more