I have configurable product with custom attributes (not front end visible) I get the $item from when looping over $items. I'm getting $items like so:

$itemsVisible = $cart->getQuote()->getAllVisibleItems();
$items = $cart->getQuote()->getAllItems();

$y = $item->getProduct()->getResource()->getAttribute('my_attribute_id')->getFrontend()->getValue($item->getProduct());

The trouble is I can't see the attribute's value, i see all the meta data about the attribute, but not the value relvant to the item. I need to access that attribute on the checkout and confirmation steps of the order placement.

When accessing the same element on the PDP page I get it with no problems:

$x = (int) $product->getResource()->getAttribute('my_attribute_id')->getFrontend()->getValue($product);

I stepped through both cases with xdebug, but just can't figure it out.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.