{{block class=“” name=“” template=“l” }} – Get phtml templatescript partially working on CMS page

If i using single script on cms page it is working,

{{block class="AmastyStorelocatorBlockLocation" name="location.block.home" template="Zero_Storelocator::home-page-mobile1.phtml" }} 

If i add two more scripts to cms page it is showing only first script, remaining not to return the values, individually i tested all are working.

{{block class="AmastyStorelocatorBlockLocation" name="location.block.address" template="Zero_Storelocator::home-page-mobile1.phtml" }} {{block class="AmastyStorelocatorBlockLocation" name="location.block.mobile" template="Zero_Storelocator::home-page-mobile2.phtml" }} {{block class="AmastyStorelocatorBlockLocation" name="location.block.hours" template="Zero_Storelocator::home-page-mobile3.phtml" }} 

Each script working when i call individually, if i call all the script at the same time first line of the script only working, the remaining script not working.

Code:

 if (response && _.isArray(response.items) && self.options.homeHeader && self.options.commonBlock && self.options.homePage && self.options.homeMobile && self.options.homeHours) { response.items = [_.first(response.items)]; response.totalRecords = 1; } .............. .............. .............. if (self.options.homePage) { var homeAddress = ''; var firstStore = _.first(locations.items); if (firstStore.distance) { homeAddress = '<div class="homepage-store">' + firstStore.address + ',' + firstStore.state + ' ' + firstStore.zip + '</div>'; } console.log(homeAddress); self.storeListIdentifier.html(homeAddress); } if (self.options.homeMobile) { var homeMobileaddress = ''; var firstStore = _.first(locations.items); if (firstStore.distance) { homeMobileaddress = '<div class="homepage-store">' + firstStore.phone + '</div>'; } console.log(homeMobileaddress); self.storeListIdentifier.html(homeMobileaddress); } if (self.options.homeHours) { var homeHoursstore = ''; var firstStore = _.first(locations.items); if (firstStore.distance) { homeHoursstore = '<div class="homepage-store">' + firstStore.store_hours_weekdays +' ,' +firstStore.store_hours_weekend_days+ '</div>'; } console.log(homeHoursstore); self.storeListIdentifier.html(homeHoursstore); } 

submitted by /u/aveeva7
[link] [comments]