fix: resolve email shortcode rendering and TypeScript errors

- Fix EmailRenderer.php: add missing \ namespace prefix on instanceof
  checks for WC_Order, WC_Product, WC_Customer in get_variables()
  (root cause of unrendered {order_number} etc. in all order emails)
- Fix ProductCard.tsx: remove deprecated isClassic/isModern/isBoutique
  branches, consolidate into single settings-driven render path
- Fix AccountLayout.tsx: add missing return statement
- Remove orphaned Layout.tsx (imported nothing, referenced missing Header)
This commit is contained in:
Dwindi Ramadhana
2026-03-12 19:10:56 +07:00
parent 3f2019bc7c
commit e70aa1f554
4 changed files with 76 additions and 344 deletions

View File

@@ -195,7 +195,7 @@ class EmailRenderer
];
// Order variables
if ($data instanceof WC_Order) {
if ($data instanceof \WC_Order) {
// Calculate estimated delivery (3-5 business days from now)
$estimated_delivery = date('F j', strtotime('+3 days')) . '-' . date('j', strtotime('+5 days'));
@@ -289,7 +289,7 @@ class EmailRenderer
}
// Product variables
if ($data instanceof WC_Product) {
if ($data instanceof \WC_Product) {
$variables = array_merge($variables, [
'product_id' => $data->get_id(),
'product_name' => $data->get_name(),
@@ -302,7 +302,7 @@ class EmailRenderer
}
// Customer variables
if ($data instanceof WC_Customer) {
if ($data instanceof \WC_Customer) {
// Get temp password from user meta (stored during auto-registration)
$user_temp_password = get_user_meta($data->get_id(), '_woonoow_temp_password', true);