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


PHP CitruscartHelperBase::number方法代码示例

本文整理汇总了PHP中CitruscartHelperBase::number方法的典型用法代码示例。如果您正苦于以下问题:PHP CitruscartHelperBase::number方法的具体用法?PHP CitruscartHelperBase::number怎么用?PHP CitruscartHelperBase::number使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CitruscartHelperBase的用法示例。


在下文中一共展示了CitruscartHelperBase::number方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _processSale

 /**
  * Processes the sale payment
  *
  * @param  array   $data IPN data
  * @return boolean Did the IPN Validate?
  * @access protected
  */
 public function _processSale($data, $ipnValidationFailed = '')
 {
     /*
      * validate the payment data
      */
     $errors = array();
     if (!empty($ipnValidationFailed)) {
         $errors[] = $ipnValidationFailed;
     }
     // is the recipient correct?
     if (empty($data['receiver_email']) || $data['receiver_email'] != $this->_getParam('merchant_email')) {
         $errors[] = JText::_('PAYPAL MESSAGE RECEIVER INVALID');
     }
     if (empty($data['custom'])) {
         $errors[] = JText::_('PAYPAL MESSAGE INVALID ORDERPAYMENTID');
         return count($errors) ? implode("\n", $errors) : '';
     }
     // load the orderpayment record and set some values
     JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_citruscart/tables');
     $orderpayment = JTable::getInstance('OrderPayments', 'CitruscartTable');
     $orderpayment->load($data['custom']);
     if (empty($data['custom']) || empty($orderpayment->orderpayment_id)) {
         $errors[] = JText::_('PAYPAL MESSAGE INVALID ORDERPAYMENTID');
         return count($errors) ? implode("\n", $errors) : '';
     }
     $orderpayment->transaction_details = $data['transaction_details'];
     $orderpayment->transaction_id = $data['txn_id'];
     $orderpayment->transaction_status = $data['payment_status'];
     // check the stored amount against the payment amount
     Citruscart::load('CitruscartHelperBase', 'helpers._base');
     $stored_amount = CitruscartHelperBase::number($orderpayment->get('orderpayment_amount'), array('thousands' => ''));
     $respond_amount = CitruscartHelperBase::number($data['mc_gross'], array('thousands' => ''));
     if ($stored_amount != $respond_amount) {
         $errors[] = JText::_('PAYPAL MESSAGE AMOUNT INVALID');
         $errors[] = $stored_amount . " != " . $respond_amount;
     }
     // check the payment status
     if (empty($data['payment_status']) || $data['payment_status'] != 'Completed' && $data['payment_status'] != 'Pending') {
         $errors[] = JText::sprintf('PAYPAL MESSAGE STATUS INVALID', $data['payment_status']);
     }
     // set the order's new status and update quantities if necessary
     Citruscart::load('CitruscartHelperOrder', 'helpers.order');
     Citruscart::load('CitruscartHelperCarts', 'helpers.carts');
     $order = JTable::getInstance('Orders', 'CitruscartTable');
     $order->load($orderpayment->order_id);
     if (count($errors)) {
         // if an error occurred
         $order->order_state_id = $this->params->get('failed_order_state', '10');
         // FAILED
     } elseif ($data['payment_status'] == 'Pending') {
         // if the transaction has the "pending" status,
         $order->order_state_id = Citruscart::getInstance('pending_order_state', '1');
         // PENDING
         // Update quantities for echeck payments
         CitruscartHelperOrder::updateProductQuantities($orderpayment->order_id, '-');
         // remove items from cart
         CitruscartHelperCarts::removeOrderItems($orderpayment->order_id);
         // send email
         $send_email = true;
     } else {
         $order->order_state_id = $this->params->get('payment_received_order_state', '17');
         // PAYMENT RECEIVED
         // do post payment actions
         $setOrderPaymentReceived = true;
         // send email
         $send_email = true;
     }
     // save the order
     if (!$order->save()) {
         $errors[] = $order->getError();
     }
     // save the orderpayment
     if (!$orderpayment->save()) {
         $errors[] = $orderpayment->getError();
     }
     if (!empty($setOrderPaymentReceived)) {
         $this->setOrderPaymentReceived($orderpayment->order_id);
     }
     if ($send_email) {
         // send notice of new order
         Citruscart::load("CitruscartHelperBase", 'helpers._base');
         $helper = CitruscartHelperBase::getInstance('Email');
         $model = Citruscart::getClass("CitruscartModelOrders", "models.orders");
         $model->setId($orderpayment->order_id);
         $order = $model->getItem();
         $helper->sendEmailNotices($order, 'new_order');
     }
     return count($errors) ? implode("\n", $errors) : '';
 }
