module_shop_order.go 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. package modules
  2. import (
  3. "golang-fave/engine/wrapper"
  4. // "golang-fave/utils"
  5. )
  6. func (this *Modules) RegisterAction_ShopOrder() *Action {
  7. return this.newAction(AInfo{
  8. WantDB: true,
  9. Mount: "shop-order",
  10. WantAdmin: false,
  11. }, func(wrap *wrapper.Wrapper) {
  12. // pf_id := wrap.R.FormValue("id")
  13. // pf_client_last_name := wrap.R.FormValue("client_last_name")
  14. // pf_client_first_name := wrap.R.FormValue("client_first_name")
  15. // pf_client_second_name := wrap.R.FormValue("client_second_name")
  16. // pf_client_phone := wrap.R.FormValue("client_phone")
  17. // pf_client_email := wrap.R.FormValue("client_email")
  18. // pf_client_delivery_comment := wrap.R.FormValue("client_delivery_comment")
  19. // pf_client_order_comment := wrap.R.FormValue("client_order_comment")
  20. wrap.MsgError(`OK!`)
  21. return
  22. // if !utils.IsNumeric(pf_id) {
  23. // wrap.MsgError(`Inner system error`)
  24. // return
  25. // }
  26. // if err := wrap.DB.Transaction(func(tx *wrapper.Tx) error {
  27. // if _, err := tx.Exec(`
  28. // UPDATE shop_products SET
  29. // parent_id = NULL,
  30. // active = 0
  31. // WHERE
  32. // id = ?
  33. // ;`,
  34. // utils.StrToInt(pf_id),
  35. // ); err != nil {
  36. // return err
  37. // }
  38. // return nil
  39. // }); err != nil {
  40. // wrap.MsgError(err.Error())
  41. // return
  42. // }
  43. // wrap.RecreateProductXmlFile()
  44. // wrap.ResetCacheBlocks()
  45. // // Reload current page
  46. // wrap.Write(`window.location.reload(false);`)
  47. })
  48. }