Example #1
0
             $Gfilter->AddAllowedPostalArea($allowed_restriction_country[$state_key][1]);
         }
     }
 } else {
     switch ($type) {
         case 'domestic_types':
             if ('US' == $shipping_origin_iso_code_2) {
                 $Gfilter->SetAllowedCountryArea('ALL');
             } else {
                 $Gfilter->AddAllowedPostalArea($shipping_origin_iso_code_2);
             }
             break;
         case 'international_types':
             $Gfilter->SetAllowedWorldArea(true);
             if ('US' == SHIPPING_ORIGIN_COUNTRY) {
                 $Gfilter->SetExcludedCountryArea('ALL');
             } else {
                 $Gfilter->AddExcludedPostalArea($shipping_origin_iso_code_2);
             }
             break;
         default:
             // should never reach here!
             $Gfilter->SetAllowedWorldArea(true);
             break;
     }
 }
 if ($ship_calculation_mode == 'True') {
     if ($default_value != 0) {
         $Gshipping = new GoogleMerchantCalculatedShipping($shipping_name, $shipping_price);
         $Gshipping->AddShippingRestrictions($Gfilter);
         $Gshipping->AddAddressFilters($Gfilter);