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"
    <group name="quote_item">
        <attribute name="mgs_brand"/>

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?

1 Answer 1


Have you tried adding your value in CompositeConfigProvider

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   <type name="Magento\Checkout\Model\CompositeConfigProvider">
           <argument name="configProviders" xsi:type="array">
               <item name="mgs_brand" xsi:type="object">Namespace\ModuleName\Model\AdditionalConfigVars</item>



namespace Namespace\Modulename\Model;

use \Magento\Checkout\Model\ConfigProviderInterface

class AdditionalConfigVars implements ConfigProviderInterface
   public function getConfig()
       $additionalVariables['mgs_brand'] = 'Test Var';
       return $additionalVariables;

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.