本文整理汇总了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();
}