backendstore

package
v0.0.0-...-6f8fa1e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewConfigStructure

func NewConfigStructure() (element.SectionSlice, error)

NewConfigStructure global configuration structure for this package. Used in frontend (to display the user all the settings) and in backend (scope checks and default values). See the source code of this function for the overall available sections, groups and fields.

Types

type Configuration

type Configuration struct {

	// GeneralStoreInformationName => Store Name.
	// Path: general/store_information/name
	GeneralStoreInformationName cfgmodel.Str

	// GeneralStoreInformationPhone => Store Phone Number.
	// Path: general/store_information/phone
	GeneralStoreInformationPhone cfgmodel.Str

	// GeneralStoreInformationHours => Store Hours of Operation.
	// Path: general/store_information/hours
	GeneralStoreInformationHours cfgmodel.Str

	// GeneralStoreInformationCountryID => Country. You must set the
	// cfgmodel.MapIntResolver after calling New() of this package.
	// Path: general/store_information/country_id
	// SourceModel: Magento\Directory\Model\Config\Source\Country
	GeneralStoreInformationCountryID cfgmodel.MapIntStr

	// GeneralStoreInformationRegionID => Region/State. You must set the
	// cfgmodel.MapIntResolver after calling New() of this package.
	// Path: general/store_information/region_id
	GeneralStoreInformationRegionID cfgmodel.MapIntStr

	// GeneralStoreInformationPostcode => ZIP/Postal Code.
	// Path: general/store_information/postcode
	GeneralStoreInformationPostcode cfgmodel.Str

	// GeneralStoreInformationCity => City.
	// Path: general/store_information/city
	GeneralStoreInformationCity cfgmodel.Str

	// GeneralStoreInformationStreetLine1 => Street Address.
	// Path: general/store_information/street_line1
	GeneralStoreInformationStreetLine1 cfgmodel.Str

	// GeneralStoreInformationStreetLine2 => Street Address Line 2.
	// Path: general/store_information/street_line2
	GeneralStoreInformationStreetLine2 cfgmodel.Str

	// GeneralStoreInformationMerchantVatNumber => VAT Number.
	// Path: general/store_information/merchant_vat_number
	GeneralStoreInformationMerchantVatNumber cfgmodel.Str

	// GeneralSingleStoreModeEnabled => Enable Single-Store Mode. This setting
	// will not be taken into account if system has more than one store view.
	// Path: general/single_store_mode/enabled
	GeneralSingleStoreModeEnabled cfgmodel.Bool
}

Configuration just exported for the sake of documentation. See fields for more information. Please call the New() function for creating a new Configuration object. Only the New() function will set the paths to the fields.

func New

func New(cfgStruct element.SectionSlice, opts ...cfgmodel.Option) *Configuration

New initializes the backend configuration models containing the cfgpath.Route variable to the appropriate entries in the storage. The argument SectionSlice and opts will be applied to all models.

func (*Configuration) StoreInformation

func (c *Configuration) StoreInformation(sg config.Scoped) (*StoreInformation, error)

StoreInformation reads the store information from the configuration depending on the scope. Might be usable in e.g. text/template or html/template. Does not yet cache internally per scope the data.

type StoreInformation

type StoreInformation struct {
	ScopeID     scope.TypeID
	Name        string
	Phone       string
	Hours       string
	Country     string
	Region      string
	PostCode    string
	City        string
	StreetLine1 string
	StreetLine2 string
	Vat         string
}

StoreInformation defines the address data for a merchant. Might be usable in e.g. text/template or html/template.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL