How to alter taxes amounts when updating an order

Well, I succeeded in filtering the output of the totals : add_filter( ‘woocommerce_order_get_tax_totals’, ‘filter_function_name_1942’, 10, 2 ); function filter_function_name_1942( $tax_totals, $order ){ foreach( $tax_totals as $single_tax_key => $single_tax_value ){ if( $single_tax_value->rate_id == 1){ $tax_totals[$single_tax_key]->amount = 1000; $tax_totals[$single_tax_key]->formatted_amount = wc_price(‘1000′); } } return $tax_totals; } It’s just an example with hardcoded values, but it works. The … Read more

How to query posts by month based on date custom field?

It is not clear what you’re using as a comparison, but WP Query supports meta query comparisons and even has a DATE type. For example: $query = new WP_Query( array( ‘post_type’ => ‘attraction’, ‘meta_key’ => ‘attraction_date’, ‘meta_value’ => ’10’, ‘meta_compare’ => ‘LIKE’, ‘type’ => ‘DATE’ ) ); Using 10 is not going to get you … Read more

Sort posts alphabetically by category/custom taxonomy, insert divider between different types

after some trials I’ve got one solution that seems to be good but I need some tweaking help <ul class=”list-ensemble”> <?php $terms = get_terms(“production_co_type”); $count = count($terms); if ( $count > 0 ){ echo “<ul>”; foreach ( $terms as $term ) { echo ‘<li class=”title”>’ . $term->name . ‘</li>’; $args = array ( ‘post-type’=> ‘shows’, … Read more

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