Question

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??

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top