Skip to content

Instantly share code, notes, and snippets.

@sashabeep
Created October 20, 2017 09:27
Show Gist options
  • Save sashabeep/8695f67efe59090f434ff58ec9c72cc9 to your computer and use it in GitHub Desktop.
Save sashabeep/8695f67efe59090f434ff58ec9c72cc9 to your computer and use it in GitHub Desktop.
prepare snippet for EvoShop orders view module
<?php
$content = $data['content'];
$itemsArr = json_decode($content, true);
foreach($itemsArr as $k => $v){
$evoShopItems .='<li><b><a target="_blank" href='.$modx->config['site_url'].$v['link'].'>'.$v['name'].'</a></b> x '.$v['quantity'].' шт, <b>'.$v['price'].'</b> руб</li>';
$total = $total + ($v['quantity']*$v['price']);
}
$evoShopItems .= '</ul>';
$data['orderdata'] = $evoShopItems;
return serialize($data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment