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


PHP comquick2cartHelper::appendExtraFieldData方法代码示例

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


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

示例1: foreach

 function updateCop_item($coupon, $cart_item, $called = "cart", $order_id = 0)
 {
     $db = JFactory::getDBO();
     // $cart_item = coupon items;
     foreach ($cart_item as $cart_item_id) {
         if ($called == "cart") {
             // Called from cart
             $Quick2cartModelcart = new Quick2cartModelcart();
             $cartid = $Quick2cartModelcart->getCartId();
             $query = "Select cart_item_id as id ,item_id as item_id, product_final_price as tamt ,product_quantity as qty\n\t\t\t FROM #__kart_cartitems\n\t\t\t WHERE item_id='{$cart_item_id}' AND cart_id =" . $cartid . " order by `store_id`";
         } else {
             // Called from  order
             $query = "Select order_item_id as id , item_id as item_id, product_final_price as tamt ,product_quantity as qty\n\t\t\t FROM #__kart_order_item\n\t\t\t WHERE item_id='{$cart_item_id}' AND order_id =" . $order_id . " order by `store_id`";
         }
         $db->setQuery($query);
         $cartitems = $db->loadAssocList();
         foreach ($cartitems as $item) {
             if ($item['item_id'] == $cart_item_id) {
                 if ($coupon[0]->val_type == 1) {
                     $cval = $coupon[0]->value / 100 * $item['tamt'];
                 } else {
                     $cval = $coupon[0]->value;
                     $cval = $cval * $item['qty'];
                     /*multiply cop disc with qty*/
                 }
                 $camt = $item['tamt'] - $cval;
                 if ($camt <= 0) {
                     $camt = 0;
                 }
                 $dis_totalamt = $camt ? $camt : $item['tamt'];
                 $cart_item = new stdClass();
                 $cart_item->item_id = $cart_item_id;
                 //as id
                 $cart_item->original_price = $item['tamt'];
                 $cart_item->product_final_price = $dis_totalamt;
                 $comquick2cartHelper = new comquick2cartHelper();
                 $db = JFactory::getDBO();
                 if ($called == "cart") {
                     $q = "SELECT  `params` FROM  `#__kart_cartitems` WHERE `cart_item_id` =" . $item['id'];
                     $cart_item->params = $comquick2cartHelper->appendExtraFieldData($coupon[0]->cop_code, $q, 'coupon_code');
                     $cart_item->cart_item_id = $item['id'];
                     $sql = $db->updateObject("#__kart_cartitems", $cart_item, "cart_item_id");
                 } else {
                     $q = "SELECT  `params` FROM  `#__kart_order_item` WHERE `order_item_id` =" . $item['id'];
                     $cart_item->params = $comquick2cartHelper->appendExtraFieldData($coupon[0]->cop_code, $q, 'coupon_code');
                     $cart_item->order_item_id = $item['id'];
                     $sql = $db->updateObject("#__kart_order_item", $cart_item, "order_item_id");
                 }
                 if (!$sql) {
                     echo $this->_db->stderr();
                     return -1;
                 }
             }
         }
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:56,代码来源:cartcheckout.php

示例2: updateOrder

 /**
  * This function update order info. Update mdate,transaction_id. [DOEN'T CHAGE ORDER STATUS HERE]
  *
  * @param   integer  $storeId  store id.
  * @param   array  $pg_plugin  processed plugin name.
  *
  */
 function updateOrder($data, $pg_plugin)
 {
     $db = JFactory::getDBO();
     $res = new stdClass();
     $eoid = $this->extract_prefix($data['order_id']);
     // $eoid means extracted order id
     $res->id = $eoid;
     $res->mdate = date("Y-m-d H:i:s");
     $res->transaction_id = $data['transaction_id'];
     //			$res->status 	  		= $data['status']; /*changed by dipti since there is already a update status function*/
     $res->processor = $data['processor'];
     //			$res->payee_id			= $data['buyer_email'];
     //appending raw data to orders's extra field data
     $comquick2cartHelper = new comquick2cartHelper();
     $q = "SELECT  `extra` FROM  `#__kart_orders` WHERE `id` =" . $eoid;
     $res->extra = $comquick2cartHelper->appendExtraFieldData($data['raw_data'], $q);
     if (!$db->updateObject('#__kart_orders', $res, 'id')) {
         //return false;
     }
     // Add payout entry
     $payout_id = $this->addPayoutEntry($eoid, $res->transaction_id, $data['status'], $pg_plugin);
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:29,代码来源:payment.php

示例3: currencyExchangeMsg

 /**
  * This function add currency exchange info in order's extra field
  *
  * @param   ARRAY  $data  contain orderid,to,from,and currency exchange rate
  *
  * @return  VOID
  */
 public function currencyExchangeMsg($data)
 {
     if (!empty($data)) {
         // Load payment model
         $path = JPATH_SITE . '/components/com_quick2cart/model/payment.php';
         if (!class_exists('Quick2cartModelpayment')) {
             JLoader::load('Quick2cartModelpayment');
         }
         $Quick2cartModelpayment = new Quick2cartModelpayment();
         $order_id = $Quick2cartModelpayment->extract_prefix($data['order_id']);
         // As we dont want to store( see next) in DB
         unset($data['order_id']);
         $comquick2cartHelper = new comquick2cartHelper();
         $q = "SELECT  `extra` FROM  `#__kart_orders` WHERE `id` =" . $order_id;
         $extraFieldData = $comquick2cartHelper->appendExtraFieldData($data, $q, 1);
         $res = new stdClass();
         $res->id = $order_id;
         $res->extra = $extraFieldData;
         $db = JFactory::getDBO();
         // Get previous data if exist
         if (!$db->updateObject('#__kart_orders', $res, 'id')) {
             echo $this->_db->stderr();
             return false;
         }
     }
 }
开发者ID:BetterBetterBetter,项目名称:B3App,代码行数:33,代码来源:helper.php


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