Jump to content

Can i add the array varible in Media::addJsDefL() ?


Recommended Posts

Hi...
 

i have write this code in my module front controller inside setMedia() method

foreach($customerlocationsdata as $customerlocation){
$customerlocations[] = array(
'firstname' => $customerlocation['firstname'],
'lastname' => $customerlocation['lastname'],
'address1' => $customerlocation['address1'],
'address2' => $customerlocation['address2'],
'postcode' => $customerlocation['postcode'],
'state' => State::getNameById($customerlocation['id_state']),
'country' => Country::getNameById($this->context->language->id, $customerlocation['id_country']),
);
}

Media::addJsDefL('customerlocations' ,$customerlocations);

but is is not working.i need the this "customerlocations" array use the .js file. how can i use  "customerlocations" data in my js file ?

can any one help me ?

Thanks 

Edited by Nishith (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...