当前位置: 首页>>代码示例>>PHP>>正文


PHP Shop::getShippingMethod方法代码示例

本文整理汇总了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;
 }
开发者ID:huynhchanhuy,项目名称:yii_shopping,代码行数:18,代码来源:Shop.php

示例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>
开发者ID:rinodung,项目名称:yii-shop,代码行数:28,代码来源:shopping_cart.php

示例3: actionGetShippingCosts

 public function actionGetShippingCosts()
 {
     echo Shop::getShippingMethod(true);
 }
开发者ID:axetion007,项目名称:yii-shop,代码行数:4,代码来源:ShoppingCartController.php


注:本文中的Shop::getShippingMethod方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。