catconfig

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: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PriceScopeGlobal prices are for all stores and websites the same.
	PriceScopeGlobal int = 0
	// PriceScopeWebsite prices are in each website different.
	PriceScopeWebsite int = 1
)

Variables

This section is empty.

Functions

func BaseCurrency

BaseCurrency returns the base currency code of a website.

1st argument should be a path to catalog/price/scope
2nd argument should be a path to currency/options/base

func MustNewConfigStructure

func MustNewConfigStructure() element.SectionSlice

MustNewConfigStructure same as NewConfigStructure() but panics on error.

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 PkgBackend

type PkgBackend struct {
	cfgmodel.PkgBackend
	// CatalogFieldsMasksSku => Mask for SKU.
	// Use {{name}} as Product Name placeholder
	// Path: catalog/fields_masks/sku
	CatalogFieldsMasksSku cfgmodel.Str

	// CatalogFieldsMasksMetaTitle => Mask for Meta Title.
	// Use {{name}} as Product Name placeholder
	// Path: catalog/fields_masks/meta_title
	CatalogFieldsMasksMetaTitle cfgmodel.Str

	// CatalogFieldsMasksMetaKeyword => Mask for Meta Keywords.
	// Use {{name}} as Product Name or {{sku}} as Product SKU placeholders
	// Path: catalog/fields_masks/meta_keyword
	CatalogFieldsMasksMetaKeyword cfgmodel.Str

	// CatalogFieldsMasksMetaDescription => Mask for Meta Description.
	// Use {{name}} and {{description}} as Product Name and Product Description
	// placeholders
	// Path: catalog/fields_masks/meta_description
	CatalogFieldsMasksMetaDescription cfgmodel.Str

	// CatalogFrontendListMode => List Mode.
	// Path: catalog/frontend/list_mode
	// SourceModel: Magento\Catalog\Model\Config\Source\ListMode
	CatalogFrontendListMode cfgmodel.Str

	// CatalogFrontendGridPerPageValues => Products per Page on Grid Allowed Values.
	// Comma-separated.
	// Path: catalog/frontend/grid_per_page_values
	CatalogFrontendGridPerPageValues cfgmodel.Str

	// CatalogFrontendGridPerPage => Products per Page on Grid Default Value.
	// Must be in the allowed values list
	// Path: catalog/frontend/grid_per_page
	CatalogFrontendGridPerPage cfgmodel.Str

	// CatalogFrontendListPerPageValues => Products per Page on List Allowed Values.
	// Comma-separated.
	// Path: catalog/frontend/list_per_page_values
	CatalogFrontendListPerPageValues cfgmodel.Str

	// CatalogFrontendListPerPage => Products per Page on List Default Value.
	// Must be in the allowed values list
	// Path: catalog/frontend/list_per_page
	CatalogFrontendListPerPage cfgmodel.Str

	// CatalogFrontendFlatCatalogCategory => Use Flat Catalog Category.
	// Path: catalog/frontend/flat_catalog_category
	// BackendModel: Magento\Catalog\Model\Indexer\Category\Flat\System\Config\Mode
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogFrontendFlatCatalogCategory cfgmodel.Bool

	// CatalogFrontendFlatCatalogProduct => Use Flat Catalog Product.
	// Path: catalog/frontend/flat_catalog_product
	// BackendModel: Magento\Catalog\Model\Indexer\Product\Flat\System\Config\Mode
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogFrontendFlatCatalogProduct cfgmodel.Bool

	// CatalogFrontendDefaultSortBy => Product Listing Sort by.
	// Path: catalog/frontend/default_sort_by
	// SourceModel: Magento\Catalog\Model\Config\Source\ListSort
	CatalogFrontendDefaultSortBy cfgmodel.Str

	// CatalogFrontendListAllowAll => Allow All Products per Page.
	// Whether to show "All" option in the "Show X Per Page" dropdown
	// Path: catalog/frontend/list_allow_all
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogFrontendListAllowAll cfgmodel.Bool

	// CatalogFrontendParseUrlDirectives => Allow Dynamic Media URLs in Products and Categories.
	// E.g. {{media url="path/to/image.jpg"}} {{skin url="path/to/picture.gif"}}.
	// Dynamic directives parsing impacts catalog performance.
	// Path: catalog/frontend/parse_url_directives
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogFrontendParseUrlDirectives cfgmodel.Bool

	// CatalogPlaceholderPlaceholder => .
	// Path: catalog/placeholder/placeholder
	// BackendModel: Magento\Config\Model\Config\Backend\Image
	CatalogPlaceholderPlaceholder cfgmodel.Str

	// CatalogSeoTitleSeparator => Page Title Separator.
	// Path: catalog/seo/title_separator
	CatalogSeoTitleSeparator cfgmodel.Str

	// CatalogSeoCategoryCanonicalTag => Use Canonical Link Meta Tag For Categories.
	// Path: catalog/seo/category_canonical_tag
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogSeoCategoryCanonicalTag cfgmodel.Bool

	// CatalogSeoProductCanonicalTag => Use Canonical Link Meta Tag For Products.
	// Path: catalog/seo/product_canonical_tag
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogSeoProductCanonicalTag cfgmodel.Bool

	// CatalogPriceScope => Catalog Price Scope.
	// This defines the base currency scope ("Currency Setup" > "Currency Options"
	// > "Base Currency").
	// Path: catalog/price/scope
	// BackendModel: Magento\Catalog\Model\Indexer\Product\Price\System\Config\PriceScope
	// SourceModel: Magento\Catalog\Model\Config\Source\Price\Scope
	CatalogPriceScope PriceScope

	// CatalogNavigationMaxDepth => Maximal Depth.
	// Path: catalog/navigation/max_depth
	CatalogNavigationMaxDepth cfgmodel.Str

	// CatalogCustomOptionsUseCalendar => Use JavaScript Calendar.
	// Path: catalog/custom_options/use_calendar
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CatalogCustomOptionsUseCalendar cfgmodel.Bool

	// CatalogCustomOptionsDateFieldsOrder => Date Fields Order.
	// Path: catalog/custom_options/date_fields_order
	CatalogCustomOptionsDateFieldsOrder cfgmodel.Str

	// CatalogCustomOptionsTimeFormat => Time Format.
	// Path: catalog/custom_options/time_format
	// SourceModel: Magento\Catalog\Model\Config\Source\TimeFormat
	CatalogCustomOptionsTimeFormat cfgmodel.Str

	// CatalogCustomOptionsYearRange => Year Range.
	// Please use a four-digit year format.
	// Path: catalog/custom_options/year_range
	CatalogCustomOptionsYearRange cfgmodel.Str

	// DesignWatermarkSize => Watermark Default Size.
	// Example format: 200x300.
	// Path: design/watermark/size
	DesignWatermarkSize cfgmodel.Str

	// DesignWatermarkImageOpacity => Watermark Opacity, Percent.
	// Path: design/watermark/imageOpacity
	DesignWatermarkImageOpacity cfgmodel.Str

	// DesignWatermarkImage => Watermark.
	// Allowed file types: jpeg, gif, png.
	// Path: design/watermark/image
	// BackendModel: Magento\Config\Model\Config\Backend\Image
	DesignWatermarkImage cfgmodel.Str

	// DesignWatermarkPosition => Watermark Position.
	// Path: design/watermark/position
	// SourceModel: Magento\Catalog\Model\Config\Source\Watermark\Position
	DesignWatermarkPosition cfgmodel.Str

	// CmsWysiwygUseStaticUrlsInCatalog => Use Static URLs for Media Content in WYSIWYG for Catalog.
	// 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.
	// Path: cms/wysiwyg/use_static_urls_in_catalog
	// SourceModel: Magento\Config\Model\Config\Source\Yesno
	CmsWysiwygUseStaticUrlsInCatalog cfgmodel.Bool

	// RssCatalogNew => New Products.
	// Path: rss/catalog/new
	// SourceModel: Magento\Config\Model\Config\Source\Enabledisable
	RssCatalogNew cfgmodel.Bool

	// RssCatalogSpecial => Special Products.
	// Path: rss/catalog/special
	// SourceModel: Magento\Config\Model\Config\Source\Enabledisable
	RssCatalogSpecial cfgmodel.Bool

	// RssCatalogCategory => Top Level Category.
	// Path: rss/catalog/category
	// SourceModel: Magento\Config\Model\Config\Source\Enabledisable
	RssCatalogCategory cfgmodel.Bool
}

