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


PHP mage::log方法代码示例

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


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

示例1: isInStock

 /**
  * Retourne vrai si un produit est dispo
  *
  */
 public function isInStock($product)
 {
     try {
         //echo '<br>-->'.$product->getId().' stock='.$Stock.' ordered='.$OrderedQty;
         $Stock = $product->getStockItem()->getQty();
         $OrderedQty = $product->getordered_qty();
         if ($Stock - $OrderedQty > 0) {
             return true;
         } else {
             return false;
         }
     } catch (Exception $ex) {
         mage::log('Error inside isInStock method : ' . $ex->getMessage());
         return false;
     }
 }
开发者ID:TrygveSkogsholm,项目名称:Magento-Patch,代码行数:20,代码来源:Configurable.php

示例2: estorno

 public function estorno($observer)
 {
     if (!is_object($observer->getEvent()->getCreditmemo()->getInvoice())) {
         //apresenta um erro caso a pessoa não escolha a fatura no admin
         Mage::throwException(Mage::helper('payment')->__('Não foi possivel identificar a fatura. É preciso escolher uma fatura para o estorno. '));
     }
     $orderId = $observer->getEvent()->getCreditmemo()->getInvoice()->getOrderId();
     $order = mage::getModel('sales/order')->load($orderId);
     $tid = $order->getPayment()->getCcTransId();
     $payment = $order->getPayment();
     if ($payment->getMethod() != 'apelidocielo') {
         return true;
     }
     $creditmemo = $observer->getEvent()->getCreditmemo();
     $valor = number_format($creditmemo->getGrandTotal(), 2, '', '');
     $debug = Mage::getStoreConfig('payment/apelidocielo/debug');
     if ($debug) {
         //Esse log só funciona se a opção Ativar log em Developer > Log no admin estiver marcada
         mage::log("\r\n===========   Dados do credito sendo enviados para estorno   ==========\r\n\r\n        ", null, 'oitoo_cielo.log');
     }
     $cielo = mage::getModel('apelidocielo/cielo');
     $retornoestorno = $cielo->setCancelamento($tid, $valor);
     if ($retornoestorno->autorizacao->codigo == 9 || $retornoestorno->autorizacao->codigo == 6) {
         //quando o pagamento é capturado não é mais possivel editar as infromações
         //faz o log de sucesso
         Mage::dispatchEvent('oitoo_cielo_log', array('quote_id' => (string) $payment->getOrder()->getQuoteId(), 'codigo' => $retornoestorno->autorizacao->codigo, 'texto' => 'Pedido estornado com sucesso! ', 'tid' => $retornoestorno->tid));
         return $this;
         //o crédito foi estornado.
     } else {
         if (isset($retornoestorno->codigo)) {
             Mage::throwException(Mage::helper('payment')->__('Erro num: ' . $retornoestorno->codigo . ' - ' . $retornoestorno->mensagem));
         } else {
             Mage::throwException(Mage::helper('payment')->__('Não foi possivel efetuar o estorno'));
         }
     }
     return $this;
 }
开发者ID:TalissonBento,项目名称:Pharmacy,代码行数:37,代码来源:Payment.php

示例3: _initAction

 protected function _initAction()
 {
     mage::log('initi', null, 'grid.log');
     $this->loadLayout()->_setActiveMenu("otpconfiguration2/otpconfiguration")->_addBreadcrumb(Mage::helper("adminhtml")->__("Otpconfiguration  Manager"), Mage::helper("adminhtml")->__("Otpconfiguration Manager"));
     return $this;
 }
开发者ID:hiteshyadav811,项目名称:adminhtml-call-ajax-for-grid-form,代码行数:6,代码来源:OtpconfigurationController.php

示例4: considerObjectType

 /**
  * Check if we log changes for entity type
  *
  * @param unknown_type $objectType
  * @return unknown
  */
 public function considerObjectType($objectType)
 {
     //register object types for optimization
     if (!Mage::registry('adminlogger_ignored_object_types')) {
         if (mage::getStoreConfig('adminlogger/general/enable_log') == 1) {
             mage::log('Load ignored object types in registry');
         }
         $ignoredObjectTypes = mage::getStoreConfig('adminlogger/advanced/object_to_ignore');
         $t_ignoredObjectTypes = explode("\n", $ignoredObjectTypes);
         for ($i = 0; $i < count($t_ignoredObjectTypes); $i++) {
             $t_ignoredObjectTypes[$i] = trim($t_ignoredObjectTypes[$i]);
         }
         Mage::register('adminlogger_ignored_object_types', $t_ignoredObjectTypes);
     }
     //check if object type is managed
     if (in_array($objectType, Mage::registry('adminlogger_ignored_object_types'))) {
         if (mage::getStoreConfig('adminlogger/general/enable_log') == 1) {
             mage::log('Object type ' . $objectType . ' ignored ');
         }
         return false;
     } else {
         if (mage::getStoreConfig('adminlogger/general/enable_log') == 1) {
             mage::log('Object type ' . $objectType . ' considered ');
         }
         return true;
     }
 }
