Adding extra cost to woocommerce flat rate based on shipping zone

To adjust the WooCommerce code so it adds an extra specific amount based on the shipping zone, you can modify the existing function to include shipping zone-based costs. Here’s a streamlined version of the code: add_filter( ‘woocommerce_package_rates’, ‘add_cost_based_on_zone_and_quantity’, 10, 2 ); function add_cost_based_on_zone_and_quantity( $rates, $package ) { $shipping_class = “very-light-weight”; // Define the shipping class … Read more

category id (term_id) in url instead of slug

Try this. Here is the full code that you can add to your functions.php file: // Add custom rewrite rules function add_custom_rewrite_rules() { add_rewrite_rule( ‘^category/([0-9]+)/?$’, ‘index.php?term_id=$matches[1]’, ‘top’ ); flush_rewrite_rules(false); // Temporarily set this to true to flush rules, then set back to false } add_action(‘init’, ‘add_custom_rewrite_rules’); // Add term_id to query vars function add_query_vars($vars) { … Read more

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