You have some PHP code in the string you're trying to echo, but it's not being evaluated by PHP because it's inside the string:
echo '<div data-lng="$this->escape($value->longitude)" data-lat="$this->escape($value->latitude)" class="' . (++$count%2 ? "shop odd" : "shop even") . '">';
Replace the above with the following:
echo '<div data-lng="' . $this->escape($value->longitude) . '" data-lat="' . $this->escape($value->latitude) . '" class="' . (++$count%2 ? "shop odd" : "shop even") . '">';
This way, the PHP parts (such as $this->escape($value->longitude)
) will be recognized by PHP, and their results will be inserted in the string you are echo
ing.
Because you were echo
ing the PHP parts directly, javascript (jQuery) probably recognized the dollar sign ($
), tried to do something with it but didn't know how, and failed.