Пример #1
0
// AddressSourceCountry retrieves slice of countries @todo
// @see magento2/site/app/code/Magento/Customer/Model/Resource/Address/Attribute/Source/Country.php
func AddressSourceCountry() *eav.AttributeSource {
	return eav.NewAttributeSource(
		// temporary because later these values comes from another slice/container/database
		func(as *eav.AttributeSource) {
			as.Source = []string{
				"AU", "Straya",
				"NZ", "Kiwi land",
				"DE", "Autobahn",
				"SE", "Smørrebrød",
			}
		},
	)
}
Пример #2
0
// AddressSourceRegion
// @see magento2/site/app/code/Magento/Customer/Model/Resource/Address/Attribute/Source/Region.php
func AddressSourceRegion() *eav.AttributeSource {
	return eav.NewAttributeSource(
		// temporary because later these values comes from another slice/container/database
		func(as *eav.AttributeSource) {
			as.Source = []string{
				"BAY", "Bavaria",
				"BAW", "Baden-Würstchenberg",
				"HAM", "Hamburg",
				"BER", "Bärlin",
			}
		},
	)
}
Пример #3
0
func TestAttributeSource(t *testing.T) {
	a := eav.NewAttributeSource(
		// temporary because later these values comes from another slice/container/database
		func(as *eav.AttributeSource) {
			as.Source = []string{
				"BAY", "Bavaria",
				"BAW", "Baden-Würstchenberg",
				"HAM", "Hamburg",
				"BER", "Bärlin",
			}
		},
	)
	assert.Equal(
		t,
		eav.AttributeSourceOptions{eav.AttributeSourceOption{Value: "BAY", Label: "Bavaria"}, eav.AttributeSourceOption{Value: "BAW", Label: "Baden-Würstchenberg"}, eav.AttributeSourceOption{Value: "HAM", Label: "Hamburg"}, eav.AttributeSourceOption{Value: "BER", Label: "Bärlin"}},
		a.GetAllOptions(),
	)

}
Пример #4
0
// ProductSourceVisibility @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Visibility.php
// This class is misplaced in Magento2 maybe they move it to the correct location ...
func ProductSourceVisibility() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #5
0
// ProductSourceStatus @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php
func ProductSourceStatus() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #6
0
// ProductSourceLayout @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php
func ProductSourceLayout() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #7
0
// ProductSourceDesignOptionsContainer @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Entity/Product/Attribute/Design/Options/Container.php
// @see magento2/site/app/code/Magento/Catalog/etc/di.xml Line ~109
func ProductSourceDesignOptionsContainer() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #8
0
// ProductSourceCountryOfManufacture @todo hand out price for longest name ;-)
// @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Countryofmanufacture.php
func ProductSourceCountryOfManufacture() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #9
0
// CustomerSourceWebsite handle store source @todo
// @see magento2/site/app/code/Magento/Customer/Model/Customer/Attribute/Source/Website.php
func CustomerSourceWebsite() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #10
0
// CustomerSourceGroup customer group handling @todo
// @see magento2/site/app/code/Magento/Customer/Model/Customer/Attribute/Source/Group.php
func CustomerSourceGroup() todoASG {
	return todoASG{
		AttributeSource: eav.NewAttributeSource(),
	}
}
Пример #11
0
// CategorySourceMode @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Mode.php
func CategorySourceMode() *todoCASMode {
	return &todoCASMode{
		AttributeSource: eav.NewAttributeSource(),
	}
}
Пример #12
0
// CategorySourcePage @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Page.php
func CategorySourcePage() *todoCASP {
	return &todoCASP{
		AttributeSource: eav.NewAttributeSource(),
	}
}
Пример #13
0
// CategorySourceSortby sorting @todo
// @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Sortby.php
func CategorySourceSortby() *todoCASSB {
	return &todoCASSB{
		AttributeSource: eav.NewAttributeSource(),
	}
}
Пример #14
0
// NewAttributeSourcePrice @todo
// @see magento2/site/app/code/Magento/Msrp/Model/Product/Attribute/Source/Type/Price.php
func NewAttributeSourcePrice() *todoASPrice {
	return &todoASPrice{
		AttributeSource: eav.NewAttributeSource(),
	}
}
Пример #15
0
// AttributeSourceTaxClassCustomer @todo
// @see magento2/site/app/code/Magento/Tax/Model/TaxClass/Source/Customer.php
func AttributeSourceTaxClassCustomer() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #16
0
// AttributeSourceTaxClassProduct @todo
// @see magento2/site/app/code/Magento/Tax/Model/TaxClass/Source/Product.php
func AttributeSourceTaxClassProduct() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #17
0
// CustomerSourceStore handle store source @todo
// @see magento2/site/app/code/Magento/Customer/Model/Customer/Attribute/Source/Store.php
func CustomerSourceStore() *eav.AttributeSource {
	return eav.NewAttributeSource()
}
Пример #18
0
// AttributeSourcePriceView sorting @todo
// @see magento2/site/app/code/Magento/Bundle/Model/Product/Attribute/Source/Price/View.php
func AttributeSourcePriceView() *eav.AttributeSource {
	return eav.NewAttributeSource()
}