Nishith Nesdiya Posted May 29, 2017 Share Posted May 29, 2017 (edited) 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 May 29, 2017 by Nishith (see edit history) Link to comment Share on other sites More sharing options...
phinq1910 Posted May 31, 2017 Share Posted May 31, 2017 Media::addJsDefL should be called in admin controllers with addslashes and no htmlentities you can try pass variables by smarty from controller and set it again on tpl Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now