You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactoring (no functional changes, no api changes)
Build related changes
Text changes
Other... Please describe:
Description
How to reproduce the issue or how to test the changes
This fixes Directorist featured listing order completion emails not being sent for orders stored in the new Directorist orders table.
When a user purchases a featured listing, the order is created with ref_type=featured_listing in wp_directorist_orders. Marking that order as paid correctly publishes/features the listing, but the legacy atbdp_order_completed email hook was not fired for this new featured listing order path. As a result, the existing owner/admin completed-order emails were not sent, so the site admin did not receive the payment notification.
This change fires the existing atbdp_order_completed action when a featured listing order changes from a non-paid status to paid, reusing Directorist's native completed-order email flow. It also updates the email order-summary renderer so new table orders can render valid item, price, and total details in the email body.
Enable monetization and Featured Listings in Directorist settings.
Ensure Bank Transfer, or another manual/offline gateway, is active for checkout.
Create/submit a listing as a user and proceed through the Featured Listing checkout.
Complete the checkout with Bank Transfer, then mark the created featured listing order as paid.
Before this fix, the listing becomes featured/published but no admin completed-order email is sent.
After this fix, the existing completed-order email flow sends:
the owner completed-order email
the admin payment notification email
Mark/save the already-paid order again and confirm duplicate completed-order emails are not sent.
Confirm the email order details include the featured listing item, price, and total.
I reproduced the reported issue locally against the exact PR base and then tested this PR head.
The core fix works:
On the base commit, changing a featured-listing order from pending to paid published/featured the listing, but atbdp_order_completed fired 0 times and no completed-order emails were generated.
On this PR, the hook fired once and both owner and admin emails were generated.
Saving the already-paid order again did not generate duplicate emails.
The rendered email contained the Featured item, price, currency, and total.
Before merge, please address these findings:
Legacy and new-table order IDs are ambiguous
ATBDP_Order::get_order_details() treats every numeric $order_id as a new-table primary ID first. Legacy emails pass a WordPress atbdp_orders post ID, while migrated orders store that value in legacy_id and receive a different auto-incremented id. When those numeric IDs collide, a legacy customer can receive details from an unrelated new-table order.
Please pass an explicit new-order context/DTO into the email renderer or provide a separate new-table renderer instead of inferring the storage source from the numeric ID.
The displayed currency symbol ignores the order currency
$order_currency is used in the heading, but $symbol is calculated from the current global site currency. With a EUR order on a USD-configured site, the local output was:
Price [EUR] $29.99 and Total amount [EUR] $29.99
The symbol should be derived from $order_currency.
The admin email links to the legacy Order History screen
The email should link to the matching new-order details screen.
The empty-items fallback cannot obtain order_type or listing_title
directorist_get_order_by_id() uses the raw get_by_id() query, which does not join the listing title or apply directorist_order_data. Therefore the fallback checks properties that are not present. A generic new-table order locally rendered only Order $29.99, without its listing title.
Please load the joined/filtered order record, or explicitly query the required fields before constructing the fallback item.
Static verification also passed PHP syntax and git diff --check. Targeted PHPCS reported 0 errors. The current GitHub check is failing before PHPCS runs because the pull_request_target workflow refuses to check out fork code; that failure is workflow-policy related, not a PHPCS result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
What kind of change does this PR introduce?
Description
How to reproduce the issue or how to test the changes
This fixes Directorist featured listing order completion emails not being sent for orders stored in the new Directorist orders table.
When a user purchases a featured listing, the order is created with
ref_type=featured_listinginwp_directorist_orders. Marking that order as paid correctly publishes/features the listing, but the legacyatbdp_order_completedemail hook was not fired for this new featured listing order path. As a result, the existing owner/admin completed-order emails were not sent, so the site admin did not receive the payment notification.This change fires the existing
atbdp_order_completedaction when a featured listing order changes from a non-paid status topaid, reusing Directorist's native completed-order email flow. It also updates the email order-summary renderer so new table orders can render valid item, price, and total details in the email body.paid.Any linked issues
Support ticket: https://team.sovware.com/support/directorist/3206
Screenshot
Checklist