本文整理汇总了PHP中Shop::getPriceTotal方法的典型用法代码示例。如果您正苦于以下问题:PHP Shop::getPriceTotal方法的具体用法?PHP Shop::getPriceTotal怎么用?PHP Shop::getPriceTotal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shop
的用法示例。
在下文中一共展示了Shop::getPriceTotal方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
Yii::app()->clientScript->registerScript('amount_' . $position, "\r\n\t\t\t\t\t\$('.amount_" . $position . "').keyup(function() {\r\n\t\t\t\t\t\t\$.ajax({\r\n\t\t\t\t\t\t\turl:'" . $this->createUrl('//shop/shoppingCart/updateAmount') . "',\r\n\t\t\t\t\t\t\tdata: \$('#amount_" . $position . "'),\r\n\t\t\t\t\t\t\tsuccess: function(result) {\r\n\t\t\t\t\t\t\t\$('.amount_" . $position . "').css('background-color', 'lightgreen');\r\n\t\t\t\t\t\t\t\$('.widget_amount_" . $position . "').css('background-color', 'lightgreen');\r\n\t\t\t\t\t\t\t\$('.widget_amount_" . $position . "').html(\$('.amount_" . $position . "').val());\r\n\t\t\t\t\t\t\t\$('.price_" . $position . "').html(result);\t\r\n\t\t\t\t\t\t\t\$('.price_total').load('" . $this->createUrl('//shop/shoppingCart/getPriceTotal') . "');\r\n\t\t\t\t\t\t\t\$('.shipping_costs').load('" . $this->createUrl('//shop/shoppingCart/getShippingCosts') . "');\r\n\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\terror: function() {\r\n\t\t\t\t\t\t\t\$('#amount_" . $position . "').css('background-color', 'red');\r\n\t\t\t\t\t\t\t},\r\n\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t\t");
}
}
if ($shippingMethod = Shop::getShippingMethod()) {
printf('<tr>
<td></td>
<td>1</td>
<td>%s</td>
<td></td>
<td class="text-right shipping_costs">%s</td>
<td class="text-right shipping_costs">%s</td>
<td>%s</td></tr>', Shop::t('Shipping costs'), Shop::priceFormat($shippingMethod->getPrice()), Shop::priceFormat($shippingMethod->getPrice()), CHtml::link(Shop::t('edit'), array('//shop/shippingMethod/choose')));
}
echo '<tr>
<td class="text-right no-border" colspan="6">
<p class="price_total">' . Shop::getPriceTotal() . '</p></td>
<td class="no-border"></td></tr>';
echo '</table>';
?>
<?php
if (Yii::app()->controller->id != 'order') {
echo '<div class="buttons">';
echo CHtml::link(Shop::t('Buy additional Products'), array('//shop/products'), array('class' => 'btn-previous'));
echo CHtml::link(Shop::t('Buy this products'), array('//shop/order/create'), array('class' => 'btn-next'));
echo '</div>';
}
?>
<div class="clear"></div>
<?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>
示例3: actionGetPriceTotal
public function actionGetPriceTotal()
{
echo Shop::getPriceTotal();
}