| ||||||||||
![]() |
Shopping cart software Solutions for online shops and malls | |||||||||
![]() |
![]() |
|
X-Cart Home | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
Retrieve product hidden attributes | |||
![]() |
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
![]() 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.
__________________
5.3.5.8 |
|||||||
#2
|
|||||||
|
|||||||
![]() 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...
__________________
5.3.5.8 |
|||||||
#3
|
|||||||
|
|||||||
![]() Thanks a lot for your contributions. Much appreciated!
__________________
5.3.5.8 |
|||||||
#4
|
|||||||||
|
|||||||||
![]() 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:
so it would become: Code:
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:
Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
#5
|
|||||||
|
|||||||
![]() 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?
__________________
X-Carting since 2006 ![]() |
|||||||
#6
|
|||||||||
|
|||||||||
![]() Hi @FactorInteractivo,
What X-Cart version you are using? Best, Tony
__________________
Found a bug in X-Cart? Post it to our bug tracker! Know how to make X-Cart better? Suggest an idea! |
|||||||||
|
|||
X-Cart forums © 2001-2020
|