Description
The "edit discount code" link on the Sitewide Sale edit page is broken — clicking it results in errors instead of opening the EDD discount editor.
Root Cause
The URL uses edd-action=edit_discount, which triggers EDD's discount save/update handler (requiring nonce validation). The correct parameter for loading the edit screen is view=edit_discount.
Affected code: modules/ecommerce/edd/class-swsales-module-edd.php (line 143) and modules/ecommerce/edd/swsales-module-edd-metaboxes.js (line 14).
Steps to Reproduce
- Create or edit a Sitewide Sale with the EDD sale type
- Select an existing EDD discount code
- Click the "edit discount code" button
- Result: EDD shows an error or redirect loop
Expected Behavior
The "edit discount code" link should open the EDD discount edit page.
Fix
Replace edd-action=edit_discount with view=edit_discount in both PHP and JS. See PR #184.
Description
The "edit discount code" link on the Sitewide Sale edit page is broken — clicking it results in errors instead of opening the EDD discount editor.
Root Cause
The URL uses
edd-action=edit_discount, which triggers EDD's discount save/update handler (requiring nonce validation). The correct parameter for loading the edit screen isview=edit_discount.Affected code:
modules/ecommerce/edd/class-swsales-module-edd.php(line 143) andmodules/ecommerce/edd/swsales-module-edd-metaboxes.js(line 14).Steps to Reproduce
Expected Behavior
The "edit discount code" link should open the EDD discount edit page.
Fix
Replace
edd-action=edit_discountwithview=edit_discountin both PHP and JS. See PR #184.