• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Mage类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: __construct

 /**
  * Block constructor
  */
 public function __construct()
 {
     $this->_controller = 'system_variable';
     $this->_headerText = Mage::helper('adminhtml')->__('Custom Variables');
     parent::__construct();
     $this->_updateButton('add', 'label', Mage::helper('adminhtml')->__('Add New Variable'));
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:10,代码来源:Variable.php


示例17: __construct

 public function __construct()
 {
     $this->_controller = 'report_review_product';
     $this->_headerText = Mage::helper('reports')->__('Products Reviews');
     parent::__construct();
     $this->_removeButton('add');
 }
开发者ID:barneydesmond,项目名称:propitious-octo-tribble,代码行数:7,代码来源:Product.php


示例18: getConfig

 public function getConfig()
 {
     if ($this->getData('config') == null) {
         $this->setConfig(new Varien_Object(Mage::getStoreConfig(self::CONFIG_BASE_PATH . $this->_configKey, $this->getSitemap()->getStoreId())));
     }
     return $this->getData('config');
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:7,代码来源:Abstract.php


示例19: _saveRates

 /**
  * Saving currency rates
  *
  * @param   array $rates
  * @return  Mage_Directory_Model_Currency_Import_Abstract
  */
 protected function _saveRates($rates)
 {
     foreach ($rates as $currencyCode => $currencyRates) {
         Mage::getModel('directory/currency')->setId($currencyCode)->setRates($currencyRates)->save();
     }
     return $this;
 }
开发者ID:hyhoocchan,项目名称:mage-local,代码行数:13,代码来源:Abstract.php


示例20: addItemCountExpr

 public function addItemCountExpr()
 {
     $orderTable = $this->getEntity()->getEntityTable();
     $orderItemEntityTypeId = Mage::getResourceSingleton('sales/order_item')->getTypeId();
     $this->getSelect()->join(array('items' => $orderTable), 'items.parent_id=e.entity_id and items.entity_type_id=' . $orderItemEntityTypeId, array('items_count' => new Zend_Db_Expr('COUNT(items.entity_id)')))->group('e.entity_id');
     return $this;
 }
开发者ID:hazaeluz,项目名称:magento_connect,代码行数:7,代码来源:Collection.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Mage1ActiveRecord类代码示例发布时间:2022-05-23
下一篇:
PHP M_Controller类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap