v7.0.0 release
This commit is contained in:
1 parent
0e7fa04b03
commit
c4ea9a6cd1
3582 files changed
+626189
-160151
No files matched your search
@@ -3,21 +3,26 @@
|
||||
namespace Modules\Sirsoft\Ecommerce;
|
||||
|
||||
use App\Extension\AbstractModule;
|
||||
use App\Models\IdentityMessageDefinition;
|
||||
use App\Seo\Concerns\LocalizesSeoValues;
|
||||
use Illuminate\Database\Seeder;
|
||||
use Modules\Sirsoft\Ecommerce\Database\Seeders\ClaimReasonSeeder;
|
||||
use Modules\Sirsoft\Ecommerce\Database\Seeders\SequenceSeeder;
|
||||
use Modules\Sirsoft\Ecommerce\Database\Seeders\ShippingCarrierSeeder;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\ActivityLogDescriptionResolver;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\AssignDefaultCurrencyOnRegisterListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\AssignDefaultShippingCountryOnRegisterListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\CategoryActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\CouponActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\CouponRestoreListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\CouponUseListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\EcommerceAdminActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\EcommerceNotificationDataListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\EcommerceUserActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\MergeCartOnLoginListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\MileageTransactionListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\OrderActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\OrderConfirmPointListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\OrderStatusNotificationListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\ProductActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\ProductInquiryBoardListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\SearchProductsListener;
|
||||
@@ -25,9 +30,12 @@ use Modules\Sirsoft\Ecommerce\Listeners\SeoCategoryCacheListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\SeoProductCacheListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\SeoSettingsCacheListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\ShippingPolicyActivityLogListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\StockRestoreListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\SyncOptionGroupsListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\SyncProductFromOptionListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\UserCurrencyInfoListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\UserMileageCleanupListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\UserMileageInfoListener;
|
||||
use Modules\Sirsoft\Ecommerce\Listeners\UserShippingCountryInfoListener;
|
||||
|
||||
class Module extends AbstractModule
|
||||
{
|
||||
@@ -787,6 +795,33 @@ class Module extends AbstractModule
|
||||
],
|
||||
],
|
||||
|
||||
// 대시보드 권한
|
||||
[
|
||||
'identifier' => 'dashboard',
|
||||
'name' => [
|
||||
'ko' => '대시보드',
|
||||
'en' => 'Dashboard',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '관리자 대시보드 이커머스 영역 조회 권한',
|
||||
'en' => 'Admin dashboard commerce area view permissions',
|
||||
],
|
||||
'permissions' => [
|
||||
[
|
||||
'action' => 'view',
|
||||
'name' => [
|
||||
'ko' => '대시보드 조회',
|
||||
'en' => 'View Dashboard',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '관리자 대시보드의 이커머스 판매 현황/리뷰/문의 위젯 조회',
|
||||
'en' => 'View commerce sales/review/inquiry widgets on the admin dashboard',
|
||||
],
|
||||
'roles' => ['admin', 'manager', 'sirsoft-ecommerce.manager'],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
// ============================================================
|
||||
// 사용자(User) 권한 — 블랙컨슈머 차단용
|
||||
// ============================================================
|
||||
@@ -902,6 +937,101 @@ class Module extends AbstractModule
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
// 마일리지 관리 권한
|
||||
[
|
||||
'identifier' => 'mileage',
|
||||
'resource_route_key' => 'mileage-transaction',
|
||||
'owner_key' => 'user_id',
|
||||
'name' => [
|
||||
'ko' => '마일리지 관리',
|
||||
'en' => 'Mileage Management',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '마일리지 내역 조회 및 수동 지급/차감 권한',
|
||||
'en' => 'Mileage history and manual grant/deduct permissions',
|
||||
],
|
||||
'permissions' => [
|
||||
[
|
||||
'action' => 'read',
|
||||
'name' => [
|
||||
'ko' => '마일리지 내역 조회',
|
||||
'en' => 'Read Mileage',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '마일리지 내역 목록 및 상세 조회',
|
||||
'en' => 'Read mileage history list and details',
|
||||
],
|
||||
'roles' => ['admin', 'manager', 'sirsoft-ecommerce.manager'],
|
||||
],
|
||||
[
|
||||
'action' => 'manage',
|
||||
'name' => [
|
||||
'ko' => '마일리지 수동 처리',
|
||||
'en' => 'Manage Mileage',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '마일리지 수동 지급/차감 및 일괄 유효기간 연장',
|
||||
'en' => 'Manual grant/deduct and bulk expiry extension',
|
||||
],
|
||||
'roles' => ['admin', 'manager', 'sirsoft-ecommerce.manager'],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
// 회원 결제 통화 관리 권한 (A3 — 관리자 회원 편집에서 통화 변경)
|
||||
[
|
||||
'identifier' => 'user-currency',
|
||||
'name' => [
|
||||
'ko' => '회원 결제 통화 관리',
|
||||
'en' => 'User Currency Management',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '관리자가 회원별 결제 통화를 변경하는 권한',
|
||||
'en' => 'Permission for admins to change a user\'s payment currency',
|
||||
],
|
||||
'permissions' => [
|
||||
[
|
||||
'action' => 'manage',
|
||||
'name' => [
|
||||
'ko' => '회원 결제 통화 변경',
|
||||
'en' => 'Manage User Currency',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '회원별 결제 통화 변경',
|
||||
'en' => 'Change a user\'s payment currency',
|
||||
],
|
||||
'roles' => ['admin', 'manager', 'sirsoft-ecommerce.manager'],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
// 회원 배송국가 관리 권한 (MP08 후속 — 관리자 회원 편집에서 배송국가 변경)
|
||||
[
|
||||
'identifier' => 'user-shipping-country',
|
||||
'name' => [
|
||||
'ko' => '회원 배송국가 관리',
|
||||
'en' => 'User Shipping Country Management',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '관리자가 회원별 배송국가를 변경하는 권한',
|
||||
'en' => 'Permission for admins to change a user\'s shipping country',
|
||||
],
|
||||
'permissions' => [
|
||||
[
|
||||
'action' => 'manage',
|
||||
'name' => [
|
||||
'ko' => '회원 배송국가 변경',
|
||||
'en' => 'Manage User Shipping Country',
|
||||
],
|
||||
'description' => [
|
||||
'ko' => '회원별 배송국가 변경',
|
||||
'en' => 'Change a user\'s shipping country',
|
||||
],
|
||||
'roles' => ['admin', 'manager', 'sirsoft-ecommerce.manager'],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
@@ -1035,7 +1165,7 @@ class Module extends AbstractModule
|
||||
return [
|
||||
[
|
||||
'provider_id' => 'g7:core.mail',
|
||||
'scope_type' => \App\Models\IdentityMessageDefinition::SCOPE_PURPOSE,
|
||||
'scope_type' => IdentityMessageDefinition::SCOPE_PURPOSE,
|
||||
'scope_value' => 'checkout_verification',
|
||||
'name' => [
|
||||
'ko' => '결제 시 본인 확인',
|
||||
@@ -1096,12 +1226,176 @@ class Module extends AbstractModule
|
||||
{
|
||||
return [
|
||||
$this->orderConfirmedDefinition(),
|
||||
$this->orderPendingDepositDefinition(),
|
||||
$this->orderShippedDefinition(),
|
||||
$this->orderDeliveredDefinition(),
|
||||
$this->orderCompletedDefinition(),
|
||||
$this->orderCancelledDefinition(),
|
||||
$this->newOrderAdminDefinition(),
|
||||
$this->inquiryReceivedDefinition(),
|
||||
$this->inquiryRepliedDefinition(),
|
||||
$this->mileageExpiringSoonDefinition(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 무통장입금 입금 안내 알림 정의.
|
||||
*
|
||||
* 무통장입금(dbank) 주문 접수 직후 발송. 입금할 계좌·예금주·입금 기한과 함께
|
||||
* 마일리지/예치금 차감 후 실제 입금 필요액(total_due_amount)을 안내한다.
|
||||
* 실제 발송 대상 분기(dbank + 입금 필요액 > 0)는 EcommerceNotificationDataListener 가 담당한다.
|
||||
*/
|
||||
private function orderPendingDepositDefinition(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'order_pending_deposit',
|
||||
'hook_prefix' => 'sirsoft-ecommerce',
|
||||
'name' => ['ko' => '무통장 입금 안내', 'en' => 'Bank Transfer Payment Guide'],
|
||||
'description' => ['ko' => '무통장입금 주문 접수 시 입금 계좌·금액을 고객에게 안내', 'en' => 'Sent to customer with deposit account and amount when a bank-transfer order is placed'],
|
||||
'channels' => ['mail', 'database'],
|
||||
'hooks' => ['sirsoft-ecommerce.order.after_create'],
|
||||
'variables' => [
|
||||
['key' => 'name', 'description' => '수신자 이름'],
|
||||
['key' => 'app_name', 'description' => '사이트 이름'],
|
||||
['key' => 'order_number', 'description' => '주문번호'],
|
||||
['key' => 'deposit_amount', 'description' => '입금 필요 금액 (마일리지/예치금 차감 후)'],
|
||||
['key' => 'bank_name', 'description' => '입금 은행'],
|
||||
['key' => 'account_number', 'description' => '입금 계좌번호'],
|
||||
['key' => 'account_holder', 'description' => '예금주'],
|
||||
['key' => 'depositor_name', 'description' => '입금자명'],
|
||||
['key' => 'deposit_due_at', 'description' => '입금 기한'],
|
||||
['key' => 'order_url', 'description' => '주문 상세 URL'],
|
||||
['key' => 'site_url', 'description' => '사이트 URL'],
|
||||
],
|
||||
'templates' => [
|
||||
[
|
||||
'channel' => 'mail',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => [
|
||||
'ko' => '[{app_name}] 입금 안내 (주문번호: {order_number})',
|
||||
'en' => '[{app_name}] Bank transfer guide (Order #{order_number})',
|
||||
],
|
||||
'body' => [
|
||||
'ko' => '<div style="font-family:\'Malgun Gothic\',sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">입금 안내</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">{name}님, 주문해 주셔서 감사합니다. 아래 계좌로 입금해 주시면 주문이 처리됩니다.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>주문번호:</strong> {order_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>입금 금액:</strong> {deposit_amount}</p>'
|
||||
.'<p style="margin:5px 0"><strong>입금 은행:</strong> {bank_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>계좌번호:</strong> {account_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>예금주:</strong> {account_holder}</p>'
|
||||
.'<p style="margin:5px 0"><strong>입금자명:</strong> {depositor_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>입금 기한:</strong> {deposit_due_at}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">입금 기한 내 미입금 시 주문이 자동 취소될 수 있습니다.</p>'
|
||||
.$this->notificationButton('주문 상세 보기', '{order_url}')
|
||||
.'<hr style="border:none;border-top:1px solid #eee;margin:20px 0">'
|
||||
.'<p style="color:#999;font-size:12px">본 메일은 {app_name}에서 발송되었습니다.</p>'
|
||||
.'</div>',
|
||||
'en' => '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">Bank Transfer Guide</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">Dear {name}, thank you for your order. Please transfer to the account below to complete your order.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>Order Number:</strong> {order_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Amount to Deposit:</strong> {deposit_amount}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Bank:</strong> {bank_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Account Number:</strong> {account_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Account Holder:</strong> {account_holder}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Depositor Name:</strong> {depositor_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Due By:</strong> {deposit_due_at}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">Your order may be cancelled automatically if payment is not received by the due date.</p>'
|
||||
.$this->notificationButton('View Order', '{order_url}')
|
||||
.'<hr style="border:none;border-top:1px solid #eee;margin:20px 0">'
|
||||
.'<p style="color:#999;font-size:12px">This email was sent from {app_name}.</p>'
|
||||
.'</div>',
|
||||
],
|
||||
],
|
||||
[
|
||||
'channel' => 'database',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => ['ko' => '입금 안내', 'en' => 'Bank Transfer Guide'],
|
||||
'body' => [
|
||||
'ko' => '{name}님, 주문번호 {order_number}의 입금 금액은 {deposit_amount} 입니다. ({bank_name} {account_number})',
|
||||
'en' => '{name}, the deposit amount for order {order_number} is {deposit_amount}. ({bank_name} {account_number})',
|
||||
],
|
||||
'click_url' => '{order_url}',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 소멸 예정 마일리지 알림 정의.
|
||||
*/
|
||||
private function mileageExpiringSoonDefinition(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'mileage_expiring_soon',
|
||||
'hook_prefix' => 'sirsoft-ecommerce',
|
||||
'name' => ['ko' => '마일리지 소멸 예정', 'en' => 'Mileage Expiring Soon'],
|
||||
'description' => ['ko' => '마일리지 소멸이 임박한 회원에게 발송', 'en' => 'Sent to members whose mileage is about to expire'],
|
||||
'channels' => ['mail', 'database'],
|
||||
'hooks' => ['sirsoft-ecommerce.mileage.notify_expiring'],
|
||||
'variables' => [
|
||||
['key' => 'name', 'description' => '수신자 이름'],
|
||||
['key' => 'app_name', 'description' => '사이트 이름'],
|
||||
['key' => 'amount', 'description' => '소멸 예정 마일리지'],
|
||||
['key' => 'currency', 'description' => '통화 코드'],
|
||||
['key' => 'expires_date', 'description' => '소멸 예정일'],
|
||||
['key' => 'balance', 'description' => '현재 사용 가능 잔액'],
|
||||
['key' => 'mileage_url', 'description' => '마일리지 내역 URL'],
|
||||
['key' => 'site_url', 'description' => '사이트 URL'],
|
||||
],
|
||||
'templates' => [
|
||||
[
|
||||
'channel' => 'mail',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => [
|
||||
'ko' => '[{app_name}] {amount}점의 마일리지가 곧 소멸됩니다',
|
||||
'en' => '[{app_name}] {amount} mileage points are expiring soon',
|
||||
],
|
||||
'body' => [
|
||||
'ko' => '<div style="font-family:\'Malgun Gothic\',sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">마일리지 소멸 예정 안내</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">{name}님, 보유하신 마일리지 중 일부가 곧 소멸될 예정입니다.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>소멸 예정 마일리지:</strong> {amount}점</p>'
|
||||
.'<p style="margin:5px 0"><strong>소멸 예정일:</strong> {expires_date}</p>'
|
||||
.'<p style="margin:5px 0"><strong>현재 잔액:</strong> {balance}점</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">소멸 전에 마일리지를 사용해 보세요.</p>'
|
||||
.$this->notificationButton('마일리지 내역 보기', '{mileage_url}')
|
||||
.'<hr style="border:none;border-top:1px solid #eee;margin:20px 0">'
|
||||
.'<p style="color:#999;font-size:12px">본 메일은 {app_name}에서 발송되었습니다.</p>'
|
||||
.'</div>',
|
||||
'en' => '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">Mileage Expiring Soon</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">Dear {name}, some of your mileage points are about to expire.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>Expiring Mileage:</strong> {amount}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Expiry Date:</strong> {expires_date}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Current Balance:</strong> {balance}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">Use your mileage before it expires.</p>'
|
||||
.$this->notificationButton('View Mileage', '{mileage_url}')
|
||||
.'<hr style="border:none;border-top:1px solid #eee;margin:20px 0">'
|
||||
.'<p style="color:#999;font-size:12px">This email was sent from {app_name}.</p>'
|
||||
.'</div>',
|
||||
],
|
||||
],
|
||||
[
|
||||
'channel' => 'database',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => ['ko' => '마일리지 소멸 예정 안내', 'en' => 'Mileage Expiring Soon'],
|
||||
'body' => [
|
||||
'ko' => '{name}님, {amount}점의 마일리지가 {expires_date}에 소멸될 예정입니다.',
|
||||
'en' => '{name}, {amount} mileage points will expire on {expires_date}.',
|
||||
],
|
||||
'click_url' => '{mileage_url}',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1113,8 +1407,8 @@ class Module extends AbstractModule
|
||||
return [
|
||||
'type' => 'order_confirmed',
|
||||
'hook_prefix' => 'sirsoft-ecommerce',
|
||||
'name' => ['ko' => '주문 확인', 'en' => 'Order Confirmed'],
|
||||
'description' => ['ko' => '주문 확인 시 고객에게 발송', 'en' => 'Sent to customer when order is confirmed'],
|
||||
'name' => ['ko' => '결제 완료', 'en' => 'Payment Completed'],
|
||||
'description' => ['ko' => '결제 완료 시 고객에게 발송', 'en' => 'Sent to customer when payment is completed'],
|
||||
'channels' => ['mail', 'database'],
|
||||
'hooks' => ['sirsoft-ecommerce.order.after_confirm'],
|
||||
'variables' => [
|
||||
@@ -1124,22 +1418,28 @@ class Module extends AbstractModule
|
||||
['key' => 'total_amount', 'description' => '결제 금액'],
|
||||
['key' => 'order_url', 'description' => '주문 상세 URL'],
|
||||
['key' => 'site_url', 'description' => '사이트 URL'],
|
||||
['key' => 'shipping_recipient_name', 'description' => '수취인 이름'],
|
||||
['key' => 'shipping_country_name', 'description' => '배송국가명'],
|
||||
['key' => 'shipping_address', 'description' => '배송지 주소'],
|
||||
],
|
||||
'templates' => [
|
||||
[
|
||||
'channel' => 'mail',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => [
|
||||
'ko' => '[{app_name}] 주문이 확인되었습니다 (주문번호: {order_number})',
|
||||
'en' => '[{app_name}] Your order has been confirmed (Order #{order_number})',
|
||||
'ko' => '[{app_name}] 결제가 완료되었습니다 (주문번호: {order_number})',
|
||||
'en' => '[{app_name}] Your payment has been completed (Order #{order_number})',
|
||||
],
|
||||
'body' => [
|
||||
'ko' => '<div style="font-family:\'Malgun Gothic\',sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">주문 확인</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">{name}님, 주문해 주셔서 감사합니다.</p>'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">결제 완료</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">{name}님, 결제가 완료되었습니다. 주문해 주셔서 감사합니다.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>주문번호:</strong> {order_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>결제금액:</strong> {total_amount}</p>'
|
||||
.'<p style="margin:5px 0"><strong>받는분:</strong> {shipping_recipient_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>배송국가:</strong> {shipping_country_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>배송지:</strong> {shipping_address}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">주문 상세 내용은 아래 버튼을 클릭하여 확인하실 수 있습니다.</p>'
|
||||
.$this->notificationButton('주문 상세 보기', '{order_url}')
|
||||
@@ -1147,11 +1447,14 @@ class Module extends AbstractModule
|
||||
.'<p style="color:#999;font-size:12px">본 메일은 {app_name}에서 발송되었습니다.</p>'
|
||||
.'</div>',
|
||||
'en' => '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">Order Confirmed</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">Dear {name}, thank you for your order.</p>'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">Payment Completed</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">Dear {name}, your payment has been completed. Thank you for your order.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>Order Number:</strong> {order_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Total Amount:</strong> {total_amount}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Recipient:</strong> {shipping_recipient_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Shipping Country:</strong> {shipping_country_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Shipping Address:</strong> {shipping_address}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">Click the button below to view your order details.</p>'
|
||||
.$this->notificationButton('View Order', '{order_url}')
|
||||
@@ -1163,8 +1466,8 @@ class Module extends AbstractModule
|
||||
[
|
||||
'channel' => 'database',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => ['ko' => '주문이 확인되었습니다', 'en' => 'Your order has been confirmed'],
|
||||
'body' => ['ko' => '{name}님, 주문번호 {order_number}의 주문이 확인되었습니다.', 'en' => '{name}, your order {order_number} has been confirmed.'],
|
||||
'subject' => ['ko' => '결제가 완료되었습니다', 'en' => 'Your payment has been completed'],
|
||||
'body' => ['ko' => '{name}님, 주문번호 {order_number}의 결제가 완료되었습니다.', 'en' => '{name}, payment for your order {order_number} has been completed.'],
|
||||
'click_url' => '{order_url}',
|
||||
],
|
||||
],
|
||||
@@ -1191,6 +1494,9 @@ class Module extends AbstractModule
|
||||
['key' => 'tracking_number', 'description' => '운송장 번호'],
|
||||
['key' => 'order_url', 'description' => '주문 상세 URL'],
|
||||
['key' => 'site_url', 'description' => '사이트 URL'],
|
||||
['key' => 'shipping_recipient_name', 'description' => '수취인 이름'],
|
||||
['key' => 'shipping_country_name', 'description' => '배송국가명'],
|
||||
['key' => 'shipping_address', 'description' => '배송지 주소'],
|
||||
],
|
||||
'templates' => [
|
||||
[
|
||||
@@ -1240,6 +1546,78 @@ class Module extends AbstractModule
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 배송 완료 알림 정의.
|
||||
*/
|
||||
private function orderDeliveredDefinition(): array
|
||||
{
|
||||
return [
|
||||
'type' => 'order_delivered',
|
||||
'hook_prefix' => 'sirsoft-ecommerce',
|
||||
'name' => ['ko' => '배송 완료', 'en' => 'Order Delivered'],
|
||||
'description' => ['ko' => '배송 완료 시 고객에게 발송', 'en' => 'Sent to customer when order is delivered'],
|
||||
'channels' => ['mail', 'database'],
|
||||
'hooks' => ['sirsoft-ecommerce.order.after_deliver'],
|
||||
'variables' => [
|
||||
['key' => 'name', 'description' => '수신자 이름'],
|
||||
['key' => 'app_name', 'description' => '사이트 이름'],
|
||||
['key' => 'order_number', 'description' => '주문번호'],
|
||||
['key' => 'carrier_name', 'description' => '택배사 이름'],
|
||||
['key' => 'tracking_number', 'description' => '운송장 번호'],
|
||||
['key' => 'order_url', 'description' => '주문 상세 URL'],
|
||||
['key' => 'site_url', 'description' => '사이트 URL'],
|
||||
['key' => 'shipping_recipient_name', 'description' => '수취인 이름'],
|
||||
['key' => 'shipping_country_name', 'description' => '배송국가명'],
|
||||
['key' => 'shipping_address', 'description' => '배송지 주소'],
|
||||
],
|
||||
'templates' => [
|
||||
[
|
||||
'channel' => 'mail',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => [
|
||||
'ko' => '[{app_name}] 주문하신 상품이 배송 완료되었습니다 (주문번호: {order_number})',
|
||||
'en' => '[{app_name}] Your order has been delivered (Order #{order_number})',
|
||||
],
|
||||
'body' => [
|
||||
'ko' => '<div style="font-family:\'Malgun Gothic\',sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">배송 완료 안내</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">{name}님, 주문하신 상품의 배송이 완료되었습니다.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>주문번호:</strong> {order_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>택배사:</strong> {carrier_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>운송장번호:</strong> {tracking_number}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">상품을 확인하신 후 주문 상세에서 구매확정을 진행하실 수 있습니다.</p>'
|
||||
.$this->notificationButton('주문 상세 보기', '{order_url}')
|
||||
.'<hr style="border:none;border-top:1px solid #eee;margin:20px 0">'
|
||||
.'<p style="color:#999;font-size:12px">본 메일은 {app_name}에서 발송되었습니다.</p>'
|
||||
.'</div>',
|
||||
'en' => '<div style="font-family:Arial,sans-serif;max-width:600px;margin:0 auto;padding:20px">'
|
||||
.'<h2 style="color:#333;border-bottom:2px solid #4F46E5;padding-bottom:10px">Order Delivered</h2>'
|
||||
.'<p style="color:#555;line-height:1.6">Dear {name}, your order has been delivered.</p>'
|
||||
.'<div style="background:#f8f9fa;padding:15px;border-radius:8px;margin:15px 0">'
|
||||
.'<p style="margin:5px 0"><strong>Order Number:</strong> {order_number}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Carrier:</strong> {carrier_name}</p>'
|
||||
.'<p style="margin:5px 0"><strong>Tracking Number:</strong> {tracking_number}</p>'
|
||||
.'</div>'
|
||||
.'<p style="color:#555;line-height:1.6">After receiving your items, you can confirm your purchase from the order details.</p>'
|
||||
.$this->notificationButton('View Order', '{order_url}')
|
||||
.'<hr style="border:none;border-top:1px solid #eee;margin:20px 0">'
|
||||
.'<p style="color:#999;font-size:12px">This email was sent from {app_name}.</p>'
|
||||
.'</div>',
|
||||
],
|
||||
],
|
||||
[
|
||||
'channel' => 'database',
|
||||
'recipients' => [['type' => 'trigger_user']],
|
||||
'subject' => ['ko' => '상품이 배송 완료되었습니다', 'en' => 'Your order has been delivered'],
|
||||
'body' => ['ko' => '{name}님, 주문번호 {order_number}의 배송이 완료되었습니다.', 'en' => '{name}, your order {order_number} has been delivered.'],
|
||||
'click_url' => '{order_url}',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 구매 확정 알림 정의.
|
||||
*/
|
||||
@@ -1383,7 +1761,11 @@ class Module extends AbstractModule
|
||||
'name' => ['ko' => '신규 주문 관리자 알림', 'en' => 'New Order Admin Notification'],
|
||||
'description' => ['ko' => '신규 주문 접수 시 관리자에게 발송', 'en' => 'Sent to admin when a new order is placed'],
|
||||
'channels' => ['mail', 'database'],
|
||||
'hooks' => ['sirsoft-ecommerce.order.after_create'],
|
||||
// 발송 시점은 결제수단별로 다르다(아래 전용 훅으로 위임):
|
||||
// - 무통장/전액 비현금(0원) 주문: 주문 생성 시점(입금 전이라도 접수 알림 발송이 정상)
|
||||
// - 카드(PG) 주문: 결제완료 시점(주문 생성 시점은 pending_order 라 오발송 — 결제 미완료/이탈 가능)
|
||||
// OrderProcessingService 가 결제수단·결제완료 시점을 판단해 이 전용 훅을 1회 발화한다.
|
||||
'hooks' => ['sirsoft-ecommerce.order.after_admin_notify'],
|
||||
'variables' => [
|
||||
['key' => 'name', 'description' => '수신자(관리자) 이름'],
|
||||
['key' => 'app_name', 'description' => '사이트 이름'],
|
||||
@@ -1611,13 +1993,20 @@ class Module extends AbstractModule
|
||||
MergeCartOnLoginListener::class,
|
||||
ProductInquiryBoardListener::class,
|
||||
SearchProductsListener::class,
|
||||
StockRestoreListener::class,
|
||||
CouponRestoreListener::class,
|
||||
CouponUseListener::class,
|
||||
SeoProductCacheListener::class,
|
||||
SeoCategoryCacheListener::class,
|
||||
SeoSettingsCacheListener::class,
|
||||
OrderConfirmPointListener::class,
|
||||
MileageTransactionListener::class,
|
||||
UserMileageInfoListener::class,
|
||||
UserCurrencyInfoListener::class,
|
||||
UserShippingCountryInfoListener::class,
|
||||
AssignDefaultCurrencyOnRegisterListener::class,
|
||||
AssignDefaultShippingCountryOnRegisterListener::class,
|
||||
UserMileageCleanupListener::class,
|
||||
EcommerceNotificationDataListener::class,
|
||||
OrderStatusNotificationListener::class,
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1646,6 +2035,43 @@ class Module extends AbstractModule
|
||||
'description' => '입금 기한 만료 주문 자동 취소',
|
||||
'enabled_config' => 'sirsoft-ecommerce.order_settings.auto_cancel_expired',
|
||||
],
|
||||
[
|
||||
'command' => 'sirsoft-ecommerce:prune-expired-carts',
|
||||
'schedule' => 'daily',
|
||||
'description' => '보관기간 만료 장바구니 자동 삭제',
|
||||
// cart_expiry_days < 1 시 커맨드 내부 self-guard 로 비활성 (별도 토글 없음)
|
||||
'enabled_config' => null,
|
||||
],
|
||||
[
|
||||
'command' => 'sirsoft-ecommerce:earn-mileage',
|
||||
'schedule' => 'hourly',
|
||||
'description' => '지연 마일리지 적립',
|
||||
'enabled_config' => 'sirsoft-ecommerce.mileage.enabled',
|
||||
],
|
||||
[
|
||||
'command' => 'sirsoft-ecommerce:expire-mileage',
|
||||
'schedule' => 'daily',
|
||||
'description' => '마일리지 자동 소멸',
|
||||
'enabled_config' => 'sirsoft-ecommerce.mileage.expiry_enabled',
|
||||
],
|
||||
[
|
||||
'command' => 'sirsoft-ecommerce:notify-expiring-mileage',
|
||||
'schedule' => 'daily',
|
||||
'description' => '소멸 예정 마일리지 알림',
|
||||
'enabled_config' => 'sirsoft-ecommerce.mileage.expiry_notification_enabled',
|
||||
],
|
||||
[
|
||||
'command' => 'sirsoft-ecommerce:reconcile-mileage-balance',
|
||||
'schedule' => 'daily',
|
||||
'description' => '마일리지 잔액 캐시 정합 교정',
|
||||
'enabled_config' => 'sirsoft-ecommerce.mileage.enabled',
|
||||
],
|
||||
[
|
||||
'command' => 'sirsoft-ecommerce:aggregate-stats',
|
||||
'schedule' => 'hourly',
|
||||
'description' => '대시보드 판매 현황 집계',
|
||||
'enabled_config' => 'sirsoft-ecommerce.dashboard.scheduler_enabled',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1809,11 +2235,16 @@ class Module extends AbstractModule
|
||||
|
||||
$price = $product['selling_price'] ?? null;
|
||||
if ($price !== null && $price !== '') {
|
||||
// 재고 가능 여부 = 판매 상태(sales_status). ProductResource 가 'in_stock' 키를 만들지
|
||||
// 않으므로(실제 키: sales_status enum value + stock_quantity) 종전 in_stock 참조는 항상
|
||||
// 빈값이라 모든 상품이 OutOfStock 으로 출력되던 결함을 sales_status 기준으로 수정.
|
||||
$salesStatus = (string) $this->resolveLocalizedValue($product['sales_status'] ?? '');
|
||||
$inStock = $salesStatus === 'on_sale';
|
||||
$schema['offers'] = [
|
||||
'@type' => 'Offer',
|
||||
'price' => $this->resolveLocalizedValue($price),
|
||||
'priceCurrency' => 'KRW',
|
||||
'availability' => ! empty($product['in_stock']) ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock',
|
||||
'availability' => $inStock ? 'https://schema.org/InStock' : 'https://schema.org/OutOfStock',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1832,6 +2263,63 @@ class Module extends AbstractModule
|
||||
return $schema;
|
||||
}
|
||||
|
||||
/**
|
||||
* OG 기본값 키별 데이터 출처(연결 칩) 메타 선언 — 편집기 전용
|
||||
*
|
||||
* seoOgDefaults() 가 resolve 해 반환하는 평문값이 **어느 상품/카테고리 데이터에서 왔는지**를
|
||||
* 편집기 [검색엔진] 탭이 "상품 대표 이미지"·"상품 이름" 같은 연결 칩으로 보여주고 교체할 수
|
||||
* 있도록, 키별 데이터 경로(표현식)와 사용자용 라벨을 제공합니다. 데이터 경로가 1:1 로 단순한
|
||||
* 키만 선언합니다(파생값 type/extra 는 제외 — 편집기는 평문 폴백).
|
||||
*
|
||||
* @param string $pageType 페이지 타입
|
||||
* @return array<string, array{expr: string, label: array<string, string>}> 키별 데이터 경로 메타
|
||||
*/
|
||||
public function seoOgDefaultMeta(string $pageType): array
|
||||
{
|
||||
// label 은 번역 키 — 번들 언어팩(ja 등)이 같은 키를 번역하면 추가 언어에 자동 대응(편집기가 __() 해석).
|
||||
if ($pageType === 'product') {
|
||||
return [
|
||||
'image' => ['expr' => '{{product.data.thumbnail_url}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_image'],
|
||||
'image_alt' => ['expr' => '{{product.data.name}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_name'],
|
||||
];
|
||||
}
|
||||
|
||||
if ($pageType === 'category') {
|
||||
return [
|
||||
'image' => ['expr' => '{{category.data.thumbnail_url}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.category_image'],
|
||||
'image_alt' => ['expr' => '{{category.data.name}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.category_name'],
|
||||
];
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 구조화 데이터 속성별 데이터 출처(연결 칩) 메타 선언 — 편집기 전용
|
||||
*
|
||||
* seoStructuredData() 의 중첩 객체를 점 경로 키로 평탄화한 기준으로 선언합니다(예: offers.price).
|
||||
* 파생값(offers.availability·aggregateRating.* 등)은 단순 경로가 아니라 제외합니다(평문 폴백).
|
||||
*
|
||||
* @param string $pageType 페이지 타입
|
||||
* @return array<string, array{expr: string, label: array<string, string>}> 점 경로 키별 데이터 경로 메타
|
||||
*/
|
||||
public function seoStructuredDataMeta(string $pageType): array
|
||||
{
|
||||
if ($pageType !== 'product') {
|
||||
return [];
|
||||
}
|
||||
|
||||
// SEO 제목/설명은 사용자 입력 meta(다국어) 우선, 비어있으면 상품명/설명(다국어)으로 폴백.
|
||||
// $localized() 로 현재 로케일 문자열을 추출하여 언어별 SEO 분기를 지원한다.
|
||||
return [
|
||||
'name' => ['expr' => '{{$localized(product.data.meta_title) ?? $localized(product.data.name)}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_name'],
|
||||
'description' => ['expr' => '{{$localized(product.data.meta_description) ?? $localized(product.data.short_description)}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_description'],
|
||||
'image' => ['expr' => '{{product.data.thumbnail_url}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_image'],
|
||||
'sku' => ['expr' => '{{product.data.sku}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_sku'],
|
||||
'offers.price' => ['expr' => '{{product.data.selling_price}}', 'label' => 'sirsoft-ecommerce::seo.auto_value.product_price'],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 관리자 메뉴 정의
|
||||
*/
|
||||
@@ -1958,6 +2446,17 @@ class Module extends AbstractModule
|
||||
'order' => 10,
|
||||
'permission' => 'sirsoft-ecommerce.reviews.read',
|
||||
],
|
||||
[
|
||||
'name' => [
|
||||
'ko' => '마일리지 내역',
|
||||
'en' => 'Mileage History',
|
||||
],
|
||||
'slug' => 'sirsoft-ecommerce-mileage-transactions',
|
||||
'url' => '/admin/ecommerce/mileage-transactions',
|
||||
'icon' => 'fas fa-coins',
|
||||
'order' => 11,
|
||||
'permission' => 'sirsoft-ecommerce.mileage.read',
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user