I'm trying to get a custom attribute (mgs_brand) in MagePlaza's One Step Checkout.
I've created a catalog_attributes.xml file like so -
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
<group name="quote_item">
<attribute name="mgs_brand"/>
</group>
</config>
Added this code to my details.js -
getBrand: function (parent) {
console.log("details.js starts here");
var itemProduct = this.getItemProduct(parent.item_id);
return itemProduct.mgs_brand;
},
Added this to my details.html -
<!-- ko if: (getBrand($parent))-->
<strong class="product-item-brand" data-bind="text:getBrand($parent)"></strong>
<!-- /ko -->
The closest I've managed to get is a value in the window.checkoutConfig object, but it's an ID rather than the actual attribute value.
Am I missing a step here?