0

I have a piece of coding which works fine for the default store. Now I created a multistore but this piece of coding is retrieving the default label name, but I want the labelname wich belongs to an other store. this is the coding:

<label class="label"><span><?php echo $attribute->getDefaultFrontendLabel(); ?></span></label>

and that comes from:

<?php /** @var \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attribute */ ?>
                    <div class="field ">
                        <label class="label"><span><?php echo $attribute->getDefaultFrontendLabel(); ?></span></label>
                        <div class="control">
                            <select class="option-select color" name="<?php echo $block->getRealAttributeCode($attribute); ?>" id="select-<?php echo $attribute->getAttributeCode(); ?>">
                                <?php foreach($block->getOptions($attribute) as $key => $value) : ?>
                                    <option value="<?php echo $key; ?>"><?php echo $value; ?></option>
                                <?php endforeach; ?>
                            </select>
                        </div>
                    </div>

So how can I retreive "getDefaultFrontendLabel" from an other store??

0

i have checked your requirement. You should use like below.

Use getStoreLabel() ,instead of getFrontendLabel() or getDefaultFrontendLabel()

Please use like above and let me know if you have any query.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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