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


PHP comquick2cartHelper::updateStoreFee方法代码示例

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


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

示例1: updatestatus

 function updatestatus($order_id, $status, $comment = '', $send_mail = 1, $store_id = 0)
 {
     global $mainframe;
     $params = JComponentHelper::getParams('com_quick2cart');
     $comquick2cartHelper = new comquick2cartHelper();
     switch ($status) {
         case 'C':
             /// to reduce stock
             $usestock = $params->get('usestock');
             $outofstock_allowship = $params->get('outofstock_allowship');
             if ($usestock == 1) {
                 $comquick2cartHelper->updateItemStock($order_id);
             }
             $comquick2cartHelper->updateStoreFee($order_id);
     }
     $mainframe = JFactory::getApplication();
     $db = JFactory::getDBO();
     if ($send_mail == 1) {
         if (!empty($store_id)) {
             $query = 'SELECT o.status FROM `#__kart_order_item` as o WHERE o.order_id =' . $order_id . ' AND o.`store_id`=' . $store_id . ' order by `order_item_id`';
             //die(" work is in progress(store product status change) die in helper ");
         } else {
             $query = "SELECT o.status FROM #__kart_orders as o WHERE o.id =" . $order_id;
         }
         $db->setQuery($query);
         $order_oldstatus = $db->loadResult();
     }
     $res = new stdClass();
     // UPDATING STORE ORDER CHANGES
     if (!empty($store_id)) {
         // change ORDER_ITEM STATUS// here i want order_item_id to update status of all order item releated to store
         $isOrderStatusChanged = $comquick2cartHelper->updateOrderItemStatus($order_id, $store_id, $status);
         if (empty($isOrderStatusChanged)) {
             //	return ;
         }
     } else {
         // IF admin changes ORDER status
         $res->status = $status;
         $res->id = $order_id;
         if (!$db->updateObject('#__kart_orders', $res, 'id')) {
             return 2;
         }
         $isOrderStatusChanged = $comquick2cartHelper->updateOrderItemStatus($order_id, 0, $status);
         // UPDATE ORDER ITEM STATUS ALSO
     }
     //START Q2C Sample development
     $query = "SELECT o.* FROM #__kart_orders as o WHERE o.id =" . $order_id;
     $db->setQuery($query);
     $orderobj = $db->loadObject();
     $dispatcher = JDispatcher::getInstance();
     JPluginHelper::importPlugin('system');
     $result = $dispatcher->trigger('Onq2cOrderUpdate', array($orderobj));
     //Call the plugin and get the result
     //END Q2C Sample development
     if ($send_mail == 1 && $order_oldstatus != $status) {
         $params = JComponentHelper::getParams('com_quick2cart');
         //$adminemails = comquick2cartHelper::adminMails();
         $query = "SELECT ou.user_id,ou.user_email,ou.firstname FROM #__kart_users as ou WHERE ou.address_type='BT' AND ou.order_id = " . $order_id;
         $db->setQuery($query);
         $orderuser = $db->loadObjectList();
         //Change for backward compatiblity for user info not saving order id against it
         if (empty($orderuser)) {
             $query = "SELECT ou.user_id,ou.user_email,ou.firstname\n\t\t\t\tFROM #__kart_users as ou \n\t\t\t\tWHERE ou.address_type='BT' AND ou.order_id IS NULL AND ou.user_id = (SELECT o.user_info_id FROM #__kart_orders as o WHERE o.id =" . $order_id . ")";
             $db->setQuery($query);
             $orderuser = $db->loadObjectList();
         }
         $orderuser = $orderuser[0];
         switch ($status) {
             case 'C':
                 $orderstatus = JText::_('QTC_CONFR');
                 /*for invoice*/
                 $jinput = JFactory::getApplication()->input;
                 $jinput->set('orderid', $order_id);
                 $order = $order_bk = $comquick2cartHelper->getorderinfo($order_id);
                 $this->orderinfo = $order['order_info'];
                 $this->orderitems = $order['items'];
                 $this->orders_site = 1;
                 $this->orders_email = 1;
                 $this->order_authorized = 1;
                 if ($this->orderinfo[0]->address_type == 'BT') {
                     $billemail = $this->orderinfo[0]->user_email;
                 } else {
                     if ($this->orderinfo[1]->address_type == 'BT') {
                         $billemail = $this->orderinfo[1]->user_email;
                     }
                 }
                 $fullorder_id = $order['order_info'][0]->prefix . $order_id;
                 if (!JFactory::getUser()->id && $params->get('guest')) {
                     $jinput->set('email', md5($billemail));
                 }
                 // check for view override
                 $view = $comquick2cartHelper->getViewpath('orders', 'invoice');
                 ob_start();
                 include $view;
                 $invoicehtml = ob_get_contents();
                 ob_end_clean();
                 /*for invoice*/
                 break;
             case 'RF':
                 $orderstatus = JText::_('QTC_REFUN');
//.........这里部分代码省略.........
开发者ID:muratgoktuna,项目名称:joomla-payments,代码行数:101,代码来源:tjcpg.php


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