You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento 2.1社区版(Porto主题)购物车Discount标签修改方法

How to Change "Discount" to "Member Discount" in Porto Theme (Magento 2.1 Community Edition)

Hey there, let's walk through how to update that "Discount" label on your Porto theme's cart page to "Member Discount". There are a few common spots to check, depending on where the text is pulling from—here's your step-by-step guide:

1. First, Check Porto's Theme Language Files

Porto often overrides core Magento translations with its own language files, so this is the most likely place. Head to this directory in your Magento installation:
app/design/frontend/Smartwave/porto/i18n/

Find the locale file matching your store's language (for English, it's en_US.csv). Open it and search for the line:
"Discount","Discount"

Update it to:
"Discount","Member Discount"

Save the file, then clear Magento's cache by running this command from your Magento root directory:
bin/magento cache:clean

Refresh your cart page—this should do the trick for most cases.

2. Override Core Magento Translation (if Porto isn't handling it)

If the first step didn't work, the label might be coming straight from Magento's core. You can still override it at the theme level:
Create or edit the same en_US.csv file in Porto's i18n directory (as above) and add the modified line. Magento prioritizes theme-level translations over core ones, so this will take effect once cache is cleared.

3. Check Third-Party Discount Modules (if applicable)

If you're using a custom discount module instead of Magento's built-in one, the label might be stored in that module's translation files. Navigate to the module's i18n folder (usually app/code/[VendorName]/[ModuleName]/i18n/), find the relevant locale file, and update the "Discount" entry just like before.

4. Verify Template Files (last resort)

In rare cases, the label might be hardcoded in a template file. Check Porto's cart total templates here:
app/design/frontend/Smartwave/porto/Magento_Checkout/templates/cart/totals/discount.phtml

Open this file and look for any hardcoded "Discount" text. If you find it, replace it with "Member Discount". Note: This isn't the best practice (using translation files is better for multi-language support), but it works if all other methods fail.

Just a reminder: Always clear Magento's cache after making these changes—translations are heavily cached, so you won't see updates until cache is cleared.

内容的提问来源于stack exchange,提问作者Ping

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 03:29:17