本文整理汇总了PHP中Shop::getShippingMethod方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::getShippingMethod方法的具体用法?PHP Shop::getShippingMethod怎么用?PHP Shop::getShippingMethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::getShippingMethod方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getPriceTotal
public static function getPriceTotal()
{
$price_total = 0;
$tax_total = 0;
foreach (Shop::getCartContent() as $product) {
$model = Products::model()->findByPk($product['product_id']);
$price_total += $model->getPrice(@$product['Variations'], @$product['amount']);
$tax_total += $model->getTaxRate(@$product['Variations'], @$product['amount']);
}
if ($shipping_method = Shop::getShippingMethod()) {
$price_total += $shipping_method->price;
}
$price_total = Shop::t('Price total: {total}', array('{total}' => Shop::priceFormat($price_total)));
$price_total .= '<br />';
$price_total .= Shop::t('All prices are including VAT: {vat}', array('{vat}' => Shop::priceFormat($tax_total))) . '<br />';
$price_total .= Shop::t('All prices excluding shipping costs') . '<br />';
return $price_total;
}
示例2: array
<div id="shopping-cart">
<div id="shopping-cart-content">
<?php
if ($products) {
echo '<h3>' . CHtml::link(Shop::t('Shopping cart'), array('//shop/shoppingCart/view')) . '</h3>';
echo '<table cellpadding="0" cellspacing="0">';
foreach ($products as $num => $position) {
$model = Products::model()->findByPk($position['product_id']);
printf('<tr>
<td class="cart-left widget_amount_' . $num . '">%s</td>
<td class="cart-middle">%s</td>
<td class="cart-right price_' . $num . '">%s</td></tr>', $position['amount'], $model->title, Shop::priceFormat($position['amount'] * $model->getPrice(@$position['Variations'])));
}
if ($shippingMethod = Shop::getShippingMethod()) {
printf('<tr>
<td class="cart-left">1</td>
<td class="cart-middle">%s</td>
<td class="cart-right">%s</td></tr>', Shop::t('Shipping costs'), Shop::priceFormat($shippingMethod->price));
}
printf('<tr>
<td colspan="3" class="cart-right cart-sum price_total"><strong>%s</strong></td>
</tr>', Shop::getPriceTotal());
echo '</table>';
}
?>
</div>
<div id="shopping-cart-footer"></div>
</div>
示例3: actionGetShippingCosts
public function actionGetShippingCosts()
{
echo Shop::getShippingMethod(true);
}