Pull product-variant attributes
Is there a way to pull all attributes and options of each product-variant in Complex Schema. In order to do this task I use
PHP Code:
PHP Code:
|
Re: Pull product-variant attributes
Why are you using a capital S for 'ValueS'? It should be lower case or else you're not calling that entirely.
For example, see https://devs.x-cart.com/basics/basics-of-working-with-product-attributes.html |
Re: Pull product-variant attributes
getAttributeValueS is for attributeValueS property so the S is correct - that's how the property is defined in the model class - it is for Attribute Value Select
|
Re: Pull product-variant attributes
Quote:
I also try to put $model->getProduct()->getAttributes() but i got as result this PHP Code:
|
Re: Pull product-variant attributes
Hi @Soptareanu @Alex,
$model->getAttributeValueS() does not return an empty object. It returns collection of objects, so you should cycle through its child elements and call something like this: Code:
foreach ($model->getAttributeValueS() as $attributeValue) { See more in \XLite\Model\AttributeValue\AttributeValueSelect class. Tony Quote:
|
Re: Pull product-variant attributes
Quote:
|
Re: Pull product-variant attributes
Glad you got this fixed!
|
Re: Pull product-variant attributes
Hello, how can I get the attribute name with attribute value using $model->getAttributeValueS()?
|
All times are GMT -8. The time now is 02:14 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.