本文整理汇总了PHP中unknown_type::getshipping_method方法的典型用法代码示例。如果您正苦于以下问题:PHP unknown_type::getshipping_method方法的具体用法?PHP unknown_type::getshipping_method怎么用?PHP unknown_type::getshipping_method使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类unknown_type
的用法示例。
在下文中一共展示了unknown_type::getshipping_method方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isOrderShippingMethodMatches
/**
*
*
* @param unknown_type $order
*/
public function isOrderShippingMethodMatches($order)
{
$shippingMethod = $order->getshipping_method();
$pos = strpos($shippingMethod, $this->getct_shipping_method());
if ($pos === false) {
return false;
} else {
return true;
}
}
示例2: setDeliveryInformation
/**
* Set delivery information
*
* @param unknown_type $order
*/
public function setDeliveryInformation($order, $quoteMode = false)
{
$deliveryDateTimeStamp = null;
$maxDateTimestamp = null;
$deliveryComments = null;
//if no shipping date, do not compute
$shippingDate = $this->getShippingDate();
$shippingDateTimestamp = strtotime($shippingDate);
if ($shippingDate == null) {
$this->setpsop_delivery_date(null);
$this->setpsop_delivery_date_max(null);
$this->setpsop_delivery_comments('');
return $this;
}
//define shipping date
if (!$quoteMode) {
$carrier = $order->getshipping_method();
} else {
$carrier = $order->getShippingAddress()->getShippingMethod();
}
$country = '';
if ($order->getShippingAddress() != null) {
$country = $order->getShippingAddress()->getcountry();
}
$shippingDelay = mage::helper('purchase/ShippingDelay')->getShippingDelayForCarrier($carrier, $country);
$deliveryDateTimeStamp = $shippingDateTimestamp + $shippingDelay * 3600 * 24;
$deliveryComments .= 'add ' . $shippingDelay . ' days for shipping delay with ' . $carrier . ' to ' . $country . '<br>';
//avoid holy day (if set)
if (Mage::getStoreConfig('planning/delivery/avoid_holy_days') == 1) {
$daysToAdd = $this->DaysUntilNotHolyDay($deliveryDateTimeStamp);
if ($daysToAdd > 0) {
$deliveryDateTimeStamp += 3600 * 24 * $daysToAdd;
$deliveryComments .= 'add ' . $daysToAdd . ' days to avoid holy day<br>';
}
}
//add security (max date)
$mode = Mage::getStoreConfig('planning/shipping/maxdate_calculation_mode');
$value = Mage::getStoreConfig('planning/shipping/maxdate_calculation_value');
$diff = $deliveryDateTimeStamp - $shippingDateTimestamp;
$newDiff = 0;
if ($value > 0) {
switch ($mode) {
case 'days':
$newDiff += $diff + $value * 3600 * 24;
$deliveryComments .= 'add ' . $value . ' days to calculate max date<br>';
break;
case 'percent':
$newDiff += $diff * (1 + $value / 100);
$deliveryComments .= 'add ' . $value . '% to calculate max date<br>';
break;
}
}
$maxDateTimestamp = strtotime($this->getpsop_shipping_date_max()) + $newDiff;
//store values
if ($deliveryDateTimeStamp != null) {
$this->setpsop_delivery_date(date('Y-m-d', $deliveryDateTimeStamp));
$this->setpsop_delivery_date_max(date('Y-m-d', $maxDateTimestamp));
$this->setpsop_delivery_comments($deliveryComments);
}
}
示例3: getTemplateForOrder
/**
* Return matching carrier template for 1 order
*
* @param unknown_type $order
*/
public function getTemplateForOrder($order)
{
$shippingMethod = $order->getshipping_method();
$t = explode('_', $shippingMethod);
return $this->getTemplateForCarrier($t[0]);
}