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 null quote issue #19

Merged
merged 2 commits into from
Jul 26, 2024
Merged

Fix null quote issue #19

merged 2 commits into from
Jul 26, 2024

Conversation

Dinwy
Copy link
Collaborator

@Dinwy Dinwy commented Jul 26, 2024

Description

This PR fix a critical issue where a null quote caused errors, which make user unable to pay when the user is not siged in, and includes translation updates.

Key Changes

Fix Null Cart Issue:

  • Added if statement that checking quoteId exsits
        $lastRealQuoteId = $this->checkoutSession->getLastRealQuoteId();
        
        if (!$lastRealQuoteId) {
            $this->logger->info('No last real quote ID found');
            return;
        }
...

Observer Updates:

  • New Observer: RestoreAfterCancel for restoring the quote when an order is canceled.
  • Updated Observer: RestoreQuoteFromSession now checks and restores the last real quote when applicable, with improved logging.
  • New Observer: SaveQuoteBeforeOrder to save the last real quote ID before order submission.

Plugin Enhancements:

  • Updated WebhookEventProcessor.php to prepend external order numbers with translated payment methods.

Critical Fixes:

  • Resolved an issue where $quote = $this->checkoutSession->getQuote(); was throwing an error due to a null quote, ensuring stable execution.

Translation Updates:

  • Added translations for various payment methods in en_US.csv and ja_JP.csv. Now it will show what payment user used.
    Before: KOMOJU 外部注文ID:...
    After: KOMOJU - メルペイ 外部注文ID:...

Jul 25, 2024 4:43:47 PM Processing Customer Not Notified
KOMOJU - メルペイ 外部注文ID: 297-66a202310fa35 金額の支払いを受け取りました: 10 JPY

Jul 25, 2024 4:42:57 PM Processing Customer Not Notified
KOMOJU - クレジットカード決済 外部注文ID: 296-66a2020030c20 金額の支払いを受け取りました: 10 JPY

@Dinwy Dinwy merged commit 3fed78c into master Jul 26, 2024
2 checks passed
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.

1 participant