-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix/30: Prevent Gift Card image from being forced upon a site #198
Conversation
QA Update ✅I have verified this PR in the I tested the following on this branch:
Testing Environment
Screen.Recording.2024-08-15.at.6.28.07.PM.movScreen.Recording.2024-08-15.at.6.25.31.PM.movSteps to Test- As mentioned in the PR description.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good, and It tests well.
We are using the hard-coded string woocommerce_gift_cards_pay_settings
in several files, we should use the constant SQUARE_PAYMENT_SETTINGS_OPTION_NAME
instead.
It's true that option names rarely change, but using constants makes navigating the code easier, and remove the risk of typos.
I'm guessing we are not using it because of the long class name, if that's the case we can move it to includes/Gateway/Gift_Card.php
class (or create a new one with a more descriptive name) so it's prettier:
-
WC_REST_Square_Gift_Cards_Settings_Controller::SQUARE_PAYMENT_SETTINGS_OPTION_NAME
-
Gift_Card::SQUARE_PAYMENT_SETTINGS_OPTION_NAME
Makes sense @diegocurbelo 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Sidsector9, the changes look good 🚢
All Submissions:
Changes proposed in this Pull Request:
Earlier, we added the default git card placeholder image to the media library on
init
hook.In this PR, we add to the media library when the Gift card product placeholder image setting is enabled and the settings are saved at
/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=gift_cards_pay
.This PR also adds a provision to replace the default placeholder for gift card via the following UI:
Closes #30
Steps to test the changes in this Pull Request:
/wp-admin/admin.php?page=wc-settings&tab=checkout§ion=gift_cards_pay
and enable Gift card product placeholder image and save it.Changelog entry