Fixing Unsaved Gift Card Creation Issues

When creating a new gift card, I can't save it. How to fix it?

During the module installation, the extension creates attributes that are necessary for the correct operation of the module. If the gift card attributes were not created or were deleted, you may receive the error "The attribute with a "am_giftcard_prices" attributeCode doesn't exist. Verify the attribute and try again." or similar one. To resolve this issue and ensure that the gift card attributes are recreated, please, follow these steps:

1. Remove the gift card-related attributes from the eav_attribute table by executing the following SQL query to identify the gift card attributes which currently exist in your Magento:

SELECT * FROM eav_attribute WHERE attribute_code like 'am_%'

You should see a list of such attributes as am_giftcard_prices, am_allow_open_amount, am_open_amount_min, am_open_amount_max, am_giftcard_fee_enable, am_giftcard_fee_type, am_giftcard_fee_value, am_giftcard_type, am_giftcard_lifetime, am_email_template, am_giftcard_code_set and am_giftcard_code_image.


Once done, kindly remove the existing gift card attributes using this command:

DELETE FROM eav_attribute WHERE attribute_code = 'am_giftcard_usage'

Please note that instead of 'am_giftcard_usage' you should use the attribute_code of the gift card attributes found on your Magento. 

2. After that kindly delete the setup patch for gift card sample data from the patch_list table. You may find the patch_id of the patch using the following command:

SELECT * FROM patch_list WHERE patch_name LIKE '%InstallSampleData%'



Delete the patch using the patch_id with the command:

DELETE FROM patch_list WHERE patch_id = 'patch_id'

3. Execute these commands:

php bin/magento setup:upgrade
php bin/magento cache:flush

After executing these commands, you should see that all necessary attributes are created.

      • Related Articles

      • Gift Card API

        We have created public API collections for Gift Card module and its Gift Card Account submodule with all available queries and sample data that you can both test via our demo endpoints and copy to run local tests in your Magento environment. More ...
      • How Gift Card Codes are Generated?

        Gift Card codes in Magento are generated automatically when creating a gift card, either when processing an order or manually during the gift card creation process. These codes are pulled randomly from a code pool selected for the specific gift card:
      • Troubleshooting Gift Card Email Delivery Issues After Order Creation

        If gift card emails are not being sent after an order is created on your Magento site, the issue may be related to the execution of Magento consumers. Check the following points: 1. Check if the consumers_run cron job is executing in Magento. Magento ...
      • Gift Card | GraphQL methods

        Queries amGiftCardAccount(input: AmGiftCardAccountInput!) description: get gift card account information by code amGiftCardSetting description: get gift card module settings amGiftCardPreview(input: AmGiftCardPreviewInput) description: get rendered ...
      • How to fix a gift card image not showing in the email?

        There are a number of reasons for gift card images not showing in the email. To resolve this issue, kindly try the solutions below. 1. Please, note that for correct sending of images via emails, the module requires installation of the Imagick module ...