Skip to content

Commit

Permalink
Feature - Discount editing (lunarphp#1542)
Browse files Browse the repository at this point in the history
Adds additional discount editing functionality.

- [x] Write tests

---------

Co-authored-by: alecritson <[email protected]>
  • Loading branch information
alecritson and alecritson authored Feb 15, 2024
1 parent 4deab57 commit 5daaccf
Show file tree
Hide file tree
Showing 21 changed files with 1,438 additions and 5 deletions.
304 changes: 304 additions & 0 deletions packages/admin/resources/lang/en/discount.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,317 @@
'plural_label' => 'Discounts',
'label' => 'Discount',
'form' => [
'conditions' => [
'heading' => 'Conditions',
],
'buy_x_get_y' => [
'heading' => 'Buy X Get Y',
],
'amount_off' => [
'heading' => 'Amount Off',
],
'name' => [
'label' => 'Name',
],
'handle' => [
'label' => 'Handle',
],
'starts_at' => [
'label' => 'Start Date',
],
'ends_at' => [
'label' => 'End Date',
],
'priority' => [
'label' => 'Priority',
'helper_text' => 'Discounts with higher priority will be applied first.',
'options' => [
'low' => [
'label' => 'Low',
],
'medium' => [
'label' => 'Low',
],
'high' => [
'label' => 'High',
],
],
],
'stop' => [
'label' => 'Stop other discounts applying after this one',
],
'coupon' => [
'label' => 'Coupon',
'helper_text' => 'Enter the coupon required for the discount to apply, if left blank it will apply automatically.',
],
'max_uses' => [
'label' => 'Max uses',
'helper_text' => 'Leave blank for unlimited uses.',
],
'max_uses_per_user' => [
'label' => 'Max uses per user',
'helper_text' => 'Leave blank for unlimited uses.',
],
'minimum_cart_amount' => [
'label' => 'Minimum Cart Amount',
],
'min_qty' => [
'label' => 'Product Quantity',
'helper_text' => 'Set how many qualifying products are required for the discount to apply.',
],
'reward_qty' => [
'label' => 'No. of free items',
'helper_text' => 'How many of each item are discounted.',
],
'max_reward_qty' => [
'label' => 'Maximum reward quantity',
'helper_text' => 'The maximum amount of products which can be discounted, regardless of criteria.',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'status' => [
'label' => 'Status',
\Lunar\Models\Discount::ACTIVE => [
'label' => 'Active',
],
\Lunar\Models\Discount::PENDING => [
'label' => 'Pending',
],
\Lunar\Models\Discount::EXPIRED => [
'label' => 'Expired',
],
\Lunar\Models\Discount::SCHEDULED => [
'label' => 'Scheduled',
],
],
'type' => [
'label' => 'Type',
],
'starts_at' => [
'label' => 'Start Date',
],
'ends_at' => [
'label' => 'End Date',
],
],
'pages' => [
'availability' => [
'label' => 'Availability',
],
'limitations' => [
'label' => 'Limitations',
],
],
'relationmanagers' => [
'collections' => [
'title' => 'Collections',
'description' => 'Select which collections this discount should be limited to.',
'actions' => [
'attach' => [
'label' => 'Attach Collection',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'type' => [
'label' => 'Type',
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
'form' => [
'type' => [
'options' => [
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
],
],
'brands' => [
'title' => 'Brands',
'description' => 'Select which brands this discount should be limited to.',
'actions' => [
'attach' => [
'label' => 'Attach Brand',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'type' => [
'label' => 'Type',
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
'form' => [
'type' => [
'options' => [
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
],
],
'products' => [
'title' => 'Products',
'description' => 'Select which products this discount should be limited to.',
'actions' => [
'attach' => [
'label' => 'Add Product',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'type' => [
'label' => 'Type',
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
'form' => [
'type' => [
'options' => [
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
],
],
'rewards' => [
'title' => 'Product Rewards',
'description' => 'Select which products will be discounted if they exist in the cart and the above conditions are met.',
'actions' => [
'attach' => [
'label' => 'Add Product',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'type' => [
'label' => 'Type',
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
'form' => [
'type' => [
'options' => [
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
],
],
'conditions' => [
'title' => 'Product Conditions',
'description' => 'Select the products required for the discount to apply.',
'actions' => [
'attach' => [
'label' => 'Add Product',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'type' => [
'label' => 'Type',
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
'form' => [
'type' => [
'options' => [
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
],
],
'productvariants' => [
'title' => 'Product Variants',
'description' => 'Select which product variants this discount should be limited to.',
'actions' => [
'attach' => [
'label' => 'Add Product Variant',
],
],
'table' => [
'name' => [
'label' => 'Name',
],
'sku' => [
'label' => 'SKU',
],
'values' => [
'label' => 'Option(s)',
],
],
'form' => [
'type' => [
'options' => [
'limitation' => [
'label' => 'Limitation',
],
'exclusion' => [
'label' => 'Exclusion',
],
],
],
],
],
],
];
Loading

0 comments on commit 5daaccf

Please sign in to comment.