Conditional email recipient based off Shipping Method [closed]

Firstly, get_shipping_method is a function. You seem to be using it as a variable. Secondly $order->get_shipping_method() returns Shipping method label, which you’re trying to compare with id. Now you can either compare Titles, or use $order->get_items( ‘shipping’ ); which returns an array with name, type, method_id, cost and taxes, and use method_id for comparison.

Custom Woocommerce checkout filed yields a Json error when validating [closed]

I figured this out. What fixed it was I needed to use isset in the conditional. old code: if (!$_POST[‘delivery’]){ wc_add_notice( sprintf(__(‘You must accept Additional Shipping Conditions.’, ‘themename’)) ,’error’ ); } if (!$_POST[‘customer’]){ wc_add_notice( sprintf(__(‘You must accept responsibility for address misplacement.’, ‘themename’)) ,’error’ ); } Correct code using isset: if (!isset($_POST[‘delivery’])){ wc_add_notice( sprintf(__(‘You must accept … Read more

Get Third Level Categories WooCommerce

I Solved it by my Self $args = array( ‘hierarchical’ => 1, ‘show_option_none’ => ”, ‘hide_empty’ => 0, ‘parent’ => $number = 16, ‘taxonomy’ => ‘product_cat’ ); $subcats = get_categories($args); echo ‘<div class=”wooc_sclist”>’; foreach ($subcats as $sc) { $link = get_term_link($sc->slug, $sc->taxonomy); echo ‘<ul><a href=”‘ . $link . ‘”>’ . $sc->name . ‘</a>’.$sc->term_id; $args2 = … Read more

How to restrict type/size of file uploads in any plugin?

You use upload_mimes filter to restrict the image type as : add_filter(‘upload_mimes’,’restict_image_type’); function restict_image_type($mimes) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’, ); return $mimes; } For upload limit you can set in .htaccess one of the following; LimitRequestBody 1048576 //( 1MB) php_value upload_max_filesize 1M php_value post_max_size 1M

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)