Skip to content

EDD 'edit discount code' link generates 'Invalid nonce' error #183

@zackkatz

Description

@zackkatz

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

  1. Create or edit a Sitewide Sale with the EDD sale type
  2. Select an existing EDD discount code
  3. Click the "edit discount code" button
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions