本文整理汇总了PHP中product::get_price方法的典型用法代码示例。如果您正苦于以下问题:PHP product::get_price方法的具体用法?PHP product::get_price怎么用?PHP product::get_price使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类product
的用法示例。
在下文中一共展示了product::get_price方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_total
/**
* Count total of cart
* @return integer amount
*/
public function get_total()
{
$data = self::get_cart();
$total = 0;
foreach ($data as $row) {
$total = $total + product::get_price($row['product']) * $row['quantity'];
}
return $total;
}
示例2: get_total
/**
* Count total of order
* @return integer amount
*/
public function get_total($id)
{
//TODO: Think about too often changing prices
$data = self::get_one_ordered($id);
$total = 0;
foreach ($data as $row) {
$total = $total + product::get_price($row['product']) * $row['quantity'];
}
return $total;
}
示例3: foreach
?>
</th><th class="align_right"><?php
echo Kohana::lang('eshop.total');
?>
</th></tr>
<?php
foreach ($ordered as $row) {
?>
<tr>
<td><? echo product::get_name($row['product']); ?></td>
<td><? echo $row['quantity']; ?></td>
<td class="align_right"><? echo product::get_price($row['product']); ?>,- <?php
echo Kohana::lang('eshop.currency');
?>
</td>
<td class="align_right"><? echo (product::get_price($row['product'])*$row['quantity']); ?>,- <?php
echo Kohana::lang('eshop.currency');
?>
</td>
</tr>
<?php
}
?>
<tr>
<td colspan="3"><?php
echo Kohana::lang('eshop.total');
?>
</td>
<td class="align_right"><?php
echo $total;
?>
示例4: if
<h3><?php echo Kohana::lang('eshop.cart') ?></h3>
<p><?php echo Kohana::lang('eshop.welcome_in_cart'); ?></p>
<?php base::success($success); ?>
<?php echo form::open(NULL,array('class' => 'glForms')) ?>
<table class="cart">
<tr><th><?php echo Kohana::lang('eshop.item'); ?></th><th><?php echo Kohana::lang('eshop.quantity'); ?></th><th class="align_right"><?php echo Kohana::lang('eshop.price_one'); ?></th><th class="align_right"><?php echo Kohana::lang('eshop.total'); ?></th></tr>
<?php if(count($cart) == 0){?><tr><td colspan="4"><? echo Kohana::lang('eshop.cart_is_empty'); ?></td></tr><? } ?>
<?php foreach($cart as $row){ ?>
<tr>
<td><? echo product::get_name($row['product']); ?></td>
<td><? echo form::input('quantity['.$row['product'].']', ($row['quantity']),'size="3" maxsize="3"'); ?></td>
<td class="align_right"><? echo product::get_price($row['product']); ?>,- <?php echo Kohana::lang('eshop.currency'); ?></td>
<td class="align_right"><? echo (product::get_price($row['product'])*$row['quantity']); ?>,- <?php echo Kohana::lang('eshop.currency'); ?></td>
</tr>
<?php } ?>
<tr>
<td colspan="3"><?php echo Kohana::lang('eshop.total'); ?></td>
<td class="align_right"><?php echo $total; ?>,- <?php echo Kohana::lang('eshop.currency'); ?></td>
</tr>
</table>
<div class="cart_buttons">
<?php echo form::submit('change', Kohana::lang('eshop.change_quantity'),'class=button'); ?>
<?php echo form::submit('empty', Kohana::lang('eshop.empty_cart'),'class=button'); ?>
<?php echo form::submit('checkout', Kohana::lang('eshop.checkout'),'class=button'); ?>
</div>
<?php echo form::close(); ?>
<h4><?php echo Kohana::lang('eshop.cart_help') ?></h4>