Skip to content

Commit

Permalink
update upselling models
Browse files Browse the repository at this point in the history
  • Loading branch information
xxl4 committed Jul 23, 2024
1 parent 0a4a450 commit 43f671e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 6 deletions.
40 changes: 35 additions & 5 deletions src/Models/UpsellingRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,47 @@ class UpsellingRule extends Model implements UpsellingRuleContract
protected $table = 'upselling_rules';



public const CONDITIONS_TYPE_PRODUCT = 'product';

public const CONDITIONS_TYPE_CATEGORY = 'category';

public const CONDITIONS_TYPE_CART = 'cart';

public const CONDITIONS_TYPE_QUANTITY = 'quantity';

public const CONDITIONS_TYPE_WEIGHT = 'weight';

public const CONDITIONS_TYPE_PRICE = 'price';

public const CONDITIONS_TYPE_CUSTOMER = 'customer';

public const CONDITIONS_TYPE_TIME = 'time';

public const CONDITIONS_TYPE_DATE = 'date';

public const CONDITIONS_TYPE_DAY = 'day';

public const CONDITIONS_TYPE_MONTH = 'month';

public const CONDITIONS_TYPE_YEAR = 'year';


public const CONDITIONS_TYPE = [
'product' => 'Product',
'category' => 'Category',
'cart' => 'Cart',
self::CONDITIONS_TYPE_PRODUCT => 'Product',
self::CONDITIONS_TYPE_CATEGORY => 'Category',
self::CONDITIONS_TYPE_CART => 'Cart',
self::CONDITIONS_TYPE_QUANTITY => 'Quantity',
self::CONDITIONS_TYPE_WEIGHT => 'Weight',
self::CONDITIONS_TYPE_PRICE => 'Price',
self::CONDITIONS_TYPE_CUSTOMER => 'Customer',
self::CONDITIONS_TYPE_TIME => 'Time',
self::CONDITIONS_TYPE_DATE => 'Date',
self::CONDITIONS_TYPE_DAY => 'Day',
self::CONDITIONS_TYPE_MONTH => 'Month',
self::CONDITIONS_TYPE_YEAR => 'Year',
];



public const RULE_TYPE_FIXED = 'fixed';

public const RULE_TYPE_PERCENTAGE = 'percentage';
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/views/Admin/rules/create.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</div>
<div class="form-group">
<label for="conditions">Conditions</label>
<textarea class="form-control" id="conditions" name="conditions" rows="3" placeholder="Enter conditions"></textarea>
<textarea class="form-control" id="conditions" name="conditions" rows="3" placeholder="Enter conditions">{}</textarea>
</div>
<div class="form-group">
<label for="conditions_value">Condition Value</label>
Expand Down

0 comments on commit 43f671e

Please sign in to comment.