// 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", } }, ) }
// 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", } }, ) }
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(), ) }
// 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() }
// ProductSourceStatus @todo // @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Status.php func ProductSourceStatus() *eav.AttributeSource { return eav.NewAttributeSource() }
// ProductSourceLayout @todo // @see magento2/site/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php func ProductSourceLayout() *eav.AttributeSource { return eav.NewAttributeSource() }
// 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() }
// 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() }
// 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() }
// 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(), } }
// CategorySourceMode @todo // @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Mode.php func CategorySourceMode() *todoCASMode { return &todoCASMode{ AttributeSource: eav.NewAttributeSource(), } }
// CategorySourcePage @todo // @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Page.php func CategorySourcePage() *todoCASP { return &todoCASP{ AttributeSource: eav.NewAttributeSource(), } }
// CategorySourceSortby sorting @todo // @see magento2/site/app/code/Magento/Catalog/Model/Category/Attribute/Source/Sortby.php func CategorySourceSortby() *todoCASSB { return &todoCASSB{ AttributeSource: eav.NewAttributeSource(), } }
// NewAttributeSourcePrice @todo // @see magento2/site/app/code/Magento/Msrp/Model/Product/Attribute/Source/Type/Price.php func NewAttributeSourcePrice() *todoASPrice { return &todoASPrice{ AttributeSource: eav.NewAttributeSource(), } }
// AttributeSourceTaxClassCustomer @todo // @see magento2/site/app/code/Magento/Tax/Model/TaxClass/Source/Customer.php func AttributeSourceTaxClassCustomer() *eav.AttributeSource { return eav.NewAttributeSource() }
// AttributeSourceTaxClassProduct @todo // @see magento2/site/app/code/Magento/Tax/Model/TaxClass/Source/Product.php func AttributeSourceTaxClassProduct() *eav.AttributeSource { return eav.NewAttributeSource() }
// 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() }
// AttributeSourcePriceView sorting @todo // @see magento2/site/app/code/Magento/Bundle/Model/Product/Attribute/Source/Price/View.php func AttributeSourcePriceView() *eav.AttributeSource { return eav.NewAttributeSource() }