开发者ID:xiaoguizhidao,项目名称:devfashion,代码行数:33,代码来源:Data.php

示例5: _afterSave

 /**
  * Surcharge la méthode after save pour mettre a jour les stocks
  *
  * @return Mage_Core_Model_Abstract
  */
 protected function _afterSave()
 {
     try {
         //appel le parent
         parent::_afterSave();
         //Define if shipment just created
         $creation = $this->getentity_id() != $this->getOrigData('entity_id');
         if ($creation) {
             //Create stock movements
             $order = $this->getOrder();
             foreach ($this->getAllItems() as $item) {
                 //retrieve informaiton
                 $qty = $this->getRealShippedQtyForItem($item);
                 try {
                     $StockMovement = mage::getmodel('Purchase/StockMovement')->setsm_product_id($item->getproduct_id())->setsm_type('order')->setsm_coef(-1)->setsm_qty($qty)->setsm_date(date('Y-m-d'))->setsm_ui($item->getId())->setsm_description(mage::helper('purchase')->__('Order #') . $this->getOrder()->getincrement_id())->save();
                 } catch (Exception $ex) {
                     //nothing, db constraint exception because stock movement already exists
                 }
                 //reset reserved qty
                 $orderItem = $item->getOrderItem();
                 $orderItem->setreserved_qty(0)->save();
             }
             //update order planning
             $orderId = $this->getOrder()->getId();
             mage::helper('BackgroundTask')->AddTask('Update planning for order ' . $orderId, 'purchase/Planning', 'updatePlanning', $orderId);
             //Met a jour les qte commandées pour le produit
             $order->UpdateProductsOrdererQty;
         }
     } catch (Exception $ex) {
         mage::log($ex->getMessage());
     }
     return $this;
 }
开发者ID:TrygveSkogsholm,项目名称:Magento-Patch,代码行数:38,代码来源:Shipment.php

示例6: addAction

 public function addAction()
 {
     $response = array();
     if (!Mage::getStoreConfigFlag('wishlist/general/active')) {
         $response['status'] = 'ERROR';
         $response['message'] = $this->__('Wishlist Has Been Disabled By Admin');
     }
     if (!Mage::getSingleton('customer/session')->isLoggedIn()) {
         $response['status'] = 'ERROR';
         $response['message'] = $this->__('Please Login First');
     }
     if (empty($response)) {
         $session = Mage::getSingleton('customer/session');
         $wishlist = $this->_getWishlist();
         if (!$wishlist) {
             $response['status'] = 'ERROR';
             $response['message'] = $this->__('Unable to Create Wishlist');
         } else {
             $productId = (int) $this->getRequest()->getParam('product');
             if (!$productId) {
                 $response['status'] = 'ERROR';
                 $response['message'] = $this->__('Product Not Found');
             } else {
                 $product = Mage::getModel('catalog/product')->load($productId);
                 if (!$product->getId() || !$product->isVisibleInCatalog()) {
                     $response['status'] = 'ERROR';
                     $response['message'] = $this->__('Cannot specify product.');
                 } else {
                     try {
                         $requestParams = $this->getRequest()->getParams();
                         $buyRequest = new Varien_Object($requestParams);
                         $result = $wishlist->addNewItem($product, $buyRequest);
                         if (is_string($result)) {
                             Mage::throwException($result);
                         }
                         $wishlist->save();
                         Mage::dispatchEvent('wishlist_add_product', array('wishlist' => $wishlist, 'product' => $product, 'item' => $result));
                         Mage::helper('wishlist')->calculate();
                         $message = $this->__('%1$s has been added to your wishlist.', $product->getName());
                         $response['status'] = 'SUCCESS';
                         $response['message'] = $message;
                         Mage::unregister('wishlist');
                         $this->loadLayout();
                         $response['toplink'] = $this->getLayout()->getBlock('top.links')->toHtml();
                         $response['sidebar'] = $this->getLayout()->getBlock('wishlist_sidebar')->toHtml();
                     } catch (Mage_Core_Exception $e) {
                         $response['status'] = 'ERROR';
                         $response['message'] = $this->__('An error occurred while adding item to wishlist: %s', $e->getMessage());
                     } catch (Exception $e) {
                         mage::log($e->getMessage());
                         $response['status'] = 'ERROR';
                         $response['message'] = $this->__('An error occurred while adding item to wishlist.');
                     }
                 }
             }
         }
     }
     $this->_sendJson($response);
     return;
 }
