pixie-media/patching

为 Magento 2 提供关键修复

安装: 203

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:magento2-component

1.0.4 2024-07-01 16:43 UTC

This package is auto-updated.

Last update: 2024-10-01 00:23:04 UTC


README

安装方法

composer require pixie-media/patching

应用方法

./vendor/pixie-media/patching/bin/ece-patches apply

通用补丁

在本仓库中

./patches

将补丁添加到本仓库如何更新 patches.json

版本与 composer.lock 中找到的版本相关

格式

Correct format: <TICKET_NUMBER>__<TITLE>__<PACKAGE_VERSION>.patch    
Example: MAGECLOUD-2899__fix_redis_slave_configuration__2.3.0.patch

示例

PIXIE001__exception__2.4.5.patch

本地补丁

在项目仓库中

./m2-hotfixes

示例补丁

./m2-hotfixes/ga-patch.patch
diff --git a/vendor/magento/module-google-gtag/Block/Ga.php b/vendor/magento/module-google-gtag/Block/Ga.php
index ab5824a27..1597db4f8 100644
--- a/vendor/magento/module-google-gtag/Block/Ga.php
+++ b/vendor/magento/module-google-gtag/Block/Ga.php
@@ -159,6 +159,7 @@ class Ga extends Template
                 'value' => number_format((float) $order->getGrandTotal(), 2),
                 'tax' => number_format((float) $order->getTaxAmount(), 2),
                 'shipping' => number_format((float) $order->getShippingAmount(), 2),
+                'currency' => $order->getOrderCurrencyCode(),
             ];
             $result['currency'] = $order->getOrderCurrencyCode();
         }

如何创建本地补丁

您想修复 ./vendor/magento/module-catalog/Model/ResourceModel/Product.php

注意:项目必须是 git 仓库

  • 下载 /vendor/magento/module-catalog/Model/ResourceModel/Product.php

  • git add -f ./vendor/magento/module-catalog/Model/ResourceModel/Product.php

  • 编辑文件

  • git diff ./vendor/magento/module-catalog/Model/ResourceModel/Product.php > ./m2-hotfixes/test.patch

  • ./m2-hotfixes/test.patch 提交到仓库

注意:您需要撤销更改以测试补丁是否正确应用

全局补丁日志