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


PHP Toolbox::addLogLine方法代码示例

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


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

示例1: delProductWithoutEAN

 /**
  * On supprime tous les produits qui n'ont pas de code EAN13.
  * @param $t_product
  * @param $is_display
  * @return array
  */
 private function delProductWithoutEAN($products, $is_display)
 {
     return $products;
     $products_with_ean = array();
     foreach ($products as $key => $product) {
         if (!empty($product['id_product_attribute']) && !empty($product['ean13_declinaison']) || empty($product['id_product_attribute']) && !empty($product['ean13'])) {
             $products_with_ean[] = $product;
         } else {
             if ($this->getValue('debug')) {
                 Toolbox::addLogLine(self::getL('No EAN13 for product') . ' : ' . $product['id_product'] . '/' . $product['id_produt_attribute']);
                 Toolbox::displayDebugMessage(self::getL('No EAN13 for product') . ' : ' . $product['id_product'] . '/' . $product['id_produt_attribute']);
             }
         }
     }
     return $products_with_ean;
 }
开发者ID:juniorhq88,项目名称:PrestaShop-modules,代码行数:22,代码来源:GatewayProduct.php

示例2: setOrderNetEven

 /**
  * Set order NetEven
  * @param $param
  */
 public function setOrderNetEven($params)
 {
     if (!self::$send_order_state_to_neteven) {
         return;
     }
     if ($res = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'orders_gateway` WHERE `id_order` = ' . (int) $params['id_order'])) {
         $status = '';
         $track = '';
         $date_now = date('Y-m-d H:i:s');
         if ($params['newOrderStatus']->id == (int) Configuration::get('PS_OS_PREPARATION')) {
             $status = 'Confirmed';
         }
         if ($params['newOrderStatus']->id == (int) Configuration::get('PS_OS_CANCELED')) {
             $status = 'Canceled';
         }
         if ($params['newOrderStatus']->id == (int) Configuration::get('PS_OS_DELIVERED')) {
             $res_order = Db::getInstance()->getRow('SELECT `shipping_number` FROM `' . _DB_PREFIX_ . 'orders` WHERE `id_order` = ' . (int) $params['id_order']);
             $status = 'Shipped';
             $track = $res_order['shipping_number'];
         }
         if ($params['newOrderStatus']->id == (int) Configuration::get('PS_OS_REFUND')) {
             $status = 'Refunded';
         }
         if ($status != '') {
             $order1 = array('OrderID' => $res['id_order_neteven'], 'Status' => $status);
             if (!empty($track)) {
                 $order1['TrackingNumber'] = $track;
             }
             $params_web = array('orders' => array($order1));
             try {
                 $response = $this->_client->PostOrders($params_web);
                 $order_status = $response->PostOrdersResult->MarketPlaceOrderStatusResponse;
             } catch (Exception $e) {
                 Toolbox::manageError($e, 'Update order statu in neteven');
                 $order_status = NULL;
             }
             if ($this->getValue('send_request_to_mail')) {
                 $this->sendDebugMail($this->getValue('mail_list_alert'), self::getL('Debug - Control request') . ' setOrderNetEven', $this->_client->__getLastRequest(), true);
             }
             if (!isset($order_status->StatusResponse) || isset($order_status->StatusResponse) && $order_status->StatusResponse != 'Updated' || is_null($order_status)) {
                 $complement = !is_array($order_status->StatusResponse) ? $order_status->StatusResponse : '';
                 $complement .= is_array($order_status->StatusResponse) ? '<pre>' . print_r($order_status->StatusResponse, true) . '</pre>' : '';
                 if ($this->getValue('send_request_to_mail')) {
                     $this->sendDebugMail($this->getValue('mail_list_alert'), self::getL('Fail for update order state'), self::getL('Order Id') . ' (' . (int) $params['id_order'] . '). ' . self::getL('NetEven response') . ' : ' . $complement);
                 }
             }
             if (!empty($order_status) && !is_null($order_status)) {
                 Toolbox::addLogLine(self::getL('Update order state') . ' ' . $status . ' ' . self::getL('NetEven Order Id') . ' ' . $res['id_order_neteven'] . ' ' . self::getL('Order Id') . ' ' . $res['id_order'] . ' - ' . $order_status->StatusResponse . '');
             }
             if (!Db::getInstance()->Execute('INSERT INTO `' . _DB_PREFIX_ . 'orders_gateway_order_state` (`id_order`, `id_order_state`, `date_add`, `date_upd`) VALUES (' . (int) $res['id_order'] . ', ' . (int) $params['newOrderStatus']->id . ', "' . pSQL($date_now) . '", "' . pSQL($date_now) . '")')) {
                 Toolbox::addLogLine(self::getL('Failed for save export NetEven order state Id') . ' ' . (int) $res['id_order']);
             } else {
                 Toolbox::addLogLine(self::getL('Save export of NetEven order state Id') . ' ' . (int) $res['id_order']);
             }
         }
     }
     Toolbox::writeLog();
 }
开发者ID:juniorhq88,项目名称:PrestaShop-modules,代码行数:62,代码来源:GatewayOrder.php


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