/** * Returns the default shipping fee for this product * * @param SilvercartCountry $country Country to get fee for * @param Group $customerGroup Group to get fee for * * @return SilvercartShippingFee */ public function getDefaultShippingFee(SilvercartCountry $country = null, $customerGroup = null) { $shippingFee = ''; if (!is_null($country)) { if (is_null($customerGroup)) { $customerGroup = SilvercartCustomer::default_customer_group(); } $shippingFee = SilvercartShippingMethod::getAllowedShippingFeeFor($this, $country, $customerGroup, true); } return $shippingFee; }
/** * Returns the target customer group. * * @param array $formData Submitted form data. * * @return Group */ public function getTargetCustomerGroup($formData) { if (array_key_exists('IsBusinessAccount', $formData) && $formData['IsBusinessAccount'] == '1') { $customerGroup = SilvercartCustomer::default_customer_group_b2b(); } else { $customerGroup = SilvercartCustomer::default_customer_group(); } return $customerGroup; }