Exemplo n.º 1
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "webapi",
			Label:     `Otnegam Web API`,
			SortOrder: 102,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Webapi::config_webapi
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "soap",
					Label:     `SOAP Settings`,
					SortOrder: 1,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: webapi/soap/charset
							ID:        "charset",
							Label:     `Default Response Charset`,
							Comment:   element.LongText(`If empty, UTF-8 will be used.`),
							Type:      element.TypeText,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 2
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "payment",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "vault",
					Label:     `Vault Provider`,
					SortOrder: 2,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/vault/vault_payment
							ID:      "vault_payment",
							Label:   `Vault Provider`,
							Comment: element.LongText(`Specified provider should be enabled.`),
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Vault\Model\Adminhtml\Source\VaultProvidersMap
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "payment",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "vault",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/vault/debug
							ID:      `debug`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/vault/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Vault\Model\VaultPaymentInterface`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 3
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "dev",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "js",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: dev/js/session_storage_logging
							ID:        "session_storage_logging",
							Label:     `Log JS Errors to Session Storage`,
							Comment:   element.LongText(`If enabled, can be used by functional tests for extended reporting`),
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: dev/js/session_storage_key
							ID:        "session_storage_key",
							Label:     `Log JS Errors to Session Storage Key`,
							Comment:   element.LongText(`Use this key to retrieve collected js errors`),
							Type:      element.TypeText,
							SortOrder: 110,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `collected_errors`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 4
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "cron",
					Label:     `Cron (Scheduled Tasks) - all the times are in minutes`,
					Comment:   element.LongText(`For correct URLs generated during cron runs please make sure that Web > Secure and Unsecure Base URLs are explicitly set.`),
					SortOrder: 15,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields:    element.NewFieldSlice(),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 5
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "cataloginventory",
			Label:     `Inventory`,
			SortOrder: 50,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_CatalogInventory::cataloginventory
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "options",
					Label:     `Stock Options`,
					SortOrder: 1,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: cataloginventory/options/can_subtract
							ID:        "can_subtract",
							Label:     `Decrease Stock When Order is Placed`,
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: cataloginventory/options/can_back_in_stock
							ID:        "can_back_in_stock",
							Label:     `Set Items' Status to be In Stock When Order is Cancelled`,
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: cataloginventory/options/show_out_of_stock
							ID:        "show_out_of_stock",
							Label:     `Display Out of Stock Products`,
							Comment:   element.LongText(`Products will still be shown by direct product URLs.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// BackendModel: Otnegam\CatalogInventory\Model\Config\Backend\ShowOutOfStock
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: cataloginventory/options/stock_threshold_qty
							ID:        "stock_threshold_qty",
							Label:     `Only X left Threshold`,
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: cataloginventory/options/display_product_stock_status
							ID:        "display_product_stock_status",
							Label:     `Display Products Availability in Stock on Storefront`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "item_options",
					Label:     `Product Stock Options`,
					Comment:   element.LongText(`Please note that these settings apply to individual items in the cart, not to the entire cart.`),
					SortOrder: 10,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: cataloginventory/item_options/manage_stock
							ID:        "manage_stock",
							Label:     `Manage Stock`,
							Comment:   element.LongText(`Changing can take some time due to processing whole catalog.`),
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   true,
							// BackendModel: Otnegam\CatalogInventory\Model\Config\Backend\Managestock
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: cataloginventory/item_options/backorders
							ID:        "backorders",
							Label:     `Backorders`,
							Comment:   element.LongText(`Changing can take some time due to processing whole catalog.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// BackendModel: Otnegam\CatalogInventory\Model\Config\Backend\Backorders
							// SourceModel: Otnegam\CatalogInventory\Model\Source\Backorders
						},

						&element.Field{
							// Path: cataloginventory/item_options/max_sale_qty
							ID:        "max_sale_qty",
							Label:     `Maximum Qty Allowed in Shopping Cart`,
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   10000,
						},

						&element.Field{
							// Path: cataloginventory/item_options/min_qty
							ID:        "min_qty",
							Label:     `Out-of-Stock Threshold`,
							Type:      element.TypeText,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\CatalogInventory\Model\System\Config\Backend\Minqty
						},

						&element.Field{
							// Path: cataloginventory/item_options/min_sale_qty
							ID:        "min_sale_qty",
							Label:     `Minimum Qty Allowed in Shopping Cart`,
							Type:      element.Type,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   1,
							// BackendModel: Otnegam\CatalogInventory\Model\System\Config\Backend\Minsaleqty
						},

						&element.Field{
							// Path: cataloginventory/item_options/notify_stock_qty
							ID:        "notify_stock_qty",
							Label:     `Notify for Quantity Below`,
							Type:      element.TypeText,
							SortOrder: 7,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   1,
						},

						&element.Field{
							// Path: cataloginventory/item_options/auto_return
							ID:        "auto_return",
							Label:     `Automatically Return Credit Memo Item to Stock`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: cataloginventory/item_options/enable_qty_increments
							ID:        "enable_qty_increments",
							Label:     `Enable Qty Increments`,
							Type:      element.TypeSelect,
							SortOrder: 8,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: cataloginventory/item_options/qty_increments
							ID:        "qty_increments",
							Label:     `Qty Increments`,
							Type:      element.TypeText,
							SortOrder: 9,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   1,
							// BackendModel: Otnegam\CatalogInventory\Model\System\Config\Backend\Qtyincrements
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 6
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "sales",
			Label:     `Sales`,
			SortOrder: 300,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Sales::config_sales
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "general",
					Label:     `General`,
					SortOrder: 5,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/general/hide_customer_ip
							ID:      "hide_customer_ip",
							Label:   `Hide Customer IP`,
							Comment: element.LongText(`Choose whether a customer IP is shown in orders, invoices, shipments, and credit memos.`),
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "totals_sort",
					Label:     `Checkout Totals Sort Order`,
					SortOrder: 10,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/totals_sort/discount
							ID:        "discount",
							Label:     `Discount`,
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   20,
						},

						&element.Field{
							// Path: sales/totals_sort/grand_total
							ID:        "grand_total",
							Label:     `Grand Total`,
							Type:      element.TypeText,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   100,
						},

						&element.Field{
							// Path: sales/totals_sort/shipping
							ID:        "shipping",
							Label:     `Shipping`,
							Type:      element.TypeText,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   30,
						},

						&element.Field{
							// Path: sales/totals_sort/subtotal
							ID:        "subtotal",
							Label:     `Subtotal`,
							Type:      element.TypeText,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   10,
						},

						&element.Field{
							// Path: sales/totals_sort/tax
							ID:        "tax",
							Label:     `Tax`,
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   40,
						},
					),
				},

				&element.Group{
					ID:        "reorder",
					Label:     `Reorder`,
					SortOrder: 20,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/reorder/allow
							ID:        "allow",
							Label:     `Allow Reorder`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "identity",
					Label:     `Invoice and Packing Slip Design`,
					SortOrder: 40,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/identity/logo
							ID:        "logo",
							Label:     `Logo for PDF Print-outs (200x50)`,
							Comment:   element.LongText(`Your default logo will be used in PDF and HTML documents.<br />(jpeg, tiff, png) If your pdf image is distorted, try to use larger file-size image.`),
							Type:      element.TypeImage,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Image\Pdf
						},

						&element.Field{
							// Path: sales/identity/logo_html
							ID:        "logo_html",
							Label:     `Logo for HTML Print View`,
							Comment:   element.LongText(`Logo for HTML documents only. If empty, default will be used.<br />(jpeg, gif, png)`),
							Type:      element.TypeImage,
							SortOrder: 150,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Image
						},

						&element.Field{
							// Path: sales/identity/address
							ID:        "address",
							Label:     `Address`,
							Type:      element.TypeTextarea,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "minimum_order",
					Label:     `Minimum Order Amount`,
					SortOrder: 50,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/minimum_order/active
							ID:        "active",
							Label:     `Enable`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales/minimum_order/amount
							ID:        "amount",
							Label:     `Minimum Amount`,
							Comment:   element.LongText(`Subtotal after discount`),
							Type:      element.Type,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: sales/minimum_order/tax_including
							ID:        "tax_including",
							Label:     `Include Tax to Amount`,
							Type:      element.TypeSelect,
							SortOrder: 15,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales/minimum_order/description
							ID:        "description",
							Label:     `Description Message`,
							Comment:   element.LongText(`This message will be shown in the shopping cart when the subtotal (after discount) is lower than the minimum allowed amount.`),
							Type:      element.TypeTextarea,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales/minimum_order/error_message
							ID:        "error_message",
							Label:     `Error to Show in Shopping Cart`,
							Type:      element.TypeTextarea,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales/minimum_order/multi_address
							ID:        "multi_address",
							Label:     `Validate Each Address Separately in Multi-address Checkout`,
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales/minimum_order/multi_address_description
							ID:        "multi_address_description",
							Label:     `Multi-address Description Message`,
							Comment:   element.LongText(`We'll use the default description above if you leave this empty.`),
							Type:      element.TypeTextarea,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales/minimum_order/multi_address_error_message
							ID:        "multi_address_error_message",
							Label:     `Multi-address Error to Show in Shopping Cart`,
							Comment:   element.LongText(`We'll use the default error above if you leave this empty.`),
							Type:      element.TypeTextarea,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "dashboard",
					Label:     `Dashboard`,
					SortOrder: 60,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/dashboard/use_aggregated_data
							ID:        "use_aggregated_data",
							Label:     `Use Aggregated Data (beta)`,
							Comment:   element.LongText(`Improves dashboard performance but provides non-realtime data.`),
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "orders",
					Label:     `Orders Cron Settings`,
					SortOrder: 70,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/orders/delete_pending_after
							ID:        "delete_pending_after",
							Label:     `Pending Payment Order Lifetime (minutes)`,
							Type:      element.TypeText,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   480,
						},
					),
				},
			),
		},
		&element.Section{
			ID:        "sales_email",
			Label:     `Sales Emails`,
			SortOrder: 301,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Sales::sales_email
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:    "general",
					Label: `General Settings`,
					Scope: scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/general/async_sending
							ID:        "async_sending",
							Label:     `Asynchronous sending`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// BackendModel: Otnegam\Sales\Model\Config\Backend\Email\AsyncSending
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},
					),
				},

				&element.Group{
					ID:        "order",
					Label:     `Order`,
					SortOrder: 1,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/order/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/order/identity
							ID:        "identity",
							Label:     `New Order Confirmation Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/order/template
							ID:        "template",
							Label:     `New Order Confirmation Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_order_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/order/guest_template
							ID:        "guest_template",
							Label:     `New Order Confirmation Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_order_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/order/copy_to
							ID:        "copy_to",
							Label:     `Send Order Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/order/copy_method
							ID:        "copy_method",
							Label:     `Send Order Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "order_comment",
					Label:     `Order Comments`,
					SortOrder: 2,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/order_comment/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/order_comment/identity
							ID:        "identity",
							Label:     `Order Comment Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/order_comment/template
							ID:        "template",
							Label:     `Order Comment Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_order_comment_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/order_comment/guest_template
							ID:        "guest_template",
							Label:     `Order Comment Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_order_comment_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/order_comment/copy_to
							ID:        "copy_to",
							Label:     `Send Order Comment Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/order_comment/copy_method
							ID:        "copy_method",
							Label:     `Send Order Comments Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "invoice",
					Label:     `Invoice`,
					SortOrder: 3,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/invoice/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/invoice/identity
							ID:        "identity",
							Label:     `Invoice Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/invoice/template
							ID:        "template",
							Label:     `Invoice Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_invoice_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/invoice/guest_template
							ID:        "guest_template",
							Label:     `Invoice Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_invoice_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/invoice/copy_to
							ID:        "copy_to",
							Label:     `Send Invoice Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/invoice/copy_method
							ID:        "copy_method",
							Label:     `Send Invoice Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "invoice_comment",
					Label:     `Invoice Comments`,
					SortOrder: 4,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/invoice_comment/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/invoice_comment/identity
							ID:        "identity",
							Label:     `Invoice Comment Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/invoice_comment/template
							ID:        "template",
							Label:     `Invoice Comment Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_invoice_comment_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/invoice_comment/guest_template
							ID:        "guest_template",
							Label:     `Invoice Comment Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_invoice_comment_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/invoice_comment/copy_to
							ID:        "copy_to",
							Label:     `Send Invoice Comment Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/invoice_comment/copy_method
							ID:        "copy_method",
							Label:     `Send Invoice Comments Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "shipment",
					Label:     `Shipment`,
					SortOrder: 5,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/shipment/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/shipment/identity
							ID:        "identity",
							Label:     `Shipment Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/shipment/template
							ID:        "template",
							Label:     `Shipment Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_shipment_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/shipment/guest_template
							ID:        "guest_template",
							Label:     `Shipment Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_shipment_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/shipment/copy_to
							ID:        "copy_to",
							Label:     `Send Shipment Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/shipment/copy_method
							ID:        "copy_method",
							Label:     `Send Shipment Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "shipment_comment",
					Label:     `Shipment Comments`,
					SortOrder: 6,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/shipment_comment/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/shipment_comment/identity
							ID:        "identity",
							Label:     `Shipment Comment Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/shipment_comment/template
							ID:        "template",
							Label:     `Shipment Comment Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_shipment_comment_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/shipment_comment/guest_template
							ID:        "guest_template",
							Label:     `Shipment Comment Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_shipment_comment_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/shipment_comment/copy_to
							ID:        "copy_to",
							Label:     `Send Shipment Comment Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/shipment_comment/copy_method
							ID:        "copy_method",
							Label:     `Send Shipment Comments Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "creditmemo",
					Label:     `Credit Memo`,
					SortOrder: 7,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/creditmemo/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/creditmemo/identity
							ID:        "identity",
							Label:     `Credit Memo Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/creditmemo/template
							ID:        "template",
							Label:     `Credit Memo Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_creditmemo_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/creditmemo/guest_template
							ID:        "guest_template",
							Label:     `Credit Memo Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_creditmemo_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/creditmemo/copy_to
							ID:        "copy_to",
							Label:     `Send Credit Memo Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/creditmemo/copy_method
							ID:        "copy_method",
							Label:     `Send Credit Memo Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},

				&element.Group{
					ID:        "creditmemo_comment",
					Label:     `Credit Memo Comments`,
					SortOrder: 8,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_email/creditmemo_comment/enabled
							ID:      "enabled",
							Label:   `Enabled`,
							Type:    element.TypeSelect,
							Visible: element.VisibleYes,
							Scope:   scope.PermAll,
							Default: true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales_email/creditmemo_comment/identity
							ID:        "identity",
							Label:     `Credit Memo Comment Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sales_email/creditmemo_comment/template
							ID:        "template",
							Label:     `Credit Memo Comment Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_creditmemo_comment_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/creditmemo_comment/guest_template
							ID:        "guest_template",
							Label:     `Credit Memo Comment Email Template for Guest`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `sales_email_creditmemo_comment_guest_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sales_email/creditmemo_comment/copy_to
							ID:        "copy_to",
							Label:     `Send Credit Memo Comment Email Copy To`,
							Comment:   element.LongText(`Comma-separated`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sales_email/creditmemo_comment/copy_method
							ID:        "copy_method",
							Label:     `Send Credit Memo Comments Email Copy Method`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `bcc`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Method
						},
					),
				},
			),
		},
		&element.Section{
			ID:        "sales_pdf",
			Label:     `PDF Print-outs`,
			SortOrder: 302,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Sales::sales_pdf
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "invoice",
					Label:     `Invoice`,
					SortOrder: 10,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_pdf/invoice/put_order_id
							ID:        "put_order_id",
							Label:     `Display Order ID in Header`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "shipment",
					Label:     `Shipment`,
					SortOrder: 20,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_pdf/shipment/put_order_id
							ID:        "put_order_id",
							Label:     `Display Order ID in Header`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "creditmemo",
					Label:     `Credit Memo`,
					SortOrder: 30,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales_pdf/creditmemo/put_order_id
							ID:        "put_order_id",
							Label:     `Display Order ID in Header`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},
		&element.Section{
			ID: "rss",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "order",
					Label:     `Order`,
					SortOrder: 4,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: rss/order/status
							ID:        "status",
							Label:     `Customer Order Status Notification`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},
					),
				},
			),
		},
		&element.Section{
			ID: "dev",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "grid",
					Label:     `Grid Settings`,
					SortOrder: 131,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: dev/grid/async_indexing
							ID:        "async_indexing",
							Label:     `Asynchronous indexing`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// BackendModel: Otnegam\Sales\Model\Config\Backend\Grid\AsyncIndexing
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 7
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "carriers",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "ups",
					Label:     `UPS`,
					SortOrder: 100,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: carriers/ups/access_license_number
							ID:        "access_license_number",
							Label:     `Access License Number`,
							Type:      element.TypeObscure,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/ups/active
							ID:        "active",
							Label:     `Enabled for Checkout`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/ups/active_rma
							ID:        "active_rma",
							Label:     `Enabled for RMA`,
							Type:      element.TypeSelect,
							SortOrder: 15,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/ups/allowed_methods
							ID:         "allowed_methods",
							Label:      `Allowed Methods`,
							Type:       element.TypeMultiselect,
							SortOrder:  170,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							CanBeEmpty: true,
							Default:    `1DM,1DML,1DA,1DAL,1DAPI,1DP,1DPL,2DM,2DML,2DA,2DAL,3DS,GND,GNDCOM,GNDRES,STD,XPR,WXS,XPRL,XDM,XDML,XPD,01,02,03,07,08,11,12,14,54,59,65`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\Method
						},

						&element.Field{
							// Path: carriers/ups/shipment_requesttype
							ID:        "shipment_requesttype",
							Label:     `Packages Request Type`,
							Type:      element.TypeSelect,
							SortOrder: 47,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Shipping\Model\Config\Source\Online\Requesttype
						},

						&element.Field{
							// Path: carriers/ups/container
							ID:        "container",
							Label:     `Container`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `CP`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\Container
						},

						&element.Field{
							// Path: carriers/ups/free_shipping_enable
							ID:        "free_shipping_enable",
							Label:     `Free Shipping Amount Threshold`,
							Type:      element.TypeSelect,
							SortOrder: 210,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},

						&element.Field{
							// Path: carriers/ups/free_shipping_subtotal
							ID:        "free_shipping_subtotal",
							Label:     `Free Shipping Amount Threshold`,
							Type:      element.TypeText,
							SortOrder: 220,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/ups/dest_type
							ID:        "dest_type",
							Label:     `Destination Type`,
							Type:      element.TypeSelect,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `RES`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\DestType
						},

						&element.Field{
							// Path: carriers/ups/free_method
							ID:        "free_method",
							Label:     `Free Method`,
							Type:      element.TypeSelect,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `GND`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\Freemethod
						},

						&element.Field{
							// Path: carriers/ups/gateway_url
							ID:        "gateway_url",
							Label:     `Gateway URL`,
							Type:      element.TypeText,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `http://www.ups.com/using/services/rave/qcostcgi.cgi`,
						},

						&element.Field{
							// Path: carriers/ups/gateway_xml_url
							ID:        "gateway_xml_url",
							Label:     `Gateway XML URL`,
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `https://onlinetools.ups.com/ups.app/xml/Rate`,
						},

						&element.Field{
							// Path: carriers/ups/handling_type
							ID:        "handling_type",
							Label:     `Calculate Handling Fee`,
							Type:      element.TypeSelect,
							SortOrder: 110,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `F`,
							// SourceModel: Otnegam\Shipping\Model\Source\HandlingType
						},

						&element.Field{
							// Path: carriers/ups/handling_action
							ID:        "handling_action",
							Label:     `Handling Applied`,
							Type:      element.TypeSelect,
							SortOrder: 120,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `O`,
							// SourceModel: Otnegam\Shipping\Model\Source\HandlingAction
						},

						&element.Field{
							// Path: carriers/ups/handling_fee
							ID:        "handling_fee",
							Label:     `Handling Fee`,
							Type:      element.TypeText,
							SortOrder: 130,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/ups/max_package_weight
							ID:        "max_package_weight",
							Label:     `Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)`,
							Type:      element.TypeText,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   150,
						},

						&element.Field{
							// Path: carriers/ups/min_package_weight
							ID:        "min_package_weight",
							Label:     `Minimum Package Weight (Please consult your shipping carrier for minimum supported shipping weight)`,
							Type:      element.TypeText,
							SortOrder: 90,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   0.1,
						},

						&element.Field{
							// Path: carriers/ups/origin_shipment
							ID:        "origin_shipment",
							Label:     `Origin of the Shipment`,
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `Shipments Originating in United States`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\OriginShipment
						},

						&element.Field{
							// Path: carriers/ups/password
							ID:        "password",
							Label:     `Password`,
							Type:      element.TypeObscure,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/ups/pickup
							ID:        "pickup",
							Label:     `Pickup Method`,
							Type:      element.TypeSelect,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `CC`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\Pickup
						},

						&element.Field{
							// Path: carriers/ups/sort_order
							ID:        "sort_order",
							Label:     `Sort Order`,
							Type:      element.TypeText,
							SortOrder: 1000,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/ups/title
							ID:        "title",
							Label:     `Title`,
							Type:      element.TypeText,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `United Parcel Service`,
						},

						&element.Field{
							// Path: carriers/ups/tracking_xml_url
							ID:        "tracking_xml_url",
							Label:     `Tracking XML URL`,
							Type:      element.TypeText,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `https://www.ups.com/ups.app/xml/Track`,
						},

						&element.Field{
							// Path: carriers/ups/type
							ID:        "type",
							Label:     `UPS Type`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `UPS`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\Type
						},

						&element.Field{
							// Path: carriers/ups/is_account_live
							ID:        "is_account_live",
							Label:     `Live Account`,
							Type:      element.TypeSelect,
							SortOrder: 25,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/ups/unit_of_measure
							ID:        "unit_of_measure",
							Label:     `Weight Unit`,
							Type:      element.TypeSelect,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `LBS`,
							// SourceModel: Otnegam\Ups\Model\Config\Source\Unitofmeasure
						},

						&element.Field{
							// Path: carriers/ups/username
							ID:        "username",
							Label:     `User ID`,
							Type:      element.TypeObscure,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/ups/negotiated_active
							ID:        "negotiated_active",
							Label:     `Enable Negotiated Rates`,
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/ups/shipper_number
							ID:        "shipper_number",
							Label:     `Shipper Number`,
							Comment:   element.LongText(`Required for negotiated rates; 6-character UPS`),
							Type:      element.TypeText,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/ups/sallowspecific
							ID:        "sallowspecific",
							Label:     `Ship to Applicable Countries`,
							Type:      element.TypeSelect,
							SortOrder: 900,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Shipping\Model\Config\Source\Allspecificcountries
						},

						&element.Field{
							// Path: carriers/ups/specificcountry
							ID:         "specificcountry",
							Label:      `Ship to Specific Countries`,
							Type:       element.TypeMultiselect,
							SortOrder:  910,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							CanBeEmpty: true,
							// SourceModel: Otnegam\Directory\Model\Config\Source\Country
						},

						&element.Field{
							// Path: carriers/ups/showmethod
							ID:        "showmethod",
							Label:     `Show Method if Not Applicable`,
							Type:      element.TypeSelect,
							SortOrder: 920,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/ups/specificerrmsg
							ID:        "specificerrmsg",
							Label:     `Displayed Error Message`,
							Type:      element.TypeTextarea,
							SortOrder: 800,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.`,
						},

						&element.Field{
							// Path: carriers/ups/mode_xml
							ID:        "mode_xml",
							Label:     `Mode`,
							Comment:   element.LongText(`This enables or disables SSL verification of the Otnegam server by UPS.`),
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// SourceModel: Otnegam\Shipping\Model\Config\Source\Online\Mode
						},

						&element.Field{
							// Path: carriers/ups/debug
							ID:        "debug",
							Label:     `Debug`,
							Type:      element.TypeSelect,
							SortOrder: 920,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "carriers",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "ups",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: carriers/ups/cutoff_cost
							ID:      `cutoff_cost`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: carriers/ups/handling
							ID:      `handling`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: carriers/ups/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Ups\Model\Carrier`,
						},

						&element.Field{
							// Path: carriers/ups/is_online
							ID:      `is_online`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 8
0
// test package names are different.
var configStructure = element.MustNewConfiguration(
	&element.Section{
		ID: "web",
		Groups: element.NewGroupSlice(
			&element.Group{
				ID:        "cors",
				Label:     `CORS Cross Origin Resource Sharing`,
				SortOrder: 150,
				Scope:     scope.NewPerm(scope.DefaultID),
				Fields: element.NewFieldSlice(
					&element.Field{
						// Path: `web/cors/exposed_headers`,
						ID:        "exposed_headers",
						Label:     `Exposed Headers`,
						Comment:   element.LongText(`Indicates which headers are safe to expose to the API of a CORS API specification. Separate via line break`),
						Type:      element.TypeTextarea,
						SortOrder: 10,
						Visible:   element.VisibleYes,
						Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						Default:   "Content-Type,X-CoreStore-ID",
					},
					&element.Field{
						// Path: `web/cors/allowed_origins`,
						ID:        "allowed_origins",
						Label:     `Allowed Origins`,
						Comment:   element.LongText(`Is a list of origins a cross-domain request can be executed from.`),
						Type:      element.TypeTextarea,
						SortOrder: 20,
						Visible:   element.VisibleYes,
						Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
Exemplo n.º 9
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "catalog",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "recently_products",
					Label:     `Recently Viewed/Compared Products`,
					SortOrder: 350,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/recently_products/scope
							ID:        "scope",
							Label:     `Show for Current`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `website`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Reports\Scope
						},

						&element.Field{
							// Path: catalog/recently_products/viewed_count
							ID:        "viewed_count",
							Label:     `Default Recently Viewed Products Count`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   5,
						},

						&element.Field{
							// Path: catalog/recently_products/compared_count
							ID:        "compared_count",
							Label:     `Default Recently Compared Products Count`,
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   5,
						},
					),
				},
			),
		},
		&element.Section{
			ID:        "reports",
			Label:     `Reports`,
			SortOrder: 1000,
			Scope:     scope.NewPerm(scope.DefaultID),
			Resource:  0, // Otnegam_Reports::reports
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "dashboard",
					Label:     `Dashboard`,
					SortOrder: 1,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: reports/dashboard/ytd_start
							ID:        "ytd_start",
							Label:     `Year-To-Date Starts`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `1,1`,
						},

						&element.Field{
							// Path: reports/dashboard/mtd_start
							ID:        "mtd_start",
							Label:     `Current Month Starts`,
							Comment:   element.LongText(`Select day of the month.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   true,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 10
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "wishlist",
			Label:     `Wish List`,
			SortOrder: 140,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Wishlist::config_wishlist
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "email",
					Label:     `Share Options`,
					SortOrder: 2,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: wishlist/email/email_identity
							ID:        "email_identity",
							Label:     `Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `general`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: wishlist/email/email_template
							ID:        "email_template",
							Label:     `Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `wishlist_email_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: wishlist/email/number_limit
							ID:        "number_limit",
							Label:     `Max Emails Allowed to be Sent`,
							Comment:   element.LongText(`10 by default. Max - 10000`),
							Type:      element.TypeText,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   10,
						},

						&element.Field{
							// Path: wishlist/email/text_limit
							ID:        "text_limit",
							Label:     `Email Text Length Limit`,
							Comment:   element.LongText(`255 by default`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   255,
						},
					),
				},

				&element.Group{
					ID:        "general",
					Label:     `General Options`,
					SortOrder: 1,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: wishlist/general/active
							ID:        "active",
							Label:     `Enabled`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "wishlist_link",
					Label:     `My Wish List Link`,
					SortOrder: 3,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: wishlist/wishlist_link/use_qty
							ID:        "use_qty",
							Label:     `Display Wish List Summary`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Wishlist\Model\Config\Source\Summary
						},
					),
				},
			),
		},
		&element.Section{
			ID: "rss",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "wishlist",
					Label:     `Wish List`,
					SortOrder: 2,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: rss/wishlist/active
							ID:        "active",
							Label:     `Enable RSS`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 11
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "carriers",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "fedex",
					Label:     `FedEx`,
					SortOrder: 120,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: carriers/fedex/active
							ID:        "active",
							Label:     `Enabled for Checkout`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/fedex/active_rma
							ID:        "active_rma",
							Label:     `Enabled for RMA`,
							Type:      element.TypeSelect,
							SortOrder: 15,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/fedex/title
							ID:        "title",
							Label:     `Title`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `Federal Express`,
						},

						&element.Field{
							// Path: carriers/fedex/account
							ID:        "account",
							Label:     `Account ID`,
							Comment:   element.LongText(`Please make sure to use only digits here. No dashes are allowed.`),
							Type:      element.TypeObscure,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/fedex/meter_number
							ID:        "meter_number",
							Label:     `Meter Number`,
							Type:      element.TypeObscure,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/fedex/key
							ID:        "key",
							Label:     `Key`,
							Type:      element.TypeObscure,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/fedex/password
							ID:        "password",
							Label:     `Password`,
							Type:      element.TypeObscure,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/fedex/sandbox_mode
							ID:        "sandbox_mode",
							Label:     `Sandbox Mode`,
							Type:      element.TypeSelect,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/fedex/production_webservices_url
							ID:        "production_webservices_url",
							Label:     `Web-Services URL (Production)`,
							Type:      element.TypeText,
							SortOrder: 90,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `https://ws.fedex.com:443/web-services/`,
						},

						&element.Field{
							// Path: carriers/fedex/sandbox_webservices_url
							ID:        "sandbox_webservices_url",
							Label:     `Web-Services URL (Sandbox)`,
							Type:      element.TypeText,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `https://wsbeta.fedex.com:443/web-services/`,
						},

						&element.Field{
							// Path: carriers/fedex/shipment_requesttype
							ID:        "shipment_requesttype",
							Label:     `Packages Request Type`,
							Type:      element.TypeSelect,
							SortOrder: 110,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Shipping\Model\Config\Source\Online\Requesttype
						},

						&element.Field{
							// Path: carriers/fedex/packaging
							ID:        "packaging",
							Label:     `Packaging`,
							Type:      element.TypeSelect,
							SortOrder: 120,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `YOUR_PACKAGING`,
							// SourceModel: Otnegam\Fedex\Model\Source\Packaging
						},

						&element.Field{
							// Path: carriers/fedex/dropoff
							ID:        "dropoff",
							Label:     `Dropoff`,
							Type:      element.TypeSelect,
							SortOrder: 130,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `REGULAR_PICKUP`,
							// SourceModel: Otnegam\Fedex\Model\Source\Dropoff
						},

						&element.Field{
							// Path: carriers/fedex/unit_of_measure
							ID:        "unit_of_measure",
							Label:     `Weight Unit`,
							Type:      element.TypeSelect,
							SortOrder: 135,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `LB`,
							// SourceModel: Otnegam\Fedex\Model\Source\Unitofmeasure
						},

						&element.Field{
							// Path: carriers/fedex/max_package_weight
							ID:        "max_package_weight",
							Label:     `Maximum Package Weight (Please consult your shipping carrier for maximum supported shipping weight)`,
							Type:      element.TypeText,
							SortOrder: 140,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   150,
						},

						&element.Field{
							// Path: carriers/fedex/handling_type
							ID:        "handling_type",
							Label:     `Calculate Handling Fee`,
							Type:      element.TypeSelect,
							SortOrder: 150,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `F`,
							// SourceModel: Otnegam\Shipping\Model\Source\HandlingType
						},

						&element.Field{
							// Path: carriers/fedex/handling_action
							ID:        "handling_action",
							Label:     `Handling Applied`,
							Type:      element.TypeSelect,
							SortOrder: 160,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `O`,
							// SourceModel: Otnegam\Shipping\Model\Source\HandlingAction
						},

						&element.Field{
							// Path: carriers/fedex/handling_fee
							ID:        "handling_fee",
							Label:     `Handling Fee`,
							Type:      element.TypeText,
							SortOrder: 170,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/fedex/residence_delivery
							ID:        "residence_delivery",
							Label:     `Residential Delivery`,
							Type:      element.TypeSelect,
							SortOrder: 180,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/fedex/allowed_methods
							ID:         "allowed_methods",
							Label:      `Allowed Methods`,
							Type:       element.TypeMultiselect,
							SortOrder:  190,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							CanBeEmpty: true,
							Default:    `EUROPE_FIRST_INTERNATIONAL_PRIORITY,FEDEX_1_DAY_FREIGHT,FEDEX_2_DAY_FREIGHT,FEDEX_2_DAY,FEDEX_2_DAY_AM,FEDEX_3_DAY_FREIGHT,FEDEX_EXPRESS_SAVER,FEDEX_GROUND,FIRST_OVERNIGHT,GROUND_HOME_DELIVERY,INTERNATIONAL_ECONOMY,INTERNATIONAL_ECONOMY_FREIGHT,INTERNATIONAL_FIRST,INTERNATIONAL_GROUND,INTERNATIONAL_PRIORITY,INTERNATIONAL_PRIORITY_FREIGHT,PRIORITY_OVERNIGHT,SMART_POST,STANDARD_OVERNIGHT,FEDEX_FREIGHT,FEDEX_NATIONAL_FREIGHT`,
							// SourceModel: Otnegam\Fedex\Model\Source\Method
						},

						&element.Field{
							// Path: carriers/fedex/smartpost_hubid
							ID:        "smartpost_hubid",
							Label:     `Hub ID`,
							Comment:   element.LongText(`The field is applicable if the Smart Post method is selected.`),
							Type:      element.TypeText,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/fedex/free_method
							ID:        "free_method",
							Label:     `Free Method`,
							Type:      element.TypeSelect,
							SortOrder: 210,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `FEDEX_GROUND`,
							// SourceModel: Otnegam\Fedex\Model\Source\Freemethod
						},

						&element.Field{
							// Path: carriers/fedex/free_shipping_enable
							ID:        "free_shipping_enable",
							Label:     `Free Shipping Amount Threshold`,
							Type:      element.TypeSelect,
							SortOrder: 220,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},

						&element.Field{
							// Path: carriers/fedex/free_shipping_subtotal
							ID:        "free_shipping_subtotal",
							Label:     `Free Shipping Amount Threshold`,
							Type:      element.TypeText,
							SortOrder: 230,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/fedex/specificerrmsg
							ID:        "specificerrmsg",
							Label:     `Displayed Error Message`,
							Type:      element.TypeTextarea,
							SortOrder: 240,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.`,
						},

						&element.Field{
							// Path: carriers/fedex/sallowspecific
							ID:        "sallowspecific",
							Label:     `Ship to Applicable Countries`,
							Type:      element.TypeSelect,
							SortOrder: 250,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Shipping\Model\Config\Source\Allspecificcountries
						},

						&element.Field{
							// Path: carriers/fedex/specificcountry
							ID:         "specificcountry",
							Label:      `Ship to Specific Countries`,
							Type:       element.TypeMultiselect,
							SortOrder:  260,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							CanBeEmpty: true,
							// SourceModel: Otnegam\Directory\Model\Config\Source\Country
						},

						&element.Field{
							// Path: carriers/fedex/debug
							ID:        "debug",
							Label:     `Debug`,
							Type:      element.TypeSelect,
							SortOrder: 270,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/fedex/showmethod
							ID:        "showmethod",
							Label:     `Show Method if Not Applicable`,
							Type:      element.TypeSelect,
							SortOrder: 280,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/fedex/sort_order
							ID:        "sort_order",
							Label:     `Sort Order`,
							Type:      element.TypeText,
							SortOrder: 290,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "carriers",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "fedex",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: carriers/fedex/cutoff_cost
							ID:      `cutoff_cost`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: carriers/fedex/handling
							ID:      `handling`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: carriers/fedex/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Fedex\Model\Carrier`,
						},

						&element.Field{
							// Path: carriers/fedex/is_online
							ID:      `is_online`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 12
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "sitemap",
			Label:     `XML Sitemap`,
			SortOrder: 70,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Sitemap::config_sitemap
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "category",
					Label:     `Categories Options`,
					SortOrder: 1,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/category/changefreq
							ID:        "changefreq",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `daily`,
							// SourceModel: Otnegam\Sitemap\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: sitemap/category/priority
							ID:        "priority",
							Label:     `Priority`,
							Comment:   element.LongText(`Valid values range from 0.0 to 1.0.`),
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   0.5,
							// BackendModel: Otnegam\Sitemap\Model\Config\Backend\Priority
						},
					),
				},

				&element.Group{
					ID:        "product",
					Label:     `Products Options`,
					SortOrder: 2,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/product/changefreq
							ID:        "changefreq",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `daily`,
							// SourceModel: Otnegam\Sitemap\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: sitemap/product/priority
							ID:        "priority",
							Label:     `Priority`,
							Comment:   element.LongText(`Valid values range from 0.0 to 1.0.`),
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   1,
							// BackendModel: Otnegam\Sitemap\Model\Config\Backend\Priority
						},

						&element.Field{
							// Path: sitemap/product/image_include
							ID:        "image_include",
							Label:     `Add Images into Sitemap`,
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `all`,
							// SourceModel: Otnegam\Sitemap\Model\Source\Product\Image\IncludeImage
						},
					),
				},

				&element.Group{
					ID:        "page",
					Label:     `CMS Pages Options`,
					SortOrder: 3,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/page/changefreq
							ID:        "changefreq",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `daily`,
							// SourceModel: Otnegam\Sitemap\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: sitemap/page/priority
							ID:        "priority",
							Label:     `Priority`,
							Comment:   element.LongText(`Valid values range from 0.0 to 1.0.`),
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   0.25,
							// BackendModel: Otnegam\Sitemap\Model\Config\Backend\Priority
						},
					),
				},

				&element.Group{
					ID:        "generate",
					Label:     `Generation Settings`,
					SortOrder: 4,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/generate/enabled
							ID:        "enabled",
							Label:     `Enabled`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sitemap/generate/error_email
							ID:        "error_email",
							Label:     `Error Email Recipient`,
							Type:      element.TypeText,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: sitemap/generate/error_email_identity
							ID:        "error_email_identity",
							Label:     `Error Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `general`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: sitemap/generate/error_email_template
							ID:        "error_email_template",
							Label:     `Error Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 7,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `sitemap_generate_error_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: sitemap/generate/frequency
							ID:        "frequency",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Cron\Model\Config\Backend\Sitemap
							// SourceModel: Otnegam\Cron\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: sitemap/generate/time
							ID:        "time",
							Label:     `Start Time`,
							Type:      element.TypeTime,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "limit",
					Label:     `Sitemap File Limits`,
					SortOrder: 5,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/limit/max_lines
							ID:        "max_lines",
							Label:     `Maximum No of URLs Per File`,
							Type:      element.TypeText,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   50000,
						},

						&element.Field{
							// Path: sitemap/limit/max_file_size
							ID:        "max_file_size",
							Label:     `Maximum File Size`,
							Comment:   element.LongText(`File size in bytes.`),
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   10485760,
						},
					),
				},

				&element.Group{
					ID:        "search_engines",
					Label:     `Search Engine Submission Settings`,
					SortOrder: 6,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/search_engines/submission_robots
							ID:        "submission_robots",
							Label:     `Enable Submission to Robots.txt`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "sitemap",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "generate",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/generate/error_email
							ID:      `error_email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},
					),
				},

				&element.Group{
					ID: "file",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sitemap/file/valid_paths
							ID:      `valid_paths`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"available":{"any_path":"\/*\/*.xml"}}`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 13
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "catalog",
			Label:     `Catalog`,
			SortOrder: 40,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Catalog::config_catalog
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "fields_masks",
					Label:     `Product Fields Auto-Generation`,
					SortOrder: 90,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/fields_masks/sku
							ID:        "sku",
							Label:     `Mask for SKU`,
							Comment:   element.LongText(`Use {{name}} as Product Name placeholder`),
							Type:      element.TypeText,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `{{name}}`,
						},

						&element.Field{
							// Path: catalog/fields_masks/meta_title
							ID:        "meta_title",
							Label:     `Mask for Meta Title`,
							Comment:   element.LongText(`Use {{name}} as Product Name placeholder`),
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `{{name}}`,
						},

						&element.Field{
							// Path: catalog/fields_masks/meta_keyword
							ID:        "meta_keyword",
							Label:     `Mask for Meta Keywords`,
							Comment:   element.LongText(`Use {{name}} as Product Name or {{sku}} as Product SKU placeholders`),
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `{{name}}`,
						},

						&element.Field{
							// Path: catalog/fields_masks/meta_description
							ID:        "meta_description",
							Label:     `Mask for Meta Description`,
							Comment:   element.LongText(`Use {{name}} and {{description}} as Product Name and Product Description placeholders`),
							Type:      element.TypeText,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `{{name}} {{description}}`,
						},
					),
				},

				&element.Group{
					ID:        "frontend",
					Label:     `Storefront`,
					SortOrder: 100,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/frontend/list_mode
							ID:        "list_mode",
							Label:     `List Mode`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `grid-list`,
							// SourceModel: Otnegam\Catalog\Model\Config\Source\ListMode
						},

						&element.Field{
							// Path: catalog/frontend/grid_per_page_values
							ID:        "grid_per_page_values",
							Label:     `Products per Page on Grid Allowed Values`,
							Comment:   element.LongText(`Comma-separated.`),
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `9,15,30`,
						},

						&element.Field{
							// Path: catalog/frontend/grid_per_page
							ID:        "grid_per_page",
							Label:     `Products per Page on Grid Default Value`,
							Comment:   element.LongText(`Must be in the allowed values list`),
							Type:      element.TypeText,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   9,
						},

						&element.Field{
							// Path: catalog/frontend/list_per_page_values
							ID:        "list_per_page_values",
							Label:     `Products per Page on List Allowed Values`,
							Comment:   element.LongText(`Comma-separated.`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `5,10,15,20,25`,
						},

						&element.Field{
							// Path: catalog/frontend/list_per_page
							ID:        "list_per_page",
							Label:     `Products per Page on List Default Value`,
							Comment:   element.LongText(`Must be in the allowed values list`),
							Type:      element.TypeText,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   10,
						},

						&element.Field{
							// Path: catalog/frontend/flat_catalog_category
							ID:        "flat_catalog_category",
							Label:     `Use Flat Catalog Category`,
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   false,
							// BackendModel: Otnegam\Catalog\Model\Indexer\Category\Flat\System\Config\Mode
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/frontend/flat_catalog_product
							ID:        "flat_catalog_product",
							Label:     `Use Flat Catalog Product`,
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\Catalog\Model\Indexer\Product\Flat\System\Config\Mode
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/frontend/default_sort_by
							ID:        "default_sort_by",
							Label:     `Product Listing Sort by`,
							Type:      element.TypeSelect,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `position`,
							// SourceModel: Otnegam\Catalog\Model\Config\Source\ListSort
						},

						&element.Field{
							// Path: catalog/frontend/list_allow_all
							ID:        "list_allow_all",
							Label:     `Allow All Products per Page`,
							Comment:   element.LongText(`Whether to show "All" option in the "Show X Per Page" dropdown`),
							Type:      element.TypeSelect,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/frontend/parse_url_directives
							ID:        "parse_url_directives",
							Label:     `Allow Dynamic Media URLs in Products and Categories`,
							Comment:   element.LongText(`E.g. {{media url="path/to/image.jpg"}} {{skin url="path/to/picture.gif"}}. Dynamic directives parsing impacts catalog performance.`),
							Type:      element.TypeSelect,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "placeholder",
					Label:     `Product Image Placeholders`,
					SortOrder: 300,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/placeholder/placeholder
							ID:        "placeholder",
							Type:      element.TypeImage,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Image
						},
					),
				},

				&element.Group{
					ID:        "seo",
					Label:     `Search Engine Optimization`,
					SortOrder: 500,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/seo/title_separator
							ID:        "title_separator",
							Label:     `Page Title Separator`,
							Type:      element.TypeText,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `-`,
						},

						&element.Field{
							// Path: catalog/seo/category_canonical_tag
							ID:        "category_canonical_tag",
							Label:     `Use Canonical Link Meta Tag For Categories`,
							Type:      element.TypeSelect,
							SortOrder: 7,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/seo/product_canonical_tag
							ID:        "product_canonical_tag",
							Label:     `Use Canonical Link Meta Tag For Products`,
							Type:      element.TypeSelect,
							SortOrder: 8,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "price",
					Label:     `Price`,
					SortOrder: 400,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/price/scope
							ID:        "scope",
							Label:     `Catalog Price Scope`,
							Comment:   element.LongText(`This defines the base currency scope ("Currency Setup" > "Currency Options" > "Base Currency").`),
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\Catalog\Model\Indexer\Product\Price\System\Config\PriceScope
							// SourceModel: Otnegam\Catalog\Model\Config\Source\Price\Scope
						},
					),
				},

				&element.Group{
					ID:        "navigation",
					Label:     `Category Top Navigation`,
					SortOrder: 500,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/navigation/max_depth
							ID:        "max_depth",
							Label:     `Maximal Depth`,
							Type:      element.TypeText,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},
					),
				},

				&element.Group{
					ID:        "custom_options",
					Label:     `Date & Time Custom Options`,
					SortOrder: 700,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/custom_options/use_calendar
							ID:        "use_calendar",
							Label:     `Use JavaScript Calendar`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/custom_options/date_fields_order
							ID:        "date_fields_order",
							Label:     `Date Fields Order`,
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `m,d,y`,
						},

						&element.Field{
							// Path: catalog/custom_options/time_format
							ID:        "time_format",
							Label:     `Time Format`,
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `12h`,
							// SourceModel: Otnegam\Catalog\Model\Config\Source\TimeFormat
						},

						&element.Field{
							// Path: catalog/custom_options/year_range
							ID:        "year_range",
							Label:     `Year Range`,
							Comment:   element.LongText(`Please use a four-digit year format.`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "design",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "watermark",
					Label:     `Product Image Watermarks`,
					SortOrder: 400,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/watermark/size
							ID:        "size",
							Label:     `Watermark Default Size`,
							Comment:   element.LongText(`Example format: 200x300.`),
							Type:      element.TypeText,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/watermark/imageOpacity
							ID:        "imageOpacity",
							Label:     `Watermark Opacity, Percent`,
							Type:      element.TypeText,
							SortOrder: 150,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/watermark/image
							ID:        "image",
							Label:     `Watermark`,
							Comment:   element.LongText(`Allowed file types: jpeg, gif, png.`),
							Type:      element.TypeImage,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Image
						},

						&element.Field{
							// Path: design/watermark/position
							ID:        "position",
							Label:     `Watermark Position`,
							Type:      element.TypeSelect,
							SortOrder: 300,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Catalog\Model\Config\Source\Watermark\Position
						},
					),
				},
			),
		},
		&element.Section{
			ID: "cms",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "wysiwyg",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: cms/wysiwyg/use_static_urls_in_catalog
							ID:        "use_static_urls_in_catalog",
							Label:     `Use Static URLs for Media Content in WYSIWYG for Catalog`,
							Comment:   element.LongText(`This applies only to catalog products and categories. Media content will be inserted into the editor as a static URL. Media content is not updated if the system configuration base URL changes.`),
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},
		&element.Section{
			ID: "rss",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "catalog",
					Label:     `Catalog`,
					SortOrder: 3,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: rss/catalog/new
							ID:        "new",
							Label:     `New Products`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},

						&element.Field{
							// Path: rss/catalog/special
							ID:        "special",
							Label:     `Special Products`,
							Type:      element.TypeSelect,
							SortOrder: 11,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},

						&element.Field{
							// Path: rss/catalog/category
							ID:        "category",
							Label:     `Top Level Category`,
							Type:      element.TypeSelect,
							SortOrder: 14,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "catalog",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "product",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/product/flat
							ID:      `flat`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"max_index_count":"64"}`,
						},

						&element.Field{
							// Path: catalog/product/default_tax_group
							ID:      `default_tax_group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: 2,
						},
					),
				},

				&element.Group{
					ID: "seo",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/seo/product_url_suffix
							ID:      `product_url_suffix`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `.html`,
						},

						&element.Field{
							// Path: catalog/seo/category_url_suffix
							ID:      `category_url_suffix`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `.html`,
						},

						&element.Field{
							// Path: catalog/seo/product_use_categories
							ID:      `product_use_categories`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: catalog/seo/save_rewrites_history
							ID:      `save_rewrites_history`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},

				&element.Group{
					ID: "custom_options",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/custom_options/forbidden_extensions
							ID:      `forbidden_extensions`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `php,exe`,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "media_storage_configuration",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/media_storage_configuration/allowed_resources
							ID:      `allowed_resources`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"tmp_images_folder":"tmp","catalog_images_folder":"catalog","product_custom_options_fodler":"custom_options"}`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 14
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "sales",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "msrp",
					Label:     `Minimum Advertised Price`,
					SortOrder: 110,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: sales/msrp/enabled
							ID:        "enabled",
							Label:     `Enable MAP`,
							Comment:   element.LongText(`<strong style="color:red">Warning!</strong> Enabling MAP by default will hide all product prices on Storefront.`),
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: sales/msrp/display_price_type
							ID:        "display_price_type",
							Label:     `Display Actual Price`,
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// SourceModel: Otnegam\Msrp\Model\Product\Attribute\Source\Type
						},

						&element.Field{
							// Path: sales/msrp/explanation_message
							ID:        "explanation_message",
							Label:     `Default Popup Text Message`,
							Type:      element.TypeTextarea,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `Our price is lower than the manufacturer's "minimum advertised price." As a result, we cannot show you the price in catalog or the product page. <br /><br /> You have no obligation to purchase the product once you know the price. You can simply remove the item from your cart.`,
						},

						&element.Field{
							// Path: sales/msrp/explanation_message_whats_this
							ID:        "explanation_message_whats_this",
							Label:     `Default "What's This" Text Message`,
							Type:      element.TypeTextarea,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `Our price is lower than the manufacturer's "minimum advertised price." As a result, we cannot show you the price in catalog or the product page. <br /><br /> You have no obligation to purchase the product once you know the price. You can simply remove the item from your cart.`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 15
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "currency",
			Label:     `Currency Setup`,
			SortOrder: 60,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Backend::currency
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "options",
					Label:     `Currency Options`,
					SortOrder: 30,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: currency/options/base
							ID:        "base",
							Label:     `Base Currency`,
							Comment:   element.LongText(`Base currency is used for all online payment transactions. If you have more than one store view, the base currency scope is defined by the catalog price scope ("Catalog" > "Price" > "Catalog Price Scope").`),
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `USD`,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Currency\Base
							// SourceModel: Otnegam\Config\Model\Config\Source\Locale\Currency
						},

						&element.Field{
							// Path: currency/options/default
							ID:        "default",
							Label:     `Default Display Currency`,
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `USD`,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Currency\DefaultCurrency
							// SourceModel: Otnegam\Config\Model\Config\Source\Locale\Currency
						},

						&element.Field{
							// Path: currency/options/allow
							ID:         "allow",
							Label:      `Allowed Currencies`,
							Type:       element.TypeMultiselect,
							SortOrder:  3,
							Visible:    element.VisibleYes,
							Scope:      scope.PermAll,
							CanBeEmpty: true,
							Default:    `USD,EUR`,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Currency\Allow
							// SourceModel: Otnegam\Config\Model\Config\Source\Locale\Currency
						},
					),
				},

				&element.Group{
					ID:        "webservicex",
					Label:     `Webservicex`,
					SortOrder: 40,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: currency/webservicex/timeout
							ID:      "timeout",
							Label:   `Connection Timeout in Seconds`,
							Type:    element.TypeText,
							Visible: element.VisibleYes,
							Scope:   scope.NewPerm(scope.DefaultID),
							Default: 100,
						},
					),
				},

				&element.Group{
					ID:        "import",
					Label:     `Scheduled Import Settings`,
					SortOrder: 50,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: currency/import/enabled
							ID:        "enabled",
							Label:     `Enabled`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: currency/import/error_email
							ID:        "error_email",
							Label:     `Error Email Recipient`,
							Type:      element.TypeText,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: currency/import/error_email_identity
							ID:        "error_email_identity",
							Label:     `Error Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `general`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: currency/import/error_email_template
							ID:        "error_email_template",
							Label:     `Error Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 7,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `currency_import_error_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: currency/import/frequency
							ID:        "frequency",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Cron\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: currency/import/service
							ID:        "service",
							Label:     `Service`,
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Currency\Cron
							// SourceModel: Otnegam\Directory\Model\Currency\Import\Source\Service
						},

						&element.Field{
							// Path: currency/import/time
							ID:        "time",
							Label:     `Start Time`,
							Type:      element.TypeTime,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "currency",
					Label:     `Currency`,
					SortOrder: 50,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/currency/installed
							ID:         "installed",
							Label:      `Installed Currencies`,
							Type:       element.TypeMultiselect,
							SortOrder:  1,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID),
							CanBeEmpty: true,
							Default:    `AZN,AZM,AFN,ALL,DZD,AOA,ARS,AMD,AWG,AUD,BSD,BHD,BDT,BBD,BYR,BZD,BMD,BTN,BOB,BAM,BWP,BRL,GBP,BND,BGN,BUK,BIF,KHR,CAD,CVE,CZK,KYD,CLP,CNY,COP,KMF,CDF,CRC,HRK,CUP,DKK,DJF,DOP,XCD,EGP,SVC,GQE,ERN,EEK,ETB,EUR,FKP,FJD,GMD,GEK,GEL,GHS,GIP,GTQ,GNF,GYD,HTG,HNL,HKD,HUF,ISK,INR,IDR,IRR,IQD,ILS,JMD,JPY,JOD,KZT,KES,KWD,KGS,LAK,LVL,LBP,LSL,LRD,LYD,LTL,MOP,MKD,MGA,MWK,MYR,MVR,LSM,MRO,MUR,MXN,MDL,MNT,MAD,MZN,MMK,NAD,NPR,ANG,TRL,TRY,NZD,NIC,NGN,KPW,NOK,OMR,PKR,PAB,PGK,PYG,PEN,PHP,PLN,QAR,RHD,RON,ROL,RUB,RWF,SHP,STD,SAR,RSD,SCR,SLL,SGD,SKK,SBD,SOS,ZAR,KRW,LKR,SDG,SRD,SZL,SEK,CHF,SYP,TWD,TJS,TZS,THB,TOP,TTD,TND,TMM,USD,UGX,UAH,AED,UYU,UZS,VUV,VEB,VEF,VND,CHE,CHW,XOF,XPF,WST,YER,ZMK,ZWD`,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Locale
							// SourceModel: Otnegam\Config\Model\Config\Source\Locale\Currency\All
						},
					),
				},
			),
		},
		&element.Section{
			ID: "general",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "country",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/country/optional_zip_countries
							ID:         "optional_zip_countries",
							Label:      `Zip/Postal Code is Optional for`,
							Type:       element.TypeMultiselect,
							SortOrder:  3,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID),
							CanBeEmpty: true,
							Default:    `HK,IE,MO,PA,GB`,
							// SourceModel: Otnegam\Directory\Model\Config\Source\Country
						},
					),
				},

				&element.Group{
					ID:        "region",
					Label:     `State Options`,
					SortOrder: 4,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/region/state_required
							ID:        "state_required",
							Label:     `State is Required for`,
							Type:      element.TypeMultiselect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Directory\Model\Config\Source\Country
						},

						&element.Field{
							// Path: general/region/display_all
							ID:        "display_all",
							Label:     `Allow to Choose State if It is Optional for Country`,
							Type:      element.TypeSelect,
							SortOrder: 8,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID: "locale",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/locale/weight_unit
							ID:        "weight_unit",
							Label:     `Weight Unit`,
							Type:      element.TypeSelect,
							SortOrder: 7,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `lbs`,
							// SourceModel: Otnegam\Directory\Model\Config\Source\WeightUnit
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "currency",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "import",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: currency/import/error_email
							ID:      `error_email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "general",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "country",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/country/allow
							ID:      `allow`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `AF,AL,DZ,AS,AD,AO,AI,AQ,AG,AR,AM,AW,AU,AT,AX,AZ,BS,BH,BD,BB,BY,BE,BZ,BJ,BM,BL,BT,BO,BA,BW,BV,BR,IO,VG,BN,BG,BF,BI,KH,CM,CA,CD,CV,KY,CF,TD,CL,CN,CX,CC,CO,KM,CG,CK,CR,HR,CU,CY,CZ,DK,DJ,DM,DO,EC,EG,SV,GQ,ER,EE,ET,FK,FO,FJ,FI,FR,GF,PF,TF,GA,GM,GE,DE,GG,GH,GI,GR,GL,GD,GP,GU,GT,GN,GW,GY,HT,HM,HN,HK,HU,IS,IM,IN,ID,IR,IQ,IE,IL,IT,CI,JE,JM,JP,JO,KZ,KE,KI,KW,KG,LA,LV,LB,LS,LR,LY,LI,LT,LU,ME,MF,MO,MK,MG,MW,MY,MV,ML,MT,MH,MQ,MR,MU,YT,FX,MX,FM,MD,MC,MN,MS,MA,MZ,MM,NA,NR,NP,NL,AN,NC,NZ,NI,NE,NG,NU,NF,KP,MP,NO,OM,PK,PW,PA,PG,PY,PE,PH,PN,PL,PS,PT,PR,QA,RE,RO,RS,RU,RW,SH,KN,LC,PM,VC,WS,SM,ST,SA,SN,SC,SL,SG,SK,SI,SB,SO,ZA,GS,KR,ES,LK,SD,SR,SJ,SZ,SE,CH,SY,TL,TW,TJ,TZ,TH,TG,TK,TO,TT,TN,TR,TM,TC,TV,VI,UG,UA,AE,GB,US,UM,UY,UZ,VU,VA,VE,VN,WF,EH,YE,ZM,ZW`,
						},

						&element.Field{
							// Path: general/country/default
							ID:      `default`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `US`,
						},
					),
				},

				&element.Group{
					ID: "locale",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/locale/datetime_format_long
							ID:      `datetime_format_long`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `%A, %B %e %Y [%I:%M %p]`,
						},

						&element.Field{
							// Path: general/locale/datetime_format_medium
							ID:      `datetime_format_medium`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `%a, %b %e %Y [%I:%M %p]`,
						},

						&element.Field{
							// Path: general/locale/datetime_format_short
							ID:      `datetime_format_short`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `%m/%d/%y [%I:%M %p]`,
						},

						&element.Field{
							// Path: general/locale/date_format_long
							ID:      `date_format_long`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `%A, %B %e %Y`,
						},

						&element.Field{
							// Path: general/locale/date_format_medium
							ID:      `date_format_medium`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `%a, %b %e %Y`,
						},

						&element.Field{
							// Path: general/locale/date_format_short
							ID:      `date_format_short`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `%m/%d/%y`,
						},

						&element.Field{
							// Path: general/locale/language
							ID:      `language`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `en`,
						},

						&element.Field{
							// Path: general/locale/code
							ID:      `code`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `en_US`,
						},

						&element.Field{
							// Path: general/locale/timezone
							ID:      `timezone`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `America/Los_Angeles`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 16
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "backup",
					Label:     `Scheduled Backup Settings`,
					SortOrder: 500,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/backup/enabled
							ID:        "enabled",
							Label:     `Enable Scheduled Backup`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: system/backup/type
							ID:        "type",
							Label:     `Backup Type`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Backup\Model\Config\Source\Type
						},

						&element.Field{
							// Path: system/backup/time
							ID:        "time",
							Label:     `Start Time`,
							Type:      element.TypeTime,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},

						&element.Field{
							// Path: system/backup/frequency
							ID:        "frequency",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\Backup\Model\Config\Backend\Cron
							// SourceModel: Otnegam\Cron\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: system/backup/maintenance
							ID:        "maintenance",
							Label:     `Maintenance Mode`,
							Comment:   element.LongText(`Please put your store into maintenance mode during backup.`),
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 17
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "contact",
			Label:     `Contacts`,
			SortOrder: 100,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Contact::contact
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "contact",
					Label:     `Contact Us`,
					SortOrder: 10,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: contact/contact/enabled
							ID:        "enabled",
							Label:     `Enable Contact Us`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Contact\Model\System\Config\Backend\Links
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "email",
					Label:     `Email Options`,
					SortOrder: 50,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: contact/email/recipient_email
							ID:        "recipient_email",
							Label:     `Send Emails To`,
							Type:      element.TypeText,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `[email protected]`,
						},

						&element.Field{
							// Path: contact/email/sender_email_identity
							ID:        "sender_email_identity",
							Label:     `Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `custom2`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: contact/email/email_template
							ID:        "email_template",
							Label:     `Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `contact_email_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 18
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "customer",
			Label:     `Customer Configuration`,
			SortOrder: 130,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Customer::config_customer
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "account_share",
					Label:     `Account Sharing Options`,
					SortOrder: 10,
					Scope:     scope.NewPerm(scope.DefaultID),
					HideInSingleStoreMode: true,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/account_share/scope
							ID:        "scope",
							Label:     `Share Customer Accounts`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   true,
							// BackendModel: Otnegam\Customer\Model\Config\Share
							// SourceModel: Otnegam\Customer\Model\Config\Share
						},
					),
				},

				&element.Group{
					ID:        "create_account",
					Label:     `Create New Account Options`,
					SortOrder: 20,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/create_account/auto_group_assign
							ID:        "auto_group_assign",
							Label:     `Enable Automatic Assignment to Customer Group`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: customer/create_account/tax_calculation_address_type
							ID:        "tax_calculation_address_type",
							Label:     `Tax Calculation Based On`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `billing`,
							// SourceModel: Otnegam\Customer\Model\Config\Source\Address\Type
						},

						&element.Field{
							// Path: customer/create_account/default_group
							ID:        "default_group",
							Label:     `Default Group`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Customer\Model\Config\Source\Group
						},

						&element.Field{
							// Path: customer/create_account/viv_domestic_group
							ID:        "viv_domestic_group",
							Label:     `Group for Valid VAT ID - Domestic`,
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Customer\Model\Config\Source\Group
						},

						&element.Field{
							// Path: customer/create_account/viv_intra_union_group
							ID:        "viv_intra_union_group",
							Label:     `Group for Valid VAT ID - Intra-Union`,
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Customer\Model\Config\Source\Group
						},

						&element.Field{
							// Path: customer/create_account/viv_invalid_group
							ID:        "viv_invalid_group",
							Label:     `Group for Invalid VAT ID`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Customer\Model\Config\Source\Group
						},

						&element.Field{
							// Path: customer/create_account/viv_error_group
							ID:        "viv_error_group",
							Label:     `Validation Error Group`,
							Type:      element.TypeSelect,
							SortOrder: 55,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Customer\Model\Config\Source\Group
						},

						&element.Field{
							// Path: customer/create_account/viv_on_each_transaction
							ID:        "viv_on_each_transaction",
							Label:     `Validate on Each Transaction`,
							Type:      element.TypeSelect,
							SortOrder: 56,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: customer/create_account/viv_disable_auto_group_assign_default
							ID:        "viv_disable_auto_group_assign_default",
							Label:     `Default Value for Disable Automatic Group Changes Based on VAT ID`,
							Type:      element.TypeSelect,
							SortOrder: 57,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\CreateAccount\DisableAutoGroupAssignDefault
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: customer/create_account/vat_frontend_visibility
							ID:        "vat_frontend_visibility",
							Label:     `Show VAT Number on Storefront`,
							Comment:   element.LongText(`To show VAT number on Storefront, set Show VAT Number on Storefront option to Yes.`),
							Type:      element.TypeSelect,
							SortOrder: 58,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: customer/create_account/email_domain
							ID:        "email_domain",
							Label:     `Default Email Domain`,
							Type:      element.TypeText,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `example.com`,
						},

						&element.Field{
							// Path: customer/create_account/email_template
							ID:        "email_template",
							Label:     `Default Welcome Email`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_create_account_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/create_account/email_no_password_template
							ID:        "email_no_password_template",
							Label:     `Default Welcome Email Without Password`,
							Comment:   element.LongText(`This email will be sent instead of the Default Welcome Email, if a customer was created without password. <br /><br /> Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 75,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_create_account_email_no_password_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/create_account/email_identity
							ID:        "email_identity",
							Label:     `Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `general`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: customer/create_account/confirm
							ID:        "confirm",
							Label:     `Require Emails Confirmation`,
							Type:      element.TypeSelect,
							SortOrder: 90,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: customer/create_account/email_confirmation_template
							ID:        "email_confirmation_template",
							Label:     `Confirmation Link Email`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_create_account_email_confirmation_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/create_account/email_confirmed_template
							ID:        "email_confirmed_template",
							Label:     `Welcome Email`,
							Comment:   element.LongText(`This email will be sent instead of the Default Welcome Email, after account confirmation. <br /><br /> Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 110,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_create_account_email_confirmed_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/create_account/generate_human_friendly_id
							ID:        "generate_human_friendly_id",
							Label:     `Generate Human-Friendly Customer ID`,
							Type:      element.TypeSelect,
							SortOrder: 120,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "password",
					Label:     `Password Options`,
					SortOrder: 30,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/password/forgot_email_template
							ID:        "forgot_email_template",
							Label:     `Forgot Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_password_forgot_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/password/remind_email_template
							ID:        "remind_email_template",
							Label:     `Remind Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_password_remind_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/password/reset_password_template
							ID:        "reset_password_template",
							Label:     `Reset Password Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `customer_password_reset_password_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: customer/password/forgot_email_identity
							ID:        "forgot_email_identity",
							Label:     `Password Template Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `support`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: customer/password/reset_link_expiration_period
							ID:        "reset_link_expiration_period",
							Label:     `Recovery Link Expiration Period (days)`,
							Comment:   element.LongText(`Please enter a number 1 or greater in this field.`),
							Type:      element.TypeText,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   1,
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Password\Link\Expirationperiod
						},
					),
				},

				&element.Group{
					ID:        "address",
					Label:     `Name and Address Options`,
					SortOrder: 40,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/address/street_lines
							ID:        "street_lines",
							Label:     `Number of Lines in a Street Address`,
							Comment:   element.LongText(`Leave empty for default (2). Valid range: 1-4`),
							Type:      element.Type,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   2,
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Address\Street
						},

						&element.Field{
							// Path: customer/address/prefix_show
							ID:        "prefix_show",
							Label:     `Show Prefix`,
							Comment:   element.LongText(`The title that goes before name (Mr., Mrs., etc.)`),
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Show\Address
							// SourceModel: Otnegam\Config\Model\Config\Source\Nooptreq
						},

						&element.Field{
							// Path: customer/address/prefix_options
							ID:        "prefix_options",
							Label:     `Prefix Dropdown Options`,
							Comment:   element.LongText(`Semicolon (;) separated values.<br/>Put semicolon in the beginning for empty first option.<br/>Leave empty for open text field.`),
							Type:      element.Type,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: customer/address/middlename_show
							ID:        "middlename_show",
							Label:     `Show Middle Name (initial)`,
							Comment:   element.LongText(`Always optional.`),
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Show\Address
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: customer/address/suffix_show
							ID:        "suffix_show",
							Label:     `Show Suffix`,
							Comment:   element.LongText(`The suffix that goes after name (Jr., Sr., etc.)`),
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Show\Address
							// SourceModel: Otnegam\Config\Model\Config\Source\Nooptreq
						},

						&element.Field{
							// Path: customer/address/suffix_options
							ID:        "suffix_options",
							Label:     `Suffix Dropdown Options`,
							Comment:   element.LongText(`Semicolon (;) separated values.<br/>Put semicolon in the beginning for empty first option.<br/>Leave empty for open text field.`),
							Type:      element.Type,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: customer/address/dob_show
							ID:        "dob_show",
							Label:     `Show Date of Birth`,
							Type:      element.TypeSelect,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Show\Customer
							// SourceModel: Otnegam\Config\Model\Config\Source\Nooptreq
						},

						&element.Field{
							// Path: customer/address/taxvat_show
							ID:        "taxvat_show",
							Label:     `Show Tax/VAT Number`,
							Type:      element.TypeSelect,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Show\Customer
							// SourceModel: Otnegam\Config\Model\Config\Source\Nooptreq
						},

						&element.Field{
							// Path: customer/address/gender_show
							ID:        "gender_show",
							Label:     `Show Gender`,
							Type:      element.TypeSelect,
							SortOrder: 90,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Customer\Model\Config\Backend\Show\Customer
							// SourceModel: Otnegam\Config\Model\Config\Source\Nooptreq
						},
					),
				},

				&element.Group{
					ID:        "startup",
					Label:     `Login Options`,
					SortOrder: 90,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/startup/redirect_dashboard
							ID:        "redirect_dashboard",
							Label:     `Redirect Customer to Account Dashboard after Logging in`,
							Comment:   element.LongText(`Customer will stay on the current page if "No" is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "address_templates",
					Label:     `Address Templates`,
					SortOrder: 100,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/address_templates/text
							ID:        "text",
							Label:     `Text`,
							Type:      element.TypeTextarea,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default: `{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}
{{depend company}}{{var company}}{{/depend}}
{{if street1}}{{var street1}}
{{/if}}
{{depend street2}}{{var street2}}{{/depend}}
{{depend street3}}{{var street3}}{{/depend}}
{{depend street4}}{{var street4}}{{/depend}}
{{if city}}{{var city}},  {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}
{{var country}}
T: {{var telephone}}
{{depend fax}}F: {{var fax}}{{/depend}}
{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}`,
						},

						&element.Field{
							// Path: customer/address_templates/oneline
							ID:        "oneline",
							Label:     `Text One Line`,
							Type:      element.TypeTextarea,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, {{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}}`,
						},

						&element.Field{
							// Path: customer/address_templates/html
							ID:        "html",
							Label:     `HTML`,
							Type:      element.TypeTextarea,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default: `{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}{{depend firstname}}<br/>{{/depend}}
{{depend company}}{{var company}}<br />{{/depend}}
{{if street1}}{{var street1}}<br />{{/if}}
{{depend street2}}{{var street2}}<br />{{/depend}}
{{depend street3}}{{var street3}}<br />{{/depend}}
{{depend street4}}{{var street4}}<br />{{/depend}}
{{if city}}{{var city}},  {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}<br/>
{{var country}}<br/>
{{depend telephone}}T: {{var telephone}}{{/depend}}
{{depend fax}}<br/>F: {{var fax}}{{/depend}}
{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}`,
						},

						&element.Field{
							// Path: customer/address_templates/pdf
							ID:        "pdf",
							Label:     `PDF`,
							Type:      element.TypeTextarea,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default: `{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}|
{{depend company}}{{var company}}|{{/depend}}
{{if street1}}{{var street1}}
{{/if}}
{{depend street2}}{{var street2}}|{{/depend}}
{{depend street3}}{{var street3}}|{{/depend}}
{{depend street4}}{{var street4}}|{{/depend}}
{{if city}}{{var city}},|{{/if}}
{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}|
{{var country}}|
{{depend telephone}}T: {{var telephone}}{{/depend}}|
{{depend fax}}<br/>F: {{var fax}}{{/depend}}|
{{depend vat_id}}<br/>VAT: {{var vat_id}}{{/depend}}|`,
						},
					),
				},

				&element.Group{
					ID:        "online_customers",
					Label:     `Online Customers Options`,
					SortOrder: 10,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/online_customers/online_minutes_interval
							ID:        "online_minutes_interval",
							Label:     `Online Minutes Interval`,
							Comment:   element.LongText(`Leave empty for default (15 minutes).`),
							Type:      element.TypeText,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},
					),
				},
			),
		},
		&element.Section{
			ID: "general",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "store_information",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/store_information/validate_vat_number
							ID:        "validate_vat_number",
							Type:      element.Type,
							SortOrder: 62,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},
					),
				},

				&element.Group{
					ID: "restriction",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: general/restriction/autocomplete_on_storefront
							ID:        "autocomplete_on_storefront",
							Label:     `Enable Autocomplete on login/forgot password forms`,
							Type:      element.TypeSelect,
							SortOrder: 65,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "customer",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "default",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/default/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},

				&element.Group{
					ID: "address",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: customer/address/prefix_show
							ID:      `prefix_show`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: customer/address/prefix_options
							ID:      `prefix_options`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: customer/address/middlename_show
							ID:      `middlename_show`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: customer/address/suffix_show
							ID:      `suffix_show`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: customer/address/suffix_options
							ID:      `suffix_options`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: customer/address/dob_show
							ID:      `dob_show`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: customer/address/gender_show
							ID:      `gender_show`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 19
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "carriers",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "dhl",
					Label:     `DHL`,
					SortOrder: 140,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: carriers/dhl/active
							ID:        "active",
							Label:     `Enabled for Checkout`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/dhl/active_rma
							ID:        "active_rma",
							Label:     `Enabled for RMA`,
							Type:      element.TypeSelect,
							SortOrder: 15,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/dhl/gateway_url
							ID:        "gateway_url",
							Label:     `Gateway URL`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `https://xmlpi-ea.dhl.com/XMLShippingServlet`,
						},

						&element.Field{
							// Path: carriers/dhl/title
							ID:        "title",
							Label:     `Title`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `DHL`,
						},

						&element.Field{
							// Path: carriers/dhl/id
							ID:        "id",
							Label:     `Access ID`,
							Type:      element.TypeObscure,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/dhl/password
							ID:        "password",
							Label:     `Password`,
							Type:      element.TypeObscure,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   nil,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted @todo Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: carriers/dhl/account
							ID:        "account",
							Label:     `Account Number`,
							Type:      element.TypeText,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/dhl/content_type
							ID:        "content_type",
							Label:     `Content Type`,
							Type:      element.TypeSelect,
							SortOrder: 90,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `N`,
							// SourceModel: Otnegam\Dhl\Model\Source\Contenttype
						},

						&element.Field{
							// Path: carriers/dhl/handling_type
							ID:        "handling_type",
							Label:     `Calculate Handling Fee`,
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `F`,
							// SourceModel: Otnegam\Shipping\Model\Source\HandlingType
						},

						&element.Field{
							// Path: carriers/dhl/handling_action
							ID:        "handling_action",
							Label:     `Handling Applied`,
							Comment:   element.LongText(`"Per Order" allows a single handling fee for the entire order. "Per Package" allows an individual handling fee for each package.`),
							Type:      element.TypeSelect,
							SortOrder: 110,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `O`,
							// SourceModel: Otnegam\Shipping\Model\Source\HandlingAction
						},

						&element.Field{
							// Path: carriers/dhl/handling_fee
							ID:        "handling_fee",
							Label:     `Handling Fee`,
							Type:      element.TypeText,
							SortOrder: 120,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/dhl/divide_order_weight
							ID:        "divide_order_weight",
							Label:     `Divide Order Weight`,
							Comment:   element.LongText(`Select this to allow DHL to optimize shipping charges by splitting the order if it exceeds 70 kg.`),
							Type:      element.TypeSelect,
							SortOrder: 130,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/dhl/unit_of_measure
							ID:        "unit_of_measure",
							Label:     `Weight Unit`,
							Type:      element.TypeSelect,
							SortOrder: 140,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `K`,
							// SourceModel: Otnegam\Dhl\Model\Source\Method\Unitofmeasure
						},

						&element.Field{
							// Path: carriers/dhl/size
							ID:        "size",
							Label:     `Size`,
							Type:      element.TypeSelect,
							SortOrder: 150,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `R`,
							// SourceModel: Otnegam\Dhl\Model\Source\Method\Size
						},

						&element.Field{
							// Path: carriers/dhl/height
							ID:        "height",
							Label:     `Height`,
							Type:      element.TypeText,
							SortOrder: 151,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: carriers/dhl/depth
							ID:        "depth",
							Label:     `Depth`,
							Type:      element.TypeText,
							SortOrder: 152,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: carriers/dhl/width
							ID:        "width",
							Label:     `Width`,
							Type:      element.TypeText,
							SortOrder: 153,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: carriers/dhl/doc_methods
							ID:        "doc_methods",
							Label:     `Allowed Methods`,
							Type:      element.TypeMultiselect,
							SortOrder: 170,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `2,5,6,7,9,B,C,D,U,K,L,G,W,I,N,O,R,S,T,X`,
							// SourceModel: Otnegam\Dhl\Model\Source\Method\Doc
						},

						&element.Field{
							// Path: carriers/dhl/nondoc_methods
							ID:        "nondoc_methods",
							Label:     `Allowed Methods`,
							Type:      element.TypeMultiselect,
							SortOrder: 170,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `1,3,4,8,P,Q,E,F,H,J,M,V,Y`,
							// SourceModel: Otnegam\Dhl\Model\Source\Method\Nondoc
						},

						&element.Field{
							// Path: carriers/dhl/ready_time
							ID:        "ready_time",
							Label:     `Ready time`,
							Comment:   element.LongText(`Package ready time after order submission (in hours)`),
							Type:      element.TypeText,
							SortOrder: 180,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/dhl/specificerrmsg
							ID:        "specificerrmsg",
							Label:     `Displayed Error Message`,
							Type:      element.TypeTextarea,
							SortOrder: 800,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `This shipping method is currently unavailable. If you would like to ship using this shipping method, please contact us.`,
						},

						&element.Field{
							// Path: carriers/dhl/free_method_doc
							ID:        "free_method_doc",
							Label:     `Free Method`,
							Type:      element.TypeSelect,
							SortOrder: 1200,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Dhl\Model\Source\Method\Freedoc
						},

						&element.Field{
							// Path: carriers/dhl/free_method_nondoc
							ID:        "free_method_nondoc",
							Label:     `Free Method`,
							Type:      element.TypeSelect,
							SortOrder: 1200,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Dhl\Model\Source\Method\Freenondoc
						},

						&element.Field{
							// Path: carriers/dhl/free_shipping_enable
							ID:        "free_shipping_enable",
							Label:     `Free Shipping Amount Threshold`,
							Type:      element.TypeSelect,
							SortOrder: 1210,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},

						&element.Field{
							// Path: carriers/dhl/free_shipping_subtotal
							ID:        "free_shipping_subtotal",
							Label:     `Free Shipping Amount Threshold`,
							Type:      element.TypeText,
							SortOrder: 1220,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/dhl/sallowspecific
							ID:        "sallowspecific",
							Label:     `Ship to Applicable Countries`,
							Type:      element.TypeSelect,
							SortOrder: 1900,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Shipping\Model\Config\Source\Allspecificcountries
						},

						&element.Field{
							// Path: carriers/dhl/specificcountry
							ID:         "specificcountry",
							Label:      `Ship to Specific Countries`,
							Type:       element.TypeMultiselect,
							SortOrder:  1910,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							CanBeEmpty: true,
							// SourceModel: Otnegam\Directory\Model\Config\Source\Country
						},

						&element.Field{
							// Path: carriers/dhl/showmethod
							ID:        "showmethod",
							Label:     `Show Method if Not Applicable`,
							Type:      element.TypeSelect,
							SortOrder: 1940,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: carriers/dhl/sort_order
							ID:        "sort_order",
							Label:     `Sort Order`,
							Type:      element.TypeText,
							SortOrder: 2000,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: carriers/dhl/debug
							ID:        "debug",
							Label:     `Debug`,
							Type:      element.TypeSelect,
							SortOrder: 1950,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "media_storage_configuration",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/media_storage_configuration/allowed_resources
							ID:      `allowed_resources`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"dhl_folder":"dhl"}`,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "carriers",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "dhl",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: carriers/dhl/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Dhl\Model\Carrier`,
						},

						&element.Field{
							// Path: carriers/dhl/account
							ID:      `account`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: carriers/dhl/free_method
							ID:      `free_method`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `G`,
						},

						&element.Field{
							// Path: carriers/dhl/shipment_days
							ID:      `shipment_days`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Mon,Tue,Wed,Thu,Fri`,
						},

						&element.Field{
							// Path: carriers/dhl/is_online
							ID:      `is_online`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 20
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "design",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "email",
					Label:     `Emails`,
					SortOrder: 510,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/email/logo
							ID:        "logo",
							Label:     `Logo Image`,
							Comment:   element.LongText(`Allowed file types: jpg, jpeg, gif, png. To optimize logo for high-resolution displays, upload an image that is 3x normal size and then specify 1x dimensions in width/height fields below.`),
							Type:      element.TypeImage,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Email\Logo
						},

						&element.Field{
							// Path: design/email/logo_alt
							ID:        "logo_alt",
							Label:     `Logo Image Alt`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/email/logo_width
							ID:        "logo_width",
							Label:     `Logo Width`,
							Comment:   element.LongText(`Only necessary if image has been uploaded above. Enter number of pixels, without appending "px".`),
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/email/logo_height
							ID:        "logo_height",
							Label:     `Logo Height`,
							Comment:   element.LongText(`Only necessary if image has been uploaded above. Enter number of pixels, without appending "px".`),
							Type:      element.TypeText,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/email/header_template
							ID:        "header_template",
							Label:     `Header Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `design_email_header_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: design/email/footer_template
							ID:        "footer_template",
							Label:     `Footer Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `design_email_footer_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "media_storage_configuration",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/media_storage_configuration/allowed_resources
							ID:      `allowed_resources`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"email_folder":"email"}`,
						},
					),
				},

				&element.Group{
					ID: "emails",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/emails/forgot_email_template
							ID:      `forgot_email_template`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `system_emails_forgot_email_template`,
						},

						&element.Field{
							// Path: system/emails/forgot_email_identity
							ID:      `forgot_email_identity`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `general`,
						},
					),
				},

				&element.Group{
					ID: "smtp",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/smtp/disable
							ID:      `disable`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: system/smtp/host
							ID:      `host`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `localhost`,
						},

						&element.Field{
							// Path: system/smtp/port
							ID:      `port`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: 25,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "trans_email",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "ident_custom1",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: trans_email/ident_custom1/email
							ID:      `email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `[email protected]`,
						},

						&element.Field{
							// Path: trans_email/ident_custom1/name
							ID:      `name`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Custom 1`,
						},
					),
				},

				&element.Group{
					ID: "ident_custom2",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: trans_email/ident_custom2/email
							ID:      `email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `[email protected]`,
						},

						&element.Field{
							// Path: trans_email/ident_custom2/name
							ID:      `name`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Custom 2`,
						},
					),
				},

				&element.Group{
					ID: "ident_general",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: trans_email/ident_general/email
							ID:      `email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `[email protected]`,
						},

						&element.Field{
							// Path: trans_email/ident_general/name
							ID:      `name`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Owner`,
						},
					),
				},

				&element.Group{
					ID: "ident_sales",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: trans_email/ident_sales/email
							ID:      `email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `[email protected]`,
						},

						&element.Field{
							// Path: trans_email/ident_sales/name
							ID:      `name`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Sales`,
						},
					),
				},

				&element.Group{
					ID: "ident_support",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: trans_email/ident_support/email
							ID:      `email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `[email protected]`,
						},

						&element.Field{
							// Path: trans_email/ident_support/name
							ID:      `name`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `CustomerSupport`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 21
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "promo",
			Label:     `Promotions`,
			SortOrder: 400,
			Scope:     scope.NewPerm(scope.DefaultID),
			Resource:  0, // Otnegam_SalesRule::config_promo
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "auto_generated_coupon_codes",
					Label:     `Auto Generated Specific Coupon Codes`,
					SortOrder: 10,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: promo/auto_generated_coupon_codes/length
							ID:        "length",
							Label:     `Code Length`,
							Comment:   element.LongText(`Excluding prefix, suffix and separators.`),
							Type:      element.TypeText,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   12,
						},

						&element.Field{
							// Path: promo/auto_generated_coupon_codes/format
							ID:        "format",
							Label:     `Code Format`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   true,
							// SourceModel: Otnegam\SalesRule\Model\System\Config\Source\Coupon\Format
						},

						&element.Field{
							// Path: promo/auto_generated_coupon_codes/prefix
							ID:        "prefix",
							Label:     `Code Prefix`,
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},

						&element.Field{
							// Path: promo/auto_generated_coupon_codes/suffix
							ID:        "suffix",
							Label:     `Code Suffix`,
							Type:      element.TypeText,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},

						&element.Field{
							// Path: promo/auto_generated_coupon_codes/dash
							ID:        "dash",
							Label:     `Dash Every X Characters`,
							Comment:   element.LongText(`If empty no separation.`),
							Type:      element.TypeText,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},
					),
				},
			),
		},
		&element.Section{
			ID: "rss",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "catalog",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: rss/catalog/discounts
							ID:        "discounts",
							Label:     `Coupons/Discounts`,
							Type:      element.TypeSelect,
							SortOrder: 12,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Enabledisable
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 22
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "newrelicreporting",
			Label:     `New Relic Reporting`,
			SortOrder: 1100,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_NewRelicReporting::config_newrelicreporting
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "general",
					Label:     `General`,
					SortOrder: 1,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: newrelicreporting/general/enable
							ID:        "enable",
							Label:     `Enable New Relic Integration`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: newrelicreporting/general/api_url
							ID:        "api_url",
							Label:     `New Relic API URL`,
							Type:      element.TypeText,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `https://api.newrelic.com/deployments.xml`,
						},

						&element.Field{
							// Path: newrelicreporting/general/insights_api_url
							ID:        "insights_api_url",
							Label:     `Insights API URL`,
							Comment:   element.LongText(`Use %s to replace the account ID in the URL`),
							Type:      element.TypeText,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `https://insights-collector.newrelic.com/v1/accounts/%s/events`,
						},

						&element.Field{
							// Path: newrelicreporting/general/account_id
							ID:        "account_id",
							Label:     `New Relic Account ID`,
							Comment:   element.LongText(`"Need a New Relic account? <a href="http://www.newrelic.com/magento" target="_blank">Click here to get one`),
							Type:      element.TypeText,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: newrelicreporting/general/app_id
							ID:        "app_id",
							Label:     `New Relic Application ID`,
							Comment:   element.LongText(`This can commonly be found at the end of the URL when viewing the APM after "/applications/"`),
							Type:      element.TypeText,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: newrelicreporting/general/api
							ID:        "api",
							Label:     `New Relic API Key`,
							Comment:   element.LongText(`This is located by navigating to Events -> Deployments from the New Relic APM website`),
							Type:      element.TypeObscure,
							SortOrder: 6,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: newrelicreporting/general/insights_insert_key
							ID:        "insights_insert_key",
							Label:     `Insights API Key`,
							Comment:   element.LongText(`Generated under Insights in Manage data -> API Keys -> Insert Keys`),
							Type:      element.TypeObscure,
							SortOrder: 7,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Encrypted
						},

						&element.Field{
							// Path: newrelicreporting/general/app_name
							ID:        "app_name",
							Label:     `New Relic Application Name`,
							Comment:   element.LongText(`This is located by navigating to Settings from the New Relic APM website`),
							Type:      element.TypeText,
							SortOrder: 8,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "cron",
					Label:     `Cron`,
					SortOrder: 2,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: newrelicreporting/cron/enable_cron
							ID:        "enable_cron",
							Label:     `Enable Cron`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 23
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "payment",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "paypal_notice",
					SortOrder: 3,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup`),
					Fields:    element.NewFieldSlice(),
				},

				&element.Group{
					ID:        "account",
					Label:     `Merchant Location`,
					SortOrder: 1,
					Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
					Fields: element.NewFieldSlice(
						&element.Field{
							ConfigPath: `paypal/general/merchant_country`, // Original: payment/account/merchant_country
							ID:         "merchant_country",
							Label:      `Merchant Country`,
							Comment:    element.LongText(`If not specified, Default Country from General Config will be used`),
							Type:       element.TypeSelect,
							SortOrder:  5,
							Visible:    element.VisibleYes,
							Scope:      scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// BackendModel: Otnegam\Paypal\Model\System\Config\Backend\MerchantCountry
							// SourceModel: Otnegam\Paypal\Model\System\Config\Source\MerchantCountry
						},
					),
				},
			),
		},
		&element.Section{
			ID: "payment_all_paypal",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "payments_pro_hosted_solution_without_bml",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_us",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "paypal_group_all_in_one",
					Label:     `PayPal All-in-One Payment Solutions&nbsp;&nbsp;<i>Accept and process credit cards and PayPal payments.</i>`,
					Comment:   element.LongText(`Choose a secure bundled payment solution for your business.`),
					SortOrder: 10,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup`),
					Fields:    element.NewFieldSlice(),
				},

				&element.Group{
					ID:        "paypal_payment_gateways",
					Label:     `PayPal Payment Gateways`,
					Comment:   element.LongText(`Process payments using your own internet merchant account.`),
					SortOrder: 15,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content`),
					Fields:    element.NewFieldSlice(),
				},

				&element.Group{
					ID:        "paypal_alternative_payment_methods",
					Label:     `PayPal Express Checkout`,
					Comment:   element.LongText(`Add another payment method to your existing solution or as a stand-alone option.`),
					SortOrder: 20,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content`),
					Fields:    element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_gb",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "paypal_group_all_in_one",
					Label:     `PayPal All-in-One Payment Solutions&nbsp;&nbsp;<i>Accept and process credit cards and PayPal payments.</i>`,
					Comment:   element.LongText(`Choose a secure bundled payment solution for your business.`),
					SortOrder: 10,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup`),
					Fields:    element.NewFieldSlice(),
				},

				&element.Group{
					ID:        "paypal_alternative_payment_methods",
					Label:     `PayPal Express Checkout`,
					Comment:   element.LongText(`Add another payment method to your existing solution or as a stand-alone option.`),
					SortOrder: 20,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content`),
					Fields:    element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_de",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "paypal_payment_solutions",
					Label:     `PayPal Payment Solutions`,
					Comment:   element.LongText(`Add another payment method to your existing solution or as a stand-alone option.`),
					SortOrder: 10,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup`),
					Fields:    element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_other",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "paypal_payment_solutions",
					Label:     `PayPal Payment Solutions`,
					Comment:   element.LongText(`Add another payment method to your existing solution or as a stand-alone option.`),
					SortOrder: 10,
					Scope:     scope.PermAll,
					HelpURL:   element.LongText(`https://www.paypal-marketing.com/emarketing/partner/na/merchantlineup/home.page#mainTab=checkoutlineup&subTab=newlineup`),
					Fields:    element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_ca",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_au",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_jp",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_fr",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_it",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_es",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_hk",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},
		&element.Section{
			ID: "payment_nz",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:     "paypal_payment_solutions",
					Fields: element.NewFieldSlice(),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "paypal",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "style",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: paypal/style/logo
							ID:      `logo`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},
					),
				},

				&element.Group{
					ID: "wpp",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: paypal/wpp/api_password
							ID:      `api_password`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: paypal/wpp/api_signature
							ID:      `api_signature`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: paypal/wpp/api_username
							ID:      `api_username`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: paypal/wpp/button_flavor
							ID:      `button_flavor`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `dynamic`,
						},
					),
				},

				&element.Group{
					ID: "wpuk",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: paypal/wpuk/user
							ID:      `user`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: paypal/wpuk/pwd
							ID:      `pwd`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},
					),
				},

				&element.Group{
					ID: "fetch_reports",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: paypal/fetch_reports/ftp_login
							ID:      `ftp_login`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: paypal/fetch_reports/ftp_password
							ID:      `ftp_password`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: paypal/fetch_reports/schedule
							ID:      `schedule`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: paypal/fetch_reports/time
							ID:      `time`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `00,00,00`,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "payment",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "paypal_express",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/paypal_express/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Express`,
						},

						&element.Field{
							// Path: payment/paypal_express/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal Express Checkout`,
						},

						&element.Field{
							// Path: payment/paypal_express/payment_action
							ID:      `payment_action`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Authorization`,
						},

						&element.Field{
							// Path: payment/paypal_express/solution_type
							ID:      `solution_type`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Mark`,
						},

						&element.Field{
							// Path: payment/paypal_express/line_items_enabled
							ID:      `line_items_enabled`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_express/visible_on_cart
							ID:      `visible_on_cart`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_express/visible_on_product
							ID:      `visible_on_product`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_express/allow_ba_signup
							ID:      `allow_ba_signup`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `never`,
						},

						&element.Field{
							// Path: payment/paypal_express/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/paypal_express/authorization_honor_period
							ID:      `authorization_honor_period`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: 3,
						},

						&element.Field{
							// Path: payment/paypal_express/order_valid_period
							ID:      `order_valid_period`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: 29,
						},

						&element.Field{
							// Path: payment/paypal_express/child_authorization_number
							ID:      `child_authorization_number`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_express/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_express/skip_order_review_step
							ID:      `skip_order_review_step`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},

				&element.Group{
					ID: "paypal_express_bml",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/paypal_express_bml/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Bml`,
						},

						&element.Field{
							// Path: payment/paypal_express_bml/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal Credit`,
						},

						&element.Field{
							// Path: payment/paypal_express_bml/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},
					),
				},

				&element.Group{
					ID: "payflow_express",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/payflow_express/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal Express Checkout Payflow Edition`,
						},

						&element.Field{
							// Path: payment/payflow_express/payment_action
							ID:      `payment_action`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Authorization`,
						},

						&element.Field{
							// Path: payment/payflow_express/line_items_enabled
							ID:      `line_items_enabled`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_express/visible_on_cart
							ID:      `visible_on_cart`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_express/visible_on_product
							ID:      `visible_on_product`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_express/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/payflow_express/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_express/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\PayflowExpress`,
						},
					),
				},

				&element.Group{
					ID: "payflow_express_bml",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/payflow_express_bml/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Payflow\Bml`,
						},

						&element.Field{
							// Path: payment/payflow_express_bml/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal Credit`,
						},

						&element.Field{
							// Path: payment/payflow_express_bml/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},
					),
				},

				&element.Group{
					ID: "payflowpro",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/payflowpro/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Payflow\Transparent`,
						},

						&element.Field{
							// Path: payment/payflowpro/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Credit Card`,
						},

						&element.Field{
							// Path: payment/payflowpro/payment_action
							ID:      `payment_action`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Authorization`,
						},

						&element.Field{
							// Path: payment/payflowpro/cctypes
							ID:      `cctypes`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `AE,VI`,
						},

						&element.Field{
							// Path: payment/payflowpro/useccv
							ID:      `useccv`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflowpro/tender
							ID:      `tender`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `C`,
						},

						&element.Field{
							// Path: payment/payflowpro/verbosity
							ID:      `verbosity`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `MEDIUM`,
						},

						&element.Field{
							// Path: payment/payflowpro/user
							ID:      `user`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: payment/payflowpro/pwd
							ID:      `pwd`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: payment/payflowpro/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/payflowpro/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflowpro/date_delim
							ID:      `date_delim`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: payment/payflowpro/ccfields
							ID:      `ccfields`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `csc,expdate,acct`,
						},

						&element.Field{
							// Path: payment/payflowpro/place_order_url
							ID:      `place_order_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal/transparent/requestSecureToken`,
						},

						&element.Field{
							// Path: payment/payflowpro/cgi_url_test_mode
							ID:      `cgi_url_test_mode`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://pilot-payflowlink.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflowpro/cgi_url
							ID:      `cgi_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://payflowlink.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflowpro/transaction_url_test_mode
							ID:      `transaction_url_test_mode`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://pilot-payflowpro.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflowpro/transaction_url
							ID:      `transaction_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://payflowpro.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflowpro/avs_street
							ID:      `avs_street`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: payment/payflowpro/avs_zip
							ID:      `avs_zip`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: payment/payflowpro/avs_international
							ID:      `avs_international`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: payment/payflowpro/avs_security_code
							ID:      `avs_security_code`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflowpro/cc_year_length
							ID:      `cc_year_length`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: 2,
						},
					),
				},

				&element.Group{
					ID: "paypal_billing_agreement",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/paypal_billing_agreement/active
							ID:      `active`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_billing_agreement/allow_billing_agreement_wizard
							ID:      `allow_billing_agreement_wizard`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/paypal_billing_agreement/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Method\Agreement`,
						},

						&element.Field{
							// Path: payment/paypal_billing_agreement/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal Billing Agreement`,
						},

						&element.Field{
							// Path: payment/paypal_billing_agreement/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/paypal_billing_agreement/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},

				&element.Group{
					ID: "payflow_link",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/payflow_link/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Payflowlink`,
						},

						&element.Field{
							// Path: payment/payflow_link/payment_action
							ID:      `payment_action`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Authorization`,
						},

						&element.Field{
							// Path: payment/payflow_link/verbosity
							ID:      `verbosity`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `HIGH`,
						},

						&element.Field{
							// Path: payment/payflow_link/user
							ID:      `user`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: payment/payflow_link/pwd
							ID:      `pwd`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: payment/payflow_link/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/payflow_link/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Credit Card`,
						},

						&element.Field{
							// Path: payment/payflow_link/partner
							ID:      `partner`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal`,
						},

						&element.Field{
							// Path: payment/payflow_link/csc_required
							ID:      `csc_required`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_link/csc_editable
							ID:      `csc_editable`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_link/url_method
							ID:      `url_method`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `GET`,
						},

						&element.Field{
							// Path: payment/payflow_link/email_confirmation
							ID:      `email_confirmation`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: payment/payflow_link/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_link/transaction_url_test_mode
							ID:      `transaction_url_test_mode`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://pilot-payflowpro.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflow_link/transaction_url
							ID:      `transaction_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://payflowpro.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflow_link/cgi_url_test_mode
							ID:      `cgi_url_test_mode`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://pilot-payflowlink.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflow_link/cgi_url
							ID:      `cgi_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://payflowlink.paypal.com`,
						},
					),
				},

				&element.Group{
					ID: "payflow_advanced",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/payflow_advanced/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Payflowadvanced`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/payment_action
							ID:      `payment_action`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Authorization`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/verbosity
							ID:      `verbosity`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `HIGH`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/user
							ID:      `user`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `[{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}},"PayPal"]`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/pwd
							ID:      `pwd`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"_value":null,"_attribute":{"backend_model":"Otnegam\\Config\\Model\\Config\\Backend\\Encrypted"}}`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Credit Card`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/partner
							ID:      `partner`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/vendor
							ID:      `vendor`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `PayPal`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/csc_required
							ID:      `csc_required`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_advanced/csc_editable
							ID:      `csc_editable`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_advanced/url_method
							ID:      `url_method`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `GET`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/email_confirmation
							ID:      `email_confirmation`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: payment/payflow_advanced/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},

						&element.Field{
							// Path: payment/payflow_advanced/transaction_url_test_mode
							ID:      `transaction_url_test_mode`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://pilot-payflowpro.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/transaction_url
							ID:      `transaction_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://payflowpro.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/cgi_url_test_mode
							ID:      `cgi_url_test_mode`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://pilot-payflowlink.paypal.com`,
						},

						&element.Field{
							// Path: payment/payflow_advanced/cgi_url
							ID:      `cgi_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `https://payflowlink.paypal.com`,
						},
					),
				},

				&element.Group{
					ID: "hosted_pro",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: payment/hosted_pro/model
							ID:      `model`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Paypal\Model\Hostedpro`,
						},

						&element.Field{
							// Path: payment/hosted_pro/title
							ID:      `title`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Payment by cards or by PayPal account`,
						},

						&element.Field{
							// Path: payment/hosted_pro/payment_action
							ID:      `payment_action`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Authorization`,
						},

						&element.Field{
							// Path: payment/hosted_pro/group
							ID:      `group`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `paypal`,
						},

						&element.Field{
							// Path: payment/hosted_pro/display_ec
							ID:      `display_ec`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: false,
						},

						&element.Field{
							// Path: payment/hosted_pro/verify_peer
							ID:      `verify_peer`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 24
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "web",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "cookie",
					Label:     `Default Cookie Settings`,
					SortOrder: 50,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: web/cookie/cookie_lifetime
							ID:        "cookie_lifetime",
							Label:     `Cookie Lifetime`,
							Type:      element.TypeText,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   3600,
							// BackendModel: Otnegam\Cookie\Model\Config\Backend\Lifetime
						},

						&element.Field{
							// Path: web/cookie/cookie_path
							ID:        "cookie_path",
							Label:     `Cookie Path`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Cookie\Model\Config\Backend\Path
						},

						&element.Field{
							// Path: web/cookie/cookie_domain
							ID:        "cookie_domain",
							Label:     `Cookie Domain`,
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Cookie\Model\Config\Backend\Domain
						},

						&element.Field{
							// Path: web/cookie/cookie_httponly
							ID:        "cookie_httponly",
							Label:     `Use HTTP Only`,
							Comment:   element.LongText(`<strong style="color:red">Warning</strong>: Do not set to "No". User security could be compromised.`),
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: web/cookie/cookie_restriction
							ID:        "cookie_restriction",
							Label:     `Cookie Restriction Mode`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// BackendModel: Otnegam\Cookie\Model\Config\Backend\Cookie
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "web",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "cookie",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: web/cookie/cookie_restriction_lifetime
							ID:      `cookie_restriction_lifetime`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: 31536000,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 25
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "catalog",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "productalert",
					Label:     `Product Alerts`,
					SortOrder: 250,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/productalert/allow_price
							ID:        "allow_price",
							Label:     `Allow Alert When Product Price Changes`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/productalert/allow_stock
							ID:        "allow_stock",
							Label:     `Allow Alert When Product Comes Back in Stock`,
							Type:      element.TypeSelect,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/productalert/email_price_template
							ID:        "email_price_template",
							Label:     `Price Alert Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `catalog_productalert_email_price_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: catalog/productalert/email_stock_template
							ID:        "email_stock_template",
							Label:     `Stock Alert Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `catalog_productalert_email_stock_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},

						&element.Field{
							// Path: catalog/productalert/email_identity
							ID:        "email_identity",
							Label:     `Alert Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `general`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},
					),
				},

				&element.Group{
					ID:        "productalert_cron",
					Label:     `Product Alerts Run Settings`,
					SortOrder: 260,
					Scope:     scope.NewPerm(scope.DefaultID),
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/productalert_cron/frequency
							ID:        "frequency",
							Label:     `Frequency`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\Cron\Model\Config\Backend\Product\Alert
							// SourceModel: Otnegam\Cron\Model\Config\Source\Frequency
						},

						&element.Field{
							// Path: catalog/productalert_cron/time
							ID:        "time",
							Label:     `Start Time`,
							Type:      element.TypeTime,
							SortOrder: 2,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},

						&element.Field{
							// Path: catalog/productalert_cron/error_email
							ID:        "error_email",
							Label:     `Error Email Recipient`,
							Type:      element.TypeText,
							SortOrder: 3,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},

						&element.Field{
							// Path: catalog/productalert_cron/error_email_identity
							ID:        "error_email_identity",
							Label:     `Error Email Sender`,
							Type:      element.TypeSelect,
							SortOrder: 4,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `general`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Identity
						},

						&element.Field{
							// Path: catalog/productalert_cron/error_email_template
							ID:        "error_email_template",
							Label:     `Error Email Template`,
							Comment:   element.LongText(`Email template chosen based on theme fallback when "Default" option is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   `catalog_productalert_cron_error_email_template`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Email\Template
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "catalog",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "productalert_cron",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/productalert_cron/error_email
							ID:      `error_email`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 26
0
// test package names are different.
var configStructure = element.MustNewConfiguration(
	&element.Section{
		ID: "web",
		Groups: element.NewGroupSlice(
			&element.Group{
				ID:        "cors",
				Label:     `CORS Cross Origin Resource Sharing`,
				SortOrder: 150,
				Scope:     scope.NewPerm(scope.DefaultID),
				Fields: element.NewFieldSlice(
					&element.Field{
						// Path: `web/cors/exposed_headers`,
						ID:        "exposed_headers",
						Label:     `Exposed Headers`,
						Comment:   element.LongText(`Indicates which headers are safe to expose to the API of a CORS API specification. Separate via line break`),
						Type:      element.TypeTextarea,
						SortOrder: 10,
						Visible:   element.VisibleYes,
						Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						Default:   "Content-Type,X-CoreStore-ID",
					},
					&element.Field{
						// Path: `web/cors/allow_credentials`,
						ID:        "allow_credentials",
						Label:     `Allowed Credentials`,
						Type:      element.TypeSelect,
						SortOrder: 30,
						Visible:   element.VisibleYes,
						Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						Default:   "true",
Exemplo n.º 27
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "tax",
			Label:     `Tax`,
			SortOrder: 303,
			Scope:     scope.PermAll,
			Resource:  0, // Otnegam_Tax::config_tax
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "classes",
					Label:     `Tax Classes`,
					SortOrder: 10,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/classes/shipping_tax_class
							ID:        "shipping_tax_class",
							Label:     `Tax Class for Shipping`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Tax\Model\TaxClass\Source\Product
						},

						&element.Field{
							// Path: tax/classes/default_product_tax_class
							ID:        "default_product_tax_class",
							Label:     `Default Tax Class for Product`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   2,
							// BackendModel: Otnegam\Tax\Model\Config\TaxClass
							// SourceModel: Otnegam\Tax\Model\TaxClass\Source\Product
						},

						&element.Field{
							// Path: tax/classes/default_customer_tax_class
							ID:        "default_customer_tax_class",
							Label:     `Default Tax Class for Customer`,
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							Default:   3,
							// SourceModel: Otnegam\Tax\Model\TaxClass\Source\Customer
						},
					),
				},

				&element.Group{
					ID:        "calculation",
					Label:     `Calculation Settings`,
					SortOrder: 20,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/calculation/algorithm
							ID:        "algorithm",
							Label:     `Tax Calculation Method Based On`,
							Type:      element.TypeSelect,
							SortOrder: 1,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `TOTAL_BASE_CALCULATION`,
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Algorithm
						},

						&element.Field{
							// Path: tax/calculation/based_on
							ID:        "based_on",
							Label:     `Tax Calculation Based On`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `shipping`,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\Config\Source\Basedon
						},

						&element.Field{
							// Path: tax/calculation/price_includes_tax
							ID:        "price_includes_tax",
							Label:     `Catalog Prices`,
							Comment:   element.LongText(`This sets whether catalog prices entered from Otnegam Admin include tax.`),
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// BackendModel: Otnegam\Tax\Model\Config\Price\IncludePrice
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\PriceType
						},

						&element.Field{
							// Path: tax/calculation/shipping_includes_tax
							ID:        "shipping_includes_tax",
							Label:     `Shipping Prices`,
							Comment:   element.LongText(`This sets whether shipping amounts entered from Otnegam Admin or obtained from gateways include tax.`),
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// BackendModel: Otnegam\Tax\Model\Config\Price\IncludePrice
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\PriceType
						},

						&element.Field{
							// Path: tax/calculation/apply_after_discount
							ID:        "apply_after_discount",
							Label:     `Apply Customer Tax`,
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Apply
						},

						&element.Field{
							// Path: tax/calculation/discount_tax
							ID:        "discount_tax",
							Label:     `Apply Discount On Prices`,
							Comment:   element.LongText(`Apply discount on price including tax is calculated based on store tax if "Apply Tax after Discount" is selected.`),
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   `["0","0"]`,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\PriceType
						},

						&element.Field{
							// Path: tax/calculation/apply_tax_on
							ID:        "apply_tax_on",
							Label:     `Apply Tax On`,
							Type:      element.TypeSelect,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   false,
							// SourceModel: Otnegam\Tax\Model\Config\Source\Apply\On
						},

						&element.Field{
							// Path: tax/calculation/cross_border_trade_enabled
							ID:        "cross_border_trade_enabled",
							Label:     `Enable Cross Border Trade`,
							Comment:   element.LongText(`When catalog price includes tax, enable this setting to fix the price no matter what the customer's tax rate.`),
							Type:      element.TypeSelect,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "defaults",
					Label:     `Default Tax Destination Calculation`,
					SortOrder: 30,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/defaults/country
							ID:        "country",
							Label:     `Default Country`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `US`,
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Country
						},

						&element.Field{
							// Path: tax/defaults/region
							ID:        "region",
							Label:     `Default State`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Region
						},

						&element.Field{
							// Path: tax/defaults/postcode
							ID:        "postcode",
							Label:     `Default Post Code`,
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "display",
					Label:     `Price Display Settings`,
					SortOrder: 40,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/display/type
							ID:        "type",
							Label:     `Display Product Prices In Catalog`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/display/shipping
							ID:        "shipping",
							Label:     `Display Shipping Prices`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},
					),
				},

				&element.Group{
					ID:        "cart_display",
					Label:     `Shopping Cart Display Settings`,
					SortOrder: 50,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/cart_display/price
							ID:        "price",
							Label:     `Display Prices`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/cart_display/subtotal
							ID:        "subtotal",
							Label:     `Display Subtotal`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/cart_display/shipping
							ID:        "shipping",
							Label:     `Display Shipping Amount`,
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/cart_display/grandtotal
							ID:        "grandtotal",
							Label:     `Include Tax In Order Total`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: tax/cart_display/full_summary
							ID:        "full_summary",
							Label:     `Display Full Tax Summary`,
							Type:      element.TypeSelect,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: tax/cart_display/zero_tax
							ID:        "zero_tax",
							Label:     `Display Zero Tax Subtotal`,
							Type:      element.TypeSelect,
							SortOrder: 120,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "sales_display",
					Label:     `Orders, Invoices, Credit Memos Display Settings`,
					SortOrder: 60,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/sales_display/price
							ID:        "price",
							Label:     `Display Prices`,
							Type:      element.TypeSelect,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/sales_display/subtotal
							ID:        "subtotal",
							Label:     `Display Subtotal`,
							Type:      element.TypeSelect,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/sales_display/shipping
							ID:        "shipping",
							Label:     `Display Shipping Amount`,
							Type:      element.TypeSelect,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   true,
							// BackendModel: Otnegam\Tax\Model\Config\Notification
							// SourceModel: Otnegam\Tax\Model\System\Config\Source\Tax\Display\Type
						},

						&element.Field{
							// Path: tax/sales_display/grandtotal
							ID:        "grandtotal",
							Label:     `Include Tax In Order Total`,
							Type:      element.TypeSelect,
							SortOrder: 50,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: tax/sales_display/full_summary
							ID:        "full_summary",
							Label:     `Display Full Tax Summary`,
							Type:      element.TypeSelect,
							SortOrder: 60,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: tax/sales_display/zero_tax
							ID:        "zero_tax",
							Label:     `Display Zero Tax Subtotal`,
							Type:      element.TypeSelect,
							SortOrder: 120,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   false,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "tax",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "cart_display",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/cart_display/discount
							ID:      `discount`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},

				&element.Group{
					ID: "sales_display",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/sales_display/discount
							ID:      `discount`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: true,
						},
					),
				},

				&element.Group{
					ID: "notification",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: tax/notification/info_url
							ID:      `info_url`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `http://docs.magento.com/m2/ce/user_guide/tax/warning-messages.html`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 28
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID:        "system",
			SortOrder: 900,
			Scope:     scope.PermAll,
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "media_storage_configuration",
					Label:     `Storage Configuration for Media`,
					SortOrder: 900,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/media_storage_configuration/media_storage
							ID:        "media_storage",
							Label:     `Media Storage`,
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// SourceModel: Otnegam\MediaStorage\Model\Config\Source\Storage\Media\Storage
						},

						&element.Field{
							// Path: system/media_storage_configuration/media_database
							ID:        "media_database",
							Label:     `Select Media Database`,
							Type:      element.TypeSelect,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
							// BackendModel: Otnegam\MediaStorage\Model\Config\Backend\Storage\Media\Database
							// SourceModel: Otnegam\MediaStorage\Model\Config\Source\Storage\Media\Database
						},

						&element.Field{
							// Path: system/media_storage_configuration/synchronize
							ID:        "synchronize",
							Comment:   element.LongText(`After selecting a new media storage location, press the Synchronize button to transfer all media to that location. Media will not be available in the new location until the synchronization process is complete.`),
							Type:      element.TypeButton,
							SortOrder: 300,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},

						&element.Field{
							// Path: system/media_storage_configuration/configuration_update_time
							ID:        "configuration_update_time",
							Label:     `Environment Update Time`,
							Type:      element.TypeText,
							SortOrder: 400,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID),
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 29
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "design",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "head",
					Label:     `HTML Head`,
					SortOrder: 20,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/head/shortcut_icon
							ID:        "shortcut_icon",
							Label:     `Favicon Icon`,
							Comment:   element.LongText(`Allowed file types: ICO, PNG, GIF, JPG, JPEG, APNG, SVG. Not all browsers support all these formats!`),
							Type:      element.TypeImage,
							SortOrder: 5,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Image\Favicon
						},

						&element.Field{
							// Path: design/head/default_title
							ID:        "default_title",
							Label:     `Default Title`,
							Type:      element.TypeText,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/head/title_prefix
							ID:        "title_prefix",
							Label:     `Title Prefix`,
							Type:      element.TypeText,
							SortOrder: 12,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/head/title_suffix
							ID:        "title_suffix",
							Label:     `Title Suffix`,
							Type:      element.TypeText,
							SortOrder: 14,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/head/default_description
							ID:        "default_description",
							Label:     `Default Description`,
							Type:      element.TypeTextarea,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/head/default_keywords
							ID:        "default_keywords",
							Label:     `Default Keywords`,
							Type:      element.TypeTextarea,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/head/includes
							ID:        "includes",
							Label:     `Miscellaneous Scripts`,
							Comment:   element.LongText(`This will be included before head closing tag in page HTML.`),
							Type:      element.TypeTextarea,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/head/demonotice
							ID:        "demonotice",
							Label:     `Display Demo Store Notice`,
							Type:      element.TypeSelect,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},

				&element.Group{
					ID:        "search_engine_robots",
					Label:     `Search Engine Robots`,
					SortOrder: 25,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/search_engine_robots/default_robots
							ID:        "default_robots",
							Label:     `Default Robots`,
							Comment:   element.LongText(`This will be included before head closing tag in page HTML.`),
							Type:      element.TypeSelect,
							SortOrder: 40,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `INDEX,FOLLOW`,
							// SourceModel: Otnegam\Config\Model\Config\Source\Design\Robots
						},

						&element.Field{
							// Path: design/search_engine_robots/custom_instructions
							ID:        "custom_instructions",
							Label:     `Edit custom instruction of robots.txt File`,
							Type:      element.TypeTextarea,
							SortOrder: 70,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Admin\Robots
						},

						&element.Field{
							// Path: design/search_engine_robots/reset_to_defaults
							ID:        "reset_to_defaults",
							Label:     `Reset to Defaults`,
							Comment:   element.LongText(`This action will delete your custom instructions and reset robots.txt file to system's default settings.`),
							Type:      element.TypeButton,
							SortOrder: 80,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "header",
					Label:     `Header`,
					SortOrder: 30,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/header/logo_src
							ID:        "logo_src",
							Label:     `Logo Image`,
							Comment:   element.LongText(`Allowed file types:PNG, GIF, JPG, JPEG, SVG.`),
							Type:      element.TypeImage,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							// BackendModel: Otnegam\Config\Model\Config\Backend\Image\Logo
						},

						&element.Field{
							// Path: design/header/logo_width
							ID:        "logo_width",
							Label:     `Logo Image Width`,
							Type:      element.TypeText,
							SortOrder: 11,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/header/logo_height
							ID:        "logo_height",
							Label:     `Logo Image Height`,
							Type:      element.TypeText,
							SortOrder: 12,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/header/logo_alt
							ID:        "logo_alt",
							Label:     `Logo Image Alt`,
							Type:      element.TypeText,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/header/welcome
							ID:        "welcome",
							Label:     `Welcome Text`,
							Type:      element.TypeText,
							SortOrder: 30,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},

				&element.Group{
					ID:        "footer",
					Label:     `Footer`,
					SortOrder: 40,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/footer/copyright
							ID:        "copyright",
							Label:     `Copyright`,
							Type:      element.TypeTextarea,
							SortOrder: 10,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},

						&element.Field{
							// Path: design/footer/absolute_footer
							ID:        "absolute_footer",
							Label:     `Miscellaneous HTML`,
							Comment:   element.LongText(`This will be displayed just before body closing tag.`),
							Type:      element.TypeTextarea,
							SortOrder: 20,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
						},
					),
				},
			),
		},

		// Hidden Configuration, may be visible somewhere else ...
		&element.Section{
			ID: "design",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "invalid_caches",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/invalid_caches/block_html
							ID:      `block_html`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: design/invalid_caches/layout
							ID:      `layout`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},

						&element.Field{
							// Path: design/invalid_caches/translate
							ID:      `translate`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
						},
					),
				},

				&element.Group{
					ID: "head",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/head/_value
							ID:      `_value`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"default_title":"Otnegam Commerce","default_description":"Default Description","default_keywords":"Otnegam, Varien, E-commerce","default_media_type":"text\/html","default_charset":"utf-8"}`,
						},

						&element.Field{
							// Path: design/head/_attribute
							ID:      `_attribute`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"translate":"default_description"}`,
						},
					),
				},

				&element.Group{
					ID: "search_engine_robots",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/search_engine_robots/default_custom_instructions
							ID:      `default_custom_instructions`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `
User-agent: *
Disallow: /index.php/
Disallow: /*?
Disallow: /checkout/
Disallow: /app/
Disallow: /lib/
Disallow: /*.php$
Disallow: /pkginfo/
Disallow: /report/
Disallow: /var/
Disallow: /catalog/
Disallow: /customer/
Disallow: /sendfriend/
Disallow: /review/
Disallow: /*SID=
                    `,
						},
					),
				},

				&element.Group{
					ID: "header",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/header/_value
							ID:      `_value`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"logo_alt":"Otnegam Commerce","welcome":"Default welcome msg!"}`,
						},

						&element.Field{
							// Path: design/header/_attribute
							ID:      `_attribute`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"translate":"welcome"}`,
						},
					),
				},

				&element.Group{
					ID: "footer",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: design/footer/_value
							ID:      `_value`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"copyright":"Copyright \u00a9 2015 Otnegam. All rights reserved."}`,
						},

						&element.Field{
							// Path: design/footer/_attribute
							ID:      `_attribute`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"translate":"copyright"}`,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "theme",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "customization",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: theme/customization/custom_css
							ID:      `custom_css`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `Otnegam\Theme\Model\Theme\Customization\File\CustomCss`,
						},
					),
				},
			),
		},
		&element.Section{
			ID: "system",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID: "media_storage_configuration",
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: system/media_storage_configuration/allowed_resources
							ID:      `allowed_resources`,
							Type:    element.TypeHidden,
							Visible: element.VisibleNo,
							Default: `{"site_favicons":"favicon"}`,
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}
Exemplo n.º 30
0
func init() {
	ConfigStructure = element.MustNewConfiguration(
		&element.Section{
			ID: "catalog",
			Groups: element.NewGroupSlice(
				&element.Group{
					ID:        "downloadable",
					Label:     `Downloadable Product Options`,
					SortOrder: 600,
					Scope:     scope.PermAll,
					Fields: element.NewFieldSlice(
						&element.Field{
							// Path: catalog/downloadable/order_item_status
							ID:        "order_item_status",
							Label:     `Order Item Status to Enable Downloads`,
							Type:      element.TypeSelect,
							SortOrder: 100,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   9,
							// SourceModel: Otnegam\Downloadable\Model\System\Config\Source\Orderitemstatus
						},

						&element.Field{
							// Path: catalog/downloadable/downloads_number
							ID:        "downloads_number",
							Label:     `Default Maximum Number of Downloads`,
							Type:      element.TypeText,
							SortOrder: 200,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
						},

						&element.Field{
							// Path: catalog/downloadable/shareable
							ID:        "shareable",
							Label:     `Shareable`,
							Type:      element.TypeSelect,
							SortOrder: 300,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/downloadable/samples_title
							ID:        "samples_title",
							Label:     `Default Sample Title`,
							Type:      element.TypeText,
							SortOrder: 400,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `Samples`,
						},

						&element.Field{
							// Path: catalog/downloadable/links_title
							ID:        "links_title",
							Label:     `Default Link Title`,
							Type:      element.TypeText,
							SortOrder: 500,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `Links`,
						},

						&element.Field{
							// Path: catalog/downloadable/links_target_new_window
							ID:        "links_target_new_window",
							Label:     `Open Links in New Window`,
							Type:      element.TypeSelect,
							SortOrder: 600,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},

						&element.Field{
							// Path: catalog/downloadable/content_disposition
							ID:        "content_disposition",
							Label:     `Use Content-Disposition`,
							Type:      element.TypeSelect,
							SortOrder: 700,
							Visible:   element.VisibleYes,
							Scope:     scope.PermAll,
							Default:   `inline`,
							// SourceModel: Otnegam\Downloadable\Model\System\Config\Source\Contentdisposition
						},

						&element.Field{
							// Path: catalog/downloadable/disable_guest_checkout
							ID:        "disable_guest_checkout",
							Label:     `Disable Guest Checkout if Cart Contains Downloadable Items`,
							Comment:   element.LongText(`Guest checkout will only work with shareable.`),
							Type:      element.TypeSelect,
							SortOrder: 800,
							Visible:   element.VisibleYes,
							Scope:     scope.NewPerm(scope.DefaultID, scope.WebsiteID),
							Default:   true,
							// SourceModel: Otnegam\Config\Model\Config\Source\Yesno
						},
					),
				},
			),
		},
	)
	Backend = NewBackend(ConfigStructure)
}