开发者ID:bigtailbear14,项目名称:rosstheme,代码行数:60,代码来源:WishlistController.php

示例7: sales_shipment_add_tracking

 /**
  * Function to update waybill if order tracking is of Delhivery Lastmile
  */
 public function sales_shipment_add_tracking($observer)
 {
     $track = $observer->getEvent()->getTrack();
     $order = $track->getShipment()->getOrder();
     $shippingMethod = $order->getShippingMethod();
     // String in format of 'carrier_method'
     if (!$shippingMethod) {
         return;
     }
     // Process only Delhivery Lastmile methods
     if ($track->getCarrierCode() != 'dlastmile') {
         return;
     }
     //mage::log($track->getNumber());
     //mage::log($track->getCarrierCode());
     $model = Mage::getModel('lastmile/lastmile');
     $awbobj = $model->loadByAwb($track->getNumber());
     $data = array();
     $status = 'Assigned';
     $data['state'] = 1;
     $data['status'] = "Assigned";
     $data['orderid'] = $order->getId();
     $data['shipment_to'] = $order->getShippingAddress()->getName();
     $data['shipment_id'] = $track->getShipment()->getIncrementId();
     mage::log($data);
     $model->setData($data);
     $model->setId($awbobj);
     $model->save();
     return;
 }
开发者ID:gkbaghel,项目名称:dv-utils,代码行数:33,代码来源:Observer.php

示例8: render

 public function render(Varien_Object $row)
 {
     mage::log($row->getUserId(), null, 'row.log');
     /*$value =  $row->getData($this->getColumn()->getIndex());
     		return '<span style="color:red;">'.$value.'</span>';*/
     $customer = Mage::getModel('customer/customer')->load($row->getUserId());
     return $customer->getName();
 }
开发者ID:hiteshyadav811,项目名称:adminhtml-call-ajax-for-grid-form,代码行数:8,代码来源:Customer.php

示例9: _prepareCollection

 protected function _prepareCollection()
 {
     $collection = Mage::getResourceModel($this->_getCollectionClass());
     //$collection->addAttributeToSelect(array('barcode'));
     $collection->addAttributeToSelect('*');
     $this->setCollection($collection);
     mage::log();
     return parent::_prepareCollection();
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:9,代码来源:Grid21-04-2014.php

示例10: getUpdatedate

 /**
  * Function to get last updated date of pincode
  *
  * @return date in yyyy-mm-dd format
  */
 public function getUpdatedate()
 {
     $resource = Mage::getSingleton('core/resource');
     $readConnection = $resource->getConnection('core_read');
     $query = "SELECT DATE_FORMAT(update_time,'%Y-%m-%d') FROM " . $resource->getTableName('lastmile/pincode') . " ORDER BY update_time DESC LIMIT 1";
     mage::log("{$query}");
     $data = $readConnection->fetchOne($query);
     return $data;
 }
开发者ID:gkbaghel,项目名称:dv-utils,代码行数:14,代码来源:Pincode.php

示例11: findAwbToCancel

 /**
  * Function to get waybills to be canceled if order is cancelled
  */
 public function findAwbToCancel($OrderId)
 {
     $resource = Mage::getSingleton('core/resource');
     $readConnection = $resource->getConnection('core_read');
     $query = "SELECT lastmile_id FROM " . $resource->getTableName('lastmile/lastmile') . " WHERE orderid = {$OrderId} AND status = 'Assigned'";
     mage::log("{$query}");
     $data = $readConnection->fetchAll($query);
     return $data;
 }
开发者ID:gkbaghel,项目名称:dv-utils,代码行数:12,代码来源:Lastmile.php

示例12: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array("id" => "edit_form", "action" => $this->getUrl("*/*/save", array("id" => $this->getRequest()->getParam("id"))), "method" => "post", "enctype" => "multipart/form-data"));
     $registry = Mage::registry("otpconfiguration_data");
     mage::log($registry, null, 'reg.log');
     $registry->setData('user_id', 'hitesh');
     $form->setValues($registry->getData());
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
开发者ID:hiteshyadav811,项目名称:adminhtml-call-ajax-for-grid-form,代码行数:11,代码来源:Form.php

