Woocommerce Shop Manager Capabilities

Issue is related to Order Delivery Date for WooCommerce. function orddd_lite_capabilities() { $role = get_role( ‘shop_manager’ ); if( ” != $role ) { $role->add_cap( ‘manage_options’ ); } } Comment out the line //add_action( ‘admin_init’, array( &$this, ‘orddd_lite_capabilities’ ));

populating extra field with woocommerce categories

ok, solution: $args = array( ‘order’ => ‘ASC’, ‘hide_empty’ => $hide_empty, ‘include’ => $ids, ‘posts_per_page’ =>’-1′ ); $product_categories = get_terms( ‘product_cat’, $args ); (isset($_POST[“Cianfrusaglie”])) ? $company = $_POST[“Cianfrusaglie”] : $company=1; echo “<select name=”cat_shop” id=’reg_cat_shop’ class=”dokan-form-control input-md valid”>”; foreach( $product_categories as $category ){ echo “<option “; ?><?php if ($cat_shop == esc_html( $category->name ) ) echo ‘selected’ … Read more

Correct method of reducing the number of images created by WP and Woo together

I would remove the image sizes that you don’t need. function remove_image_sizes() { remove_image_size(‘image-name’); } add_action(‘init’, ‘remove_image_sizes’, 99); Whilst the number of images is a factor, I’d also look at the image compression as this may be a big help in reducing the disk space required: add_filter(‘jpeg_quality’, function($arg){return 70;}); You will need to re-generate your … Read more

Updating WooCommerce product field when product author updates profile field

So combined with that code for setting the value before it’s inserted in the db, you also need to add this code to add the post ID to an array stored in the user’s meta (after it has been updated): add_action( ‘wp_insert_post’, ‘smyles_update_user_products’, 10, 3 ); function smyles_update_user_products( $post_ID, $post, $update ) { if ( … Read more