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