示例13: fetchAction

 /**
  * Function to download Delhivery serviceable pincodes
  */
 public function fetchAction()
 {
     $apiurl = Mage::getStoreConfig('carriers/dlastmile/pincode_url');
     $token = Mage::getStoreConfig('carriers/dlastmile/licensekey');
     if ($apiurl && $token) {
         //$path = $apiurl.'json/?pre-paid=Y&token='.$token;
         $path = $apiurl . 'json/?token=' . $token . '&pre-paid=Y';
         $date = Mage::getModel('lastmile/pincode')->getUpdatedate();
         //if($date)
         //$path .= "&dt=$date";
         //mage::log($path);
         $retValue = Mage::helper('lastmile')->Executecurl($path, '', '');
         $codes = json_decode($retValue);
         mage::log(sizeof($codes->delivery_codes));
         //mage::log($codes);
         // Delete all zipcodes
         $delete = Mage::getModel('lastmile/pincode')->deleteAll();
         if (sizeof($codes)) {
             foreach ($codes->delivery_codes as $item) {
                 try {
                     //$lastmilezip = Mage::getModel('lastmile/pincode')->loadByPin($item->postal_code->pin);
                     $model = Mage::getModel('lastmile/pincode');
                     $data = array();
                     $data['district'] = $item->postal_code->district;
                     $data['pin'] = $item->postal_code->pin;
                     $data['pre_paid'] = $item->postal_code->pre_paid;
                     $data['cash'] = $item->postal_code->cash;
                     $data['pickup'] = $item->postal_code->pickup;
                     $data['cod'] = $item->postal_code->cod;
                     $data['is_oda'] = $item->postal_code->is_oda;
                     $data['state_code'] = $item->postal_code->state_code;
                     $model->setData($data);
                     mage::log($data);
                     if ($lastmilezip) {
                         $model->setId($lastmilezip->getId());
                     }
                     if ($model->getCreatedTime == NULL || $model->getUpdateTime() == NULL) {
                         $model->setCreatedTime(now())->setUpdateTime(now());
                     } else {
                         $model->setUpdateTime(now());
                     }
                     $model->save();
                 } catch (Exception $e) {
                     echo 'Caught exception: ', $e->getMessage(), "\n";
                     Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                 }
             }
         }
         Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('lastmile')->__('Pincode Updated Successfully'));
     } else {
         Mage::getSingleton('adminhtml/session')->addError(Mage::helper('lastmile')->__('Please add valid License Key and Gateway URL in plugin configuration'));
     }
     $this->_redirect('*/*/');
 }
开发者ID:gkbaghel,项目名称:dv-utils,代码行数:57,代码来源:PincodeController.php

示例14: reserveProductForOrders

 /**
  * reserve product for orders
  *
  * @param unknown_type $productId
  */
 public function reserveProductForOrders($productId)
 {
     //define if we must reserve product for orders (positive stock movement) or release(negative stock movement)
     $product = mage::getModel('catalog/product')->load($productId);
     $reservedQty = $product->getreserved_qty();
     $stock = $product->getStockItem()->getQty();
     //if stock allow to reserve products in other orders
     if ($stock > $reservedQty) {
         //collect orders with no reservation
         $orders = $product->GetPendingOrders(false);
         foreach ($orders as $order) {
             $this->reserveProductForOrder($order->getId(), $product->getId());
         }
     } else {
         //collect all pending orders (sort by date) and unreserve products
         mage::log('Product #' . $productId . ' stock is <= reserved qty : no reservation possible');
     }
 }
开发者ID:TrygveSkogsholm,项目名称:Magento-Patch,代码行数:23,代码来源:ProductReservation.php

示例15: updatePlanning

 /**
  * Update planning (method to use when information for the order changes (product reservation, payment, expedition ...)
  *
  * @param unknown_type $orderId
  */
 public function updatePlanning($orderId)
 {
     mage::log('##Start update planning for order #' . $orderId);
     $order = mage::getModel('sales/order')->load($orderId);
     if ($order->getId()) {
         $planning = $order->getPlanning();
         if ($planning->getConsiderationDate() == null) {
             mage::log('Set condideration date');
             $planning->setConsiderationInformation($order);
         }
         $planning->setFullStockInformation($order);
         $planning->setShippingInformation($order);
         $planning->setDeliveryInformation($order);
         $planning->save();
     } else {
         mage::log('Unable to load order #' . $orderId);
     }
     mage::log('##End update planning for order #' . $orderId);
 }
开发者ID:TrygveSkogsholm,项目名称:Magento-Patch,代码行数:24,代码来源:Planning.php


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