本文整理汇总了PHP中OrderInvoice::getCarrier方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderInvoice::getCarrier方法的具体用法?PHP OrderInvoice::getCarrier怎么用?PHP OrderInvoice::getCarrier使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderInvoice
的用法示例。
在下文中一共展示了OrderInvoice::getCarrier方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setShippingCost
/**
* Set the additional shipping information
*
* @param Order $order
* @param $product
*/
public function setShippingCost(Order $order, $product)
{
$tax_rate = 0;
$carrier = OrderInvoice::getCarrier((int) $this->id_order_invoice);
if (isset($carrier) && Validate::isLoadedObject($carrier)) {
$tax_rate = $carrier->getTaxesRate(new Address((int) $order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));
}
$this->total_shipping_price_tax_excl = (double) $product['additional_shipping_cost'];
$this->total_shipping_price_tax_incl = (double) ($this->total_shipping_price_tax_excl * (1 + $tax_rate / 100));
$this->total_shipping_price_tax_incl = Tools::ps_round($this->total_shipping_price_tax_incl, 2);
}