0

My array,

array (
  'store_hours' => 
  array (
    'entity_id' => '7',
    'attribute_id' => '2',
    'store_id' => '4',
    'value' => 'Mon-Fri: 10am - 8 pm',
    'frontend_label' => 'Store Hours',
    'attribute_code' => 'store_hours',
    'frontend_input' => 'text',
    'is_required' => NULL,
    'label_serialized' => '{"1":"Store Hours"}',
    'options_serialized' => NULL,
    'value_id' => NULL,
    'option_title' => 'Mon-Fri: 10am - 8 pm',
  ),
)

How to print store hours : Mon-Fri: 10am - 8 pm

My declaration :

'store_hours' =>$this->getDataByKey('store_hours')->getDataByKey('value');

Its not return the values.

1
  • 1
    $array['store_hours']['value'] ... just echo this one. Apr 20, 2021 at 15:52

1 Answer 1

0

Try this :-

$storeData = $this->getDataByKey('store_hours');

$storeHours = $storeData['value'];

'store_hours' => $storeHours;

Your Answer

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

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