How to add Woocomrce cart page shipping calculator to my country state list

Add this snippet to the functions.php file of your theme to add a new country to the WooCommerce countries list. add_filter(‘woocommerce_states’, ‘sa_woocommerce_states’); add_filter(‘woocommerce_countries_allowed_country_states’,’sa_woocommerce_state’); function SA_woocommerce_states( $states ) { $states[‘ZA’][‘EC’] = __(‘Eastern Cape’, ‘woocommerce’); return $states; }

How to remove “out of stock” variation options from size dropdown in woocommerce?

Initially. It should be said that WooCommerce is considered a plugin and therefore your question could probably be flagged as ‘Off-topic’. This (however) is such a bullshit and self-deprecating for this StackExchange, so I’ll answer it anyway. 🙂 But next time you have a WooCommerce-question, you should ask it on StackOverflow (apparantly). My first thought … Read more

Optimizing Woocommerce order items query

I’m doing something similar. I started off with an approach similar to yours, but made it slightly faster by directly using WC API Query instead of WP Query. I am still looking for a way to query the variation from all orders… //get number of orders per variation_id function getOrdersfromVariation($variation_id){ $numberOfOrders = 0; ip_write_log(“getOrdersfromVariation varid: … Read more

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