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


PHP Mage类代码示例

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


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

示例1: getVersion

 public function getVersion()
 {
     $m = new Mage();
     $version = $m->getVersion();
     if (in_array($version, array('1.5.0.0', '1.5.0.1', '1.5.1.0', '1.6.0.0', '1.9.1.1', '1.10.0.2', '1.10.1.1', '1.11.0.0'))) {
         return true;
     } else {
         return false;
     }
 }
开发者ID:sshegde123,项目名称:wmp8,代码行数:10,代码来源:Data.php

示例2: _prepareColumns

 protected function _prepareColumns()
 {
     $this->addColumn('period', array('header' => Mage::helper('sales')->__('Period'), 'index' => 'period', 'width' => 100, 'sortable' => false, 'period_type' => $this->getPeriodType(), 'renderer' => 'adminhtml/report_sales_grid_column_renderer_date', 'totals_label' => Mage::helper('sales')->__('Total'), 'html_decorators' => array('nobr')));
     $this->addColumn('orders_count', array('header' => Mage::helper('sales')->__('Orders'), 'index' => 'orders_count', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_ordered', array('header' => Mage::helper('sales')->__('Sales Items'), 'index' => 'total_qty_ordered', 'type' => 'number', 'total' => 'sum', 'sortable' => false));
     $this->addColumn('total_qty_invoiced', array('header' => Mage::helper('sales')->__('Items'), 'index' => 'total_qty_invoiced', 'type' => 'number', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns')));
     if ($this->getFilterData()->getStoreIds()) {
         $this->setStoreIds(explode(',', $this->getFilterData()->getStoreIds()));
     }
     $currencyCode = $this->getCurrentCurrencyCode();
     $rate = $this->getRate($currencyCode);
     $this->addColumn('total_income_amount', array('header' => Mage::helper('sales')->__('Sales Total'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_income_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_revenue_amount', array('header' => Mage::helper('sales')->__('Revenue'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_revenue_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_profit_amount', array('header' => Mage::helper('sales')->__('Profit'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_profit_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_invoiced_amount', array('header' => Mage::helper('sales')->__('Invoiced'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_invoiced_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_paid_amount', array('header' => Mage::helper('sales')->__('Paid'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_paid_amount', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_refunded_amount', array('header' => Mage::helper('sales')->__('Refunded'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_refunded_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount', array('header' => Mage::helper('sales')->__('Sales Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_tax_amount_actual', array('header' => Mage::helper('sales')->__('Tax'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_tax_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_shipping_amount', array('header' => Mage::helper('sales')->__('Sales Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_shipping_amount_actual', array('header' => Mage::helper('sales')->__('Shipping'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_shipping_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_discount_amount', array('header' => Mage::helper('sales')->__('Sales Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addColumn('total_discount_amount_actual', array('header' => Mage::helper('sales')->__('Discount'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_discount_amount_actual', 'total' => 'sum', 'sortable' => false, 'visibility_filter' => array('show_actual_columns'), 'rate' => $rate));
     $this->addColumn('total_canceled_amount', array('header' => Mage::helper('sales')->__('Canceled'), 'type' => 'currency', 'currency_code' => $currencyCode, 'index' => 'total_canceled_amount', 'total' => 'sum', 'sortable' => false, 'rate' => $rate));
     $this->addExportType('*/*/exportSalesCsv', Mage::helper('adminhtml')->__('CSV'));
     $this->addExportType('*/*/exportSalesExcel', Mage::helper('adminhtml')->__('Excel XML'));
     return parent::_prepareColumns();
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:28,代码来源:Grid.php

示例3: getTag

 public function getTag()
 {
     if (!$this->_tag) {
         $this->_tag = Mage::registry('tagModel');
     }
     return $this->_tag;
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:7,代码来源:Edit.php

示例4: getAllOptions

 public function getAllOptions()
 {
     if (!$this->_options) {
         $this->_options = Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm(true, true);
     }
     return $this->_options;
 }
开发者ID:hientruong90,项目名称:ee_14_installer,代码行数:7,代码来源:Website.php

示例5: toGridOptionArray

 /**
  * Options getter
  *
  * @return array
  */
 public function toGridOptionArray()
 {
     return array(
         self::IMAGE => Mage::helper('adminhtml')->__('Image'),
         self::PRODUCT => Mage::helper('adminhtml')->__('Product')
     );
 }
开发者ID:amal-nibaya,项目名称:PB-BEERSHOP,代码行数:12,代码来源:Type.php

示例6: getRatingSummary

 public function getRatingSummary()
 {
     if (!$this->getRatingSummaryCache()) {
         $this->setRatingSummaryCache(Mage::getModel('rating/rating')->getReviewSummary($this->getReviewId()));
     }
     return $this->getRatingSummaryCache();
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:7,代码来源:Summary.php

示例7: _beforeSave

 /**
  * Check whether redirect should be set
  *
  * @return Mage_Adminhtml_Model_System_Config_Backend_Admin_Custom
  */
 protected function _beforeSave()
 {
     if ($this->getOldValue() != $this->getValue()) {
         Mage::register('custom_admin_path_redirect', true, true);
     }
     return $this;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:12,代码来源:Custompath.php

示例8: getLinksTitle

 /**
  * Return Links Section Title for order item
  *
  * @return string
  */
 public function getLinksTitle()
 {
     if ($this->_purchasedLinks->getLinkSectionTitle()) {
         return $this->_purchasedLinks->getLinkSectionTitle();
     }
     return Mage::getStoreConfig(Mage_Downloadable_Model_Link::XML_PATH_LINKS_TITLE);
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:12,代码来源:Abstract.php

示例9: __construct

 /**
  * Block constructor
  */
 public function __construct()
 {
     $this->_controller = 'sitemap';
     $this->_headerText = Mage::helper('sitemap')->__('Google Sitemap');
     $this->_addButtonLabel = Mage::helper('sitemap')->__('Add Sitemap');
     parent::__construct();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:10,代码来源:Sitemap.php

示例10: _beforeSave

 /**
  * Action before save
  *
  * @param Mage_Core_Model_Abstract $object
  * @return Mage_Api_Model_Resource_Acl_Role
  */
 protected function _beforeSave(Mage_Core_Model_Abstract $object)
 {
     if (!$object->getId()) {
         $this->setCreated(Mage::getSingleton('core/date')->gmtDate());
     }
     return $this;
 }
开发者ID:monkviper,项目名称:magento-lite,代码行数:13,代码来源:Role.php

示例11: _prepareToRender

 /**
  * Prepare to render
  */
 protected function _prepareToRender()
 {
     $this->addColumn('customer_group_id', array('label' => Mage::helper('Mage_Customer_Helper_Data')->__('Customer Group'), 'renderer' => $this->_getGroupRenderer()));
     $this->addColumn('min_sale_qty', array('label' => Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Minimum Qty'), 'style' => 'width:100px'));
     $this->_addAfter = false;
     $this->_addButtonLabel = Mage::helper('Mage_CatalogInventory_Helper_Data')->__('Add Minimum Qty');
 }
开发者ID:relue,项目名称:magento2,代码行数:10,代码来源:Minsaleqty.php

示例12: indexAction

 public function indexAction()
 {
     //echo 'Hello Index!';
     header('Content-Type: text/plain');
     echo $config = Mage::getConfig()->loadModulesConfiguration('system.xml')->getNode()->asXML();
     exit;
 }
开发者ID:xiaoguizhidao,项目名称:ecommerce,代码行数:7,代码来源:IndexController.php

示例13: changeColumnPosition

 /**
  * Change columns position
  *
  * @param string $table
  * @param string $column
  * @param boolean $after
  * @param boolean $first
  * @return Enterprise_SalesArchive_Model_Resource_Helper_Mysql4
  */
 public function changeColumnPosition($table, $column, $after = false, $first = false)
 {
     if ($after && $first) {
         if (is_string($after)) {
             $first = false;
         } else {
             $after = false;
         }
     } elseif (!$after && !$first) {
         // If no new position specified
         return $this;
     }
     if (!$this->_getWriteAdapter()->isTableExists($table)) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Table not found'));
     }
     $columns = array();
     $adapter = $this->_getWriteAdapter();
     $description = $adapter->describeTable($table);
     foreach ($description as $columnDescription) {
         $columns[$columnDescription['COLUMN_NAME']] = $adapter->getColumnDefinitionFromDescribe($columnDescription);
     }
     if (!isset($columns[$column])) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Column not found'));
     } elseif ($after && !isset($columns[$after])) {
         Mage::throwException(Mage::helper('enterprise_salesarchive')->__('Positioning column not found'));
     }
     if ($after) {
         $sql = sprintf('ALTER TABLE %s MODIFY COLUMN %s %s AFTER %s', $adapter->quoteIdentifier($table), $adapter->quoteIdentifier($column), $columns[$column], $adapter->quoteIdentifier($after));
     } else {
         $sql = sprintf('ALTER TABLE %s MODIFY COLUMN %s %s FIRST', $adapter->quoteIdentifier($table), $adapter->quoteIdentifier($column), $columns[$column]);
     }
     $adapter->query($sql);
     return $this;
 }
开发者ID:sagmahajan,项目名称:aswan_release,代码行数:43,代码来源:Mysql4.php

示例14: getAllOptions

 /**
  * Retrieve all attribute options
  *
  * @return array
  */
 public function getAllOptions()
 {
     if (!$this->_options) {
         $this->_options = array(array('label' => Mage::helper('giftmessage')->__('Yes'), 'value' => 1), array('label' => Mage::helper('giftmessage')->__('No'), 'value' => 0), array('label' => Mage::helper('giftmessage')->__('Use config'), 'value' => 2));
     }
     return $this->_options;
 }
开发者ID:hirentricore,项目名称:devmagento,代码行数:12,代码来源:Config.php

示例15: convertQuoteToOrder

 /**
  * @param $quote
  * @return Mage_Sales_Model_Order
  */
 public function convertQuoteToOrder($quote)
 {
     /* @var $service Mage_Sales_Model_Service_Quote */
     $service = Mage::getModel('sales/service_quote', $quote);
     $service->submitAll();
     return $service->getOrder();
 }
开发者ID:nhp,项目名称:Xtest,代码行数:11,代码来源:Order.php


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