开发者ID:joomlacorner,项目名称:citruscart,代码行数:96,代码来源:payment_paypal.php

示例2:

</label></td>
</tr>
<tr>
    <th><a href="<?php 
echo $stats->link;
?>
"><?php 
echo JText::_('COM_CITRUSCART_LIFETIME_SALES');
?>
</a></th>
    <td style="text-align: right;"><?php 
echo CitruscartHelperBase::number($stats->lifetime->num, $options_int);
?>
</td>
	<td style="text-align: right;"><?php 
echo CitruscartHelperBase::number($stats->lifetime->average_daily, $options_decimal);
?>
</td>
	<td style="text-align: right;"><label class="label label-warning"><?php 
echo CitruscartHelperBase::currency($stats->lifetime->average, '', $options_decimal);
?>
</label></td>
    <td style="text-align: right;"><label class="label label-success"><?php 
echo CitruscartHelperBase::currency($stats->lifetime->amount, '', $options_decimal);
?>
</label></td>
</tr>

</tbody>
</table>
开发者ID:joomlacorner,项目名称:citruscart,代码行数:30,代码来源:default.php

示例3: array

    echo CitruscartSelect::range($state->stats_interval, 'stats_interval', $attribs, null, true);
    ?>
</h3></td>
				<?php 
}
?>
				<td class="dashboard_profits_data float-shadow"><h1><?php 
echo CitruscartHelperBase::currency($this->sum);
?>
</h1></td>
				<td class="dashboard_profits_data float-shadow"><h1><?php 
echo CitruscartHelperBase::number($this->total, array('num_decimals' => '0'));
?>
</h1></td>
			    <td class="dashboard_profits_data"><h1><?php 
echo CitruscartHelperBase::number($this->orderedItems, array('num_decimals' => '0'));
?>
</h1></td>
			    
			</tr>
			</tbody>
			</table>
            <div class="section">
                <?php 
require_once JPATH_SITE . '/libraries/dioscouri/highroller/highroller/highroller.php';
$chart = new HighRoller();
$chart->chart->renderTo = 'chart';
$chart->chart->type = 'mixed';
$chart->plotOptions = new stdClass();
$chart->plotOptions->column = new stdClass();
$chart->plotOptions->column->pointStart = strtotime($this->revenue[0][0]) * 1000;
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:default.php

示例4: foreach

        ?>
'>
            <?php 
        $i = 1;
        foreach ($vars->orderitems as $item) {
            //TODO
            /* CitruscartHelperBase::number( @$item->orderitem_final_price / @$item->orderitem_quantity, array( 'thousands' =>'', 'decimal'=> '.' ) );
             * CitruscartHelperBase::number( @$item->orderitem_price + @$item->orderitem_attributes_price, array( 'thousands' =>'', 'decimal'=> '.' ) );
             *  THis doesn't work because it doesn't take into account pricing discounts from coupons
             * */
            ?>
              <input type='hidden' name='amount_<?php 
            echo $i;
            ?>
' value='<?php 
            echo CitruscartHelperBase::number($item->orderitem_final_price / $item->orderitem_quantity, array('thousands' => '', 'decimal' => '.'));
            ?>
'>
                <input type='hidden' name='item_name_<?php 
            echo $i;
            ?>
' value='<?php 
            echo $item->_description;
            ?>
'>
                <input type='hidden' name='item_number_<?php 
            echo $i;
            ?>
' value='<?php 
            echo $item->product_id;
            ?>
开发者ID:joomlacorner,项目名称:citruscart,代码行数:31,代码来源:prepayment.php


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