本文整理匯總了PHP中State::getIdZone方法的典型用法代碼示例。如果您正苦於以下問題:PHP State::getIdZone方法的具體用法?PHP State::getIdZone怎麽用?PHP State::getIdZone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類State
的用法示例。
在下文中一共展示了State::getIdZone方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCarriersListByIdZone
public function getCarriersListByIdZone($id_country, $id_state = 0, $zipcode = 0)
{
// cookie saving/updating
$this->context->cookie->id_country = $id_country;
if ($id_state != 0) {
$this->context->cookie->id_state = $id_state;
}
if ($zipcode != 0) {
$this->context->cookie->postcode = $zipcode;
}
$id_zone = 0;
if ($id_state != 0) {
$id_zone = State::getIdZone($id_state);
}
if (!$id_zone) {
$id_zone = Country::getIdZone($id_country);
}
$carriers = CarrierCompare::getCarriersByCountry($id_country, $id_state, $zipcode, $this->context->cart, $this->context->customer->id);
return sizeof($carriers) ? $carriers : array();
}
示例2: getCarriersListByIdZone
public function getCarriersListByIdZone($id_country, $id_state = 0)
{
global $cart, $smarty;
$id_zone = 0;
if ($id_state != 0) {
$id_zone = State::getIdZone($id_state);
}
if (!$id_zone) {
$id_zone = Country::getIdZone($id_country);
}
$carriers = Carrier::getCarriersForOrder((int) $id_zone);
return sizeof($carriers) ? $carriers : array();
}
示例3: getCarriersListByIdZone
public function getCarriersListByIdZone($id_country, $id_state = 0, $zipcode = 0)
{
global $cart, $smarty, $cookie;
// cookie saving/updating
$cookie->id_country = $id_country;
if ($id_state != 0) {
$cookie->id_state = $id_state;
}
if ($zipcode != 0) {
$cookie->postcode = $zipcode;
}
$id_zone = 0;
if ($id_state != 0) {
$id_zone = State::getIdZone($id_state);
}
if (!$id_zone) {
$id_zone = Country::getIdZone($id_country);
}
$carriers = Carrier::getCarriersForOrder((int) $id_zone);
return sizeof($carriers) ? $carriers : array();
}
示例4: getCarriersListByIdZone
public function getCarriersListByIdZone($id_country, $id_state = 0, $zipcode = 0)
{
// cookie saving/updating
$this->context->cookie->id_country = $id_country;
if ($id_state != 0) {
$this->context->cookie->id_state = $id_state;
}
if ($zipcode != 0) {
$this->context->cookie->postcode = $zipcode;
}
$id_zone = 0;
if ($id_state != 0) {
$id_zone = State::getIdZone($id_state);
}
if (!$id_zone) {
$id_zone = Country::getIdZone($id_country);
}
// Need to set the infos for carrier module !
$this->context->cookie->id_country = $id_country;
$this->context->cookie->id_state = $id_state;
$this->context->cookie->postcode = $zipcode;
$carriers = Carrier::getCarriersForOrder((int) $id_zone);
return sizeof($carriers) ? $carriers : array();
}
示例5: getCarriersListByIdZone
public function getCarriersListByIdZone($id_country, $id_state = 0, $zipcode = 0)
{
global $cart, $smarty, $cookie;
// cookie saving/updating
$cookie->id_country = $id_country;
if ($id_state != 0) {
$cookie->id_state = $id_state;
}
if ($zipcode !== 0) {
$cookie->postcode = $zipcode;
}
$id_zone = 0;
if ($id_state != 0) {
$id_zone = State::getIdZone($id_state);
}
if (!$id_zone) {
$id_zone = Country::getIdZone($id_country);
}
// Need to set the infos for carrier module !
$cookie->id_country = $id_country;
$cookie->id_state = $id_state;
$cookie->postcode = $zipcode;
$carriers = array();
if ($this->addAddress($id_country, $zipcode)) {
// Back up the current id_address_delivery
$current_id_address_delivery = $cart->id_address_delivery;
// Get the new one created
$cart->id_address_delivery = Configuration::get(CarrierCompare::VIRTUAL_ADDRESS);
$cart->id_customer = Configuration::get(CarrierCompare::VIRTUAL_CUSTOMER);
// Get carriers with good id_zone
$carriers = Carrier::getCarriersForOrder((int) $id_zone);
// Delete Address and restore id_address_delivery
$address = new Address((int) Configuration::get(CarrierCompare::VIRTUAL_ADDRESS));
$address->delete();
$cart->id_address_delivery = $current_id_address_delivery;
}
return count($carriers) ? $carriers : array();
}