|
@@ -14,6 +14,14 @@ func (this *Modules) RegisterAction_SettingsShop() *Action {
|
|
|
pf_price_fomat := wrap.R.FormValue("price-fomat")
|
|
|
pf_price_round := wrap.R.FormValue("price-round")
|
|
|
|
|
|
+ pf_require_last_name := wrap.R.FormValue("require-last-name")
|
|
|
+ pf_require_first_name := wrap.R.FormValue("require-first-name")
|
|
|
+ pf_require_second_name := wrap.R.FormValue("require-second-name")
|
|
|
+ pf_require_mobile_phone := wrap.R.FormValue("require-mobile-phone")
|
|
|
+ pf_require_email_address := wrap.R.FormValue("require-email-address")
|
|
|
+ pf_require_delivery := wrap.R.FormValue("require-delivery")
|
|
|
+ pf_require_comment := wrap.R.FormValue("require-comment")
|
|
|
+
|
|
|
if !utils.IsNumeric(pf_price_fomat) {
|
|
|
wrap.MsgError(`Must be integer number`)
|
|
|
return
|
|
@@ -42,9 +50,39 @@ func (this *Modules) RegisterAction_SettingsShop() *Action {
|
|
|
pfi_price_round = 2
|
|
|
}
|
|
|
|
|
|
+ if pf_require_last_name == "" {
|
|
|
+ pf_require_last_name = "0"
|
|
|
+ }
|
|
|
+ if pf_require_first_name == "" {
|
|
|
+ pf_require_first_name = "0"
|
|
|
+ }
|
|
|
+ if pf_require_second_name == "" {
|
|
|
+ pf_require_second_name = "0"
|
|
|
+ }
|
|
|
+ if pf_require_mobile_phone == "" {
|
|
|
+ pf_require_mobile_phone = "0"
|
|
|
+ }
|
|
|
+ if pf_require_email_address == "" {
|
|
|
+ pf_require_email_address = "0"
|
|
|
+ }
|
|
|
+ if pf_require_delivery == "" {
|
|
|
+ pf_require_delivery = "0"
|
|
|
+ }
|
|
|
+ if pf_require_comment == "" {
|
|
|
+ pf_require_comment = "0"
|
|
|
+ }
|
|
|
+
|
|
|
(*wrap.Config).Shop.Price.Format = pfi_price_fomat
|
|
|
(*wrap.Config).Shop.Price.Round = pfi_price_round
|
|
|
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.LastName = utils.StrToInt(pf_require_last_name)
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.FirstName = utils.StrToInt(pf_require_first_name)
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.SecondName = utils.StrToInt(pf_require_second_name)
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.MobilePhone = utils.StrToInt(pf_require_mobile_phone)
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.EmailAddress = utils.StrToInt(pf_require_email_address)
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.Delivery = utils.StrToInt(pf_require_delivery)
|
|
|
+ (*wrap.Config).Shop.Orders.RequiredFields.Comment = utils.StrToInt(pf_require_comment)
|
|
|
+
|
|
|
if err := wrap.ConfigSave(); err != nil {
|
|
|
wrap.MsgError(err.Error())
|
|
|
return
|