Adding FilterProducts rules to tag rule UI

This commit is contained in:
Rob Harrington
2016-04-27 15:01:52 +10:00
parent 1cb51b5c71
commit eedb2854ec
7 changed files with 69 additions and 4 deletions

View File

@@ -26,6 +26,9 @@ angular.module("admin.tagRules").controller "TagRulesCtrl", ($scope, $http, ente
when "FilterShippingMethods"
newRule.peferred_shipping_method_tags = []
newRule.preferred_matched_shipping_methods_visibility = "visible"
when "FilterProducts"
newRule.peferred_variant_tags = []
newRule.preferred_matched_variants_visibility = "visible"
tagGroup.rules.push(newRule)
updateRuleCounts()

View File

@@ -7,10 +7,11 @@ angular.module("admin.tagRules").directive 'newTagRuleDialog', ($compile, $templ
scope.ruleTypes = [
# { id: "DiscountOrder", name: 'Apply a discount to orders' }
{ id: "FilterShippingMethods", name: 'Show/Hide shipping methods' }
{ id: "FilterProducts", name: 'Show or Hide variants in my shopfront' }
{ id: "FilterShippingMethods", name: 'Show or Hide shipping methods at checkout' }
]
scope.ruleType = "DiscountOrder"
scope.ruleType = scope.ruleTypes[0].id
# Set Dialog options
template.dialog

View File

@@ -0,0 +1,4 @@
angular.module("admin.tagRules").directive "filterProducts", ->
restrict: "E"
replace: true
templateUrl: "admin/tag_rules/filter_products.html"