• Resolved Mathias Philippe

    (@mphilippe)


    Hi all,

    I modified the plugin for use with product bundles, in case you want to use shipping per item, I did a quick fix as all my items have the same flat rate, in case someone needs this too.

    In the main file, find
    $final_rate_items+=floatval($final_rate)*floatval($values['quantity']);

    And replace it with:

    $wa_qty = floatval($values['quantity']);
    if (get_class($_product) == 'WC_Product_Bundle') {
    	$wa_bundles = $_product->get_bundled_items();
    	if (is_array($wa_bundles) && count($wa_bundles) > 0) {
    		foreach ($wa_bundles as $wa_i) {
    			$wa_qty = $wa_qty * (float)$wa_i->get_quantity();
    		}
    	}
    }
    $final_rate_items += floatval($final_rate) * $wa_qty;

    https://www.ads-software.com/plugins/flat-rate-per-countryregion-for-woocommerce/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘For use with Woocommerce Product Bundles’ is closed to new replies.