Retrieve product hidden attributes
In X-Cart 5, I can create hidden attributes for any product.
I have found this page https://devs.x-cart.com/basics/basics-of-working-with-product-attributes.html which explains how to retrieve product attributes. How can I retrieve hidden attributes for a given product? Everything I tried failed and I am unsure what to use. Thanks. |
Re: Retrieve product hidden attributes
I would have the same question for global attributes too in fact as they don't seem to be returned either by the method described in the documentation. Would be nice to get an answer...
|
Re: Retrieve product hidden attributes
Thanks a lot for your contributions. Much appreciated!
|
Re: Retrieve product hidden attributes
Hi amarquis,
If you need to pull hidden attributes, you need to add the \XLite\Model\Attribute::TYPE_HIDDEN type to the following array mentioned in the https://devs.x-cart.com/basics/basics-of-working-with-product-attributes.html article Code:
array( so it would become: Code:
array( As for global attributes, you need to write a function that would return such attribute values. If you plan on extending \XLite\Model\Product class, this function can look like this: Code:
public function getGlobalAttributes() Tony |
Re: Retrieve product hidden attributes
With the solution you propose I only see the value of the global attributes but I don't see their name.
For example if a global attribute is "Color" with the value "Red", I only see "Red". How can i fix this? |
Re: Retrieve product hidden attributes
Hi @FactorInteractivo,
What X-Cart version you are using? Best, Tony |
All times are GMT -8. The time now is 11:49 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.