Create programmatically a product using CRUD methods in Woocommerce 3

You are not accessing the WC_Product_simple instance object from your custom Dropship Data Scraper plugin. The guilty can be mostly 2 things: You have not installed Woocommerce. The plugin Dropship Data Scraper is outdated and needs changes, to handle woocommerce. Try to include the global Woocommerce object and to enable Woocommerce support in your plugin. … Read more

Exclude a folder/directory from RewriteRule

You may try replacing the complete WP rule-set with this one: # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ – [L] # Include in the next line all folders to exclude RewriteCond %{REQUEST_URI} !(folder1|folder2|folder3) [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress

WordPress paginate_links – how to use it?

Pagination Like : Prev 1 2 3 Next <?php $paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1; $data= new WP_Query(array( ‘post_type’=>’YOUR_POST_TYPE’, // your post type name ‘posts_per_page’ => 3, // post per page ‘paged’ => $paged, )); if($data->have_posts()) : while($data->have_posts()) : $data->the_post(); // Your code endwhile; $total_pages = $data->max_num_pages; if ($total_pages > 1){ $current_page = max(1, … Read more

How to fetch a wordpress admin page using google apps script?

There might be an issue with Google Apps Scripts and post-ing to a URL that gives you back a redirection header. It seems like it might not be possible to follow the redirect with a post – here’s a discussion on the issue – https://issuetracker.google.com/issues/36754794 Would it be possible, if you modify your code to … Read more

GET a coupon code via URL and apply it in WooCommerce Checkout page [closed]

Update 3: This can be done in a very simple way with the following 2 hooked functions: The first one will catch the coupon code in the Url and will set it in WC_Sessions. The second one will apply the coupon code from session in checkout page. Here is this code: add_action(‘init’, ‘get_custom_coupon_code_to_session’); function get_custom_coupon_code_to_session(){ … Read more

Change WooCommerce default password security level

The only existing hook setting for that is woocommerce_min_password_strength filter hook. So you can set a custom hook function and lowering this strenght. There is 4 possible settings: 3 => Strong (default) 2 => Medium 1 => Weak 0 => Very Weak (anything). Here is that code: add_filter( ‘woocommerce_min_password_strength’, ‘reduce_min_strength_password_requirement’ ); function reduce_min_strength_password_requirement( $strength ) … Read more