Browse Source

Product custom fields inputs in settings

Vova Tkach 5 years ago
parent
commit
28b9a73d59
2 changed files with 31 additions and 5 deletions
  1. 2 2
      engine/wrapper/config/config.go
  2. 29 3
      modules/module_settings.go

+ 2 - 2
engine/wrapper/config/config.go

@@ -126,10 +126,10 @@ func (this *Config) configDefault() {
 	this.Shop.Orders.NewOrderEmailThemeUser = "❤️ Thanks for your order"
 
 	this.Shop.CustomFields.Field1.Enabled = 0
-	this.Shop.CustomFields.Field1.Caption = "Custom Field 1"
+	this.Shop.CustomFields.Field1.Caption = "Custom field 1"
 
 	this.Shop.CustomFields.Field2.Enabled = 0
-	this.Shop.CustomFields.Field2.Caption = "Custom Field 2"
+	this.Shop.CustomFields.Field2.Caption = "Custom field 2"
 
 	this.API.XML.Enabled = 0
 	this.API.XML.Name = ""

+ 29 - 3
modules/module_settings.go

@@ -569,6 +569,12 @@ func (this *Modules) RegisterModule_Settings() *Module {
 							`</div>`
 					},
 				},
+				{
+					Kind:    builder.DFKCheckBox,
+					Caption: "Accept orders",
+					Name:    "accept-orders",
+					Value:   utils.IntToStr((*wrap.Config).Shop.Orders.Enabled),
+				},
 				{
 					Kind:    builder.DFKText,
 					Caption: "New order notify email",
@@ -590,9 +596,29 @@ func (this *Modules) RegisterModule_Settings() *Module {
 				},
 				{
 					Kind:    builder.DFKCheckBox,
-					Caption: "Accept orders",
-					Name:    "accept-orders",
-					Value:   utils.IntToStr((*wrap.Config).Shop.Orders.Enabled),
+					Caption: "Custom field 1 enabled",
+					Name:    "custom-field-1-enabled",
+					Value:   utils.IntToStr((*wrap.Config).Shop.CustomFields.Field1.Enabled),
+				},
+				{
+					Kind:    builder.DFKText,
+					Caption: "Custom field 1 caption",
+					Name:    "custom-field-1-caption",
+					Value:   (*wrap.Config).Shop.CustomFields.Field1.Caption,
+					Hint:    "Caption for product custom field",
+				},
+				{
+					Kind:    builder.DFKCheckBox,
+					Caption: "Custom field 2 enabled",
+					Name:    "custom-field-2-enabled",
+					Value:   utils.IntToStr((*wrap.Config).Shop.CustomFields.Field2.Enabled),
+				},
+				{
+					Kind:    builder.DFKText,
+					Caption: "Custom field 2 caption",
+					Name:    "custom-field-2-caption",
+					Value:   (*wrap.Config).Shop.CustomFields.Field2.Caption,
+					Hint:    "Caption for product custom field",
 				},
 				{
 					Kind:   builder.DFKSubmit,