本文整理匯總了PHP中OrderInvoice::getCarrierId方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderInvoice::getCarrierId方法的具體用法?PHP OrderInvoice::getCarrierId怎麽用?PHP OrderInvoice::getCarrierId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類OrderInvoice
的用法示例。
在下文中一共展示了OrderInvoice::getCarrierId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getCarrier
/**
* @since 1.5
* @param $id_order_invoice
*/
public static function getCarrier($id_order_invoice)
{
$carrier = false;
if ($id_carrier = OrderInvoice::getCarrierId($id_order_invoice)) {
$carrier = new Carrier((int) $id_carrier);
}
return $carrier;
}
示例2: hookDisplayPDFInvoice
/**
* Displays the delivery dates on the invoice
*
* @param $params contains an instance of OrderInvoice
* @return string
*
*/
public function hookDisplayPDFInvoice($params)
{
$order_invoice = $params['object'];
if (!$order_invoice instanceof OrderInvoice) {
return;
}
$order = new Order((int) $order_invoice->id_order);
$oos = false;
// For out of stock management
foreach ($order->getProducts() as $product) {
if ($product['product_quantity_in_stock'] < 1) {
$oos = true;
}
}
$id_carrier = (int) OrderInvoice::getCarrierId($order_invoice->id);
$return = '';
if ($datesDelivery = $this->_getDatesOfDelivery($id_carrier, $oos, $order_invoice->date_add)) {
$return = sprintf($this->l('Approximate date of delivery is between %1$s and %2$s'), $datesDelivery[0], $datesDelivery[1]);
}
return $return;
}