在Magento 2中有很多可用的事件,一些付款,发票或订单取消操作的事件如下, 1. order_cancel_after 取消订单后将使用此事件。如果您想在取消订单后做某事,可以使用此事件。 代码在 vendor/magento/module-sales/Model/Order.php at cancel() function. $this->_eventManager->dispatch('order_cancel_after', ['order' => $this]); 2. sales_order_invoice_cancel 允许您在取消订单时取消订单发票 代码在vendor/magento/module-sales/Model/Order/Invoice.php at cancel() function. $this->_eventManager->dispatch('sales_order_invoice_cancel', [$this->_eventObject => $this]); 3. sales_order_payment_cancel_invoice 允许您在取消订单时取消订单发票 代码在vendor/magento/module-sales/Model/Order/Invoice.php at cancel() function. $this->_eventManager->dispatch('sales_order_invoice_cancel', [$this->_eventObject => $this]); 4. sales_order_payment_cancel_creditmemo 代码在vendor/magento/module-sales/Model/Order/Payment.php using cancelCreditmemo() function $this->_eventManager->dispatch( ...
Discy 最新 问题
插件官网: https://bsscommerce.com/magento-2-pre-order-extension.html 主要功能: Magento 2 Pre Order扩展允许订购缺货或提前上市的产品。 允许预先订购缺货和即将到来的产品 能够在类别页面上预购产品 将“添加到购物车”按钮替换为“预购”按钮 在产品页面,购物车和订单详细信息页面上显示预购产品的注释和消息 编辑Magento 2预购笔记,按钮和消息以显示在前端 在后端方便地管理以前的订单 在Magento 2.3.x上使用多源清单 百度云下载地址 v1.1.6版本 bss_preorder_m2_v1.1.6.zip
2.4.0 beta测试版已发布 估计7月下旬会正式推出正式版 见 https://devdocs.magento.com/guides/v2.4/release-notes/release-notes-2-4-0-open-source.html 主要亮点: 支持php7.4,不推荐使用7.1和7.2 支持Elasticsearch 7.x, 6.x以下的都不支持,并且必须要安装Elasticsearch才能安装magento 目录产品搜索功能 都用Elasticsearch代替mysql了 支持MySQL 8.0 支持MariaDB 10.4 将底层框架Zend Framework迁移到Laminas Braintree模块已移除 PayPal SDK升级 删除Web设置安装向导,一律用命令行安装 Redis性能的多种优化 GraphQL 增强 PWA Studio增强
1) Load product collection : <?php /** * Created By : Rohan Hapani */ namespace RHHelloWorldBlock; class HelloWorld extends MagentoFrameworkViewElementTemplate { protected $productCollectionFactory; protected $categoryFactory; public function __construct( MagentoFrameworkViewElementTemplateContext $context, MagentoCatalogModelResourceModelProductCollectionFactory $productCollectionFactory, MagentoCatalogModelCategoryFactory $categoryFactory, array $data = [] ) { $this->productCollectionFactory = $productCollectionFactory; $this->categoryFactory = $categoryFactory; parent::__construct($context, $data); } public function getProductCollection() { $collection = $this->productCollectionFactory->create(); $collection->setPageSize(3); foreach ($collection as $product) { print_r($product->getData()); } return $collection; } } 2) Load product collection with specific attribute : $collection = $this->productCollectionFactory->create(); $collection->addAttributeToSelect(['name','sku']); $collection->setPageSize(3); foreach ($collection as $product) { print_r($product->getData()); } 3) Load product collection with all ...
B站地址: https://www.bilibili.com/video/BV137411N7tJ?p=2 第2节:2-How to add new tables for a custom module in Magento 2 - Magento2开发视频教程 下一节: 3-How to create a grid using UI component in Magento 2
B站地址: https://www.bilibili.com/video/BV1B4411Z7U9?p=31 第31节:31-Magento 2 常用快速设置 Quick Store Configuration Popular Settings - Magento2小白使用视频教程 下一节: 32-Magento 2 验证码 ReCaptcha
B站地址: https://www.bilibili.com/video/BV1B4411Z7U9?p=30 第30节:30-Magento 2 订单相关 Order Statuses and States - Magento2小白使用视频教程 下一节: 31-Magento 2 常用快速设置 Quick Store Configuration Popular Settings