Skip to content
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 nieaktywnych kodów zniżkowych z linku #63

Merged
merged 1 commit into from
Jan 2, 2025

Conversation

mtworoz
Copy link
Collaborator

@mtworoz mtworoz commented Dec 19, 2024

No description provided.

@@ -1478,7 +1478,10 @@ function edd_listen_for_cart_discount() {

$code = preg_replace('/[^a-zA-Z0-9-_]+/', '', $_REQUEST['discount'] );

EDD()->session->set( 'preset_discount', $code );
if ( edd_is_discount_valid( $code, get_current_user_id()) ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pewnie jest lepiej, ale nadal może być tak że zostanie w sesji a przestał być valid? czy nie? albo moze jest już to mniej upierdliwe i można zaakceptować?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm próbowałam na różne sposoby odtworzyć taką sytuację ale nie udało mi się.

Ogólnie problem polegał na tym, że do sesji się zapisywała ta nieaktywna zniżka z linku ale w koszyku nie była widoczna pod produktami, przez co w momencie, gdy została dodana nowa to uruchamiała się walidacja tej nieaktywnej też.

Jeśli dodamy zniżkę z linku, a ona w międzyczasie przestanie być aktywna to nadal można ją z poziomu koszyka usunąć i przejść dalej, także na nowej karcie czy po odświeżeniu. Jeśli przejdziemy znowu do koszyka z linku z prawidłową zniżką to ona się nadpisuje i też jest ok. Więc taka sytuacja się raczej nie zdarzy 😺

@mtworoz mtworoz merged commit c143298 into master Jan 2, 2025
@mtworoz mtworoz deleted the hotfix/pb-1604-unactive-discount-code-from-link branch January 2, 2025 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants