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


PHP product::get_price方法代码示例

本文整理汇总了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;
 }
开发者ID:repli2dev,项目名称:re-eshop,代码行数:13,代码来源:cart.php

示例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;
 }
开发者ID:repli2dev,项目名称:re-eshop,代码行数:14,代码来源:order.php

示例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;
?>
开发者ID:repli2dev,项目名称:re-eshop,代码行数:31,代码来源:customer_order.php

示例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'); ?>
&nbsp;</div>
<?php echo form::close(); ?>

<h4><?php echo Kohana::lang('eshop.cart_help') ?></h4>
开发者ID:repli2dev,项目名称:re-eshop,代码行数:31,代码来源:cart_show.php


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