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(
\XLite\Model\Attribute::TYPE_CHECKBOX,
\XLite\Model\Attribute::TYPE_TEXT
)
so it would become:
Code:
array(
\XLite\Model\Attribute::TYPE_CHECKBOX,
\XLite\Model\Attribute::TYPE_TEXT,
\XLite\Model\Attribute::TYPE_HIDDEN
)
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()
{
$cnd = new \XLite\Core\CommonCell;
$cnd->product = $this->getProductId();
$attributeValues = \XLite\Core\Database::getRepo('XLite\Model\AttributeValue\AttributeValueSelect')->search($cnd);
$return = [];
foreach ($attributeValues as $attributeValue) {
if (is_null($attributeValue->getAttribute()->getProduct())) {
$return[] = $attributeValue->asString();
}
}
return $return;
}
Tony