PkgBackend just exported for the sake of documentation. See fields for more information. The PkgBackend handles the reading and writing of configuration values within this package.

func NewBackend

func NewBackend(cfgStruct element.SectionSlice) *PkgBackend

NewBackend initializes the global configuration models containing the cfgpath.Route variable to the appropriate entry. The function Load() will be executed to apply the SectionSlice to all models. See Load() for more details.

func (*PkgBackend) Load

func (pp *PkgBackend) Load(cfgStruct element.SectionSlice) *PkgBackend

Load creates the configuration models for each PkgBackend field. Internal mutex will protect the fields during loading. The argument SectionSlice will be applied to all models.

type PriceScope

type PriceScope struct {
	cfgmodel.Int
}

PriceScope takes of the correct values for the price scope. A price scope can only be global or website based.

func NewPriceScope

func NewPriceScope(path string, opts ...cfgmodel.Option) PriceScope

NewPriceScope defines the base currency scope ("Currency Setup" > "Currency Options" > "Base Currency"). can be 0 = Global or 1 = Website See constants PriceScopeGlobal and PriceScopeWebsite.

func (PriceScope) IsGlobal

func (p PriceScope) IsGlobal(sg config.Scoped) (bool, error)

IsGlobal true if global scope for base currency

func (PriceScope) Write

func (p PriceScope) Write(w config.Writer, v int, s scope.Type, id int64, idx interface {
	Invalidate()
}) error

Jump to

Keyboard shortcuts

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