явно не
get('config_theme') // мы ведь уже выясняли на первой картинке
Мог бы подсказать как его переделать под FormData?
..............
let data = new FormData( document.querySelector('form'));
data.append( 'discount', 'Не забудь про скидку' ); // <--
let xhr= new XMLHttpRequest();
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xhr.onreadystatechange=function (){
if (xhr.readyState===4 && xhr.status===200){
servResponse.textContent=xhr.responseText;
}
}
XHR.open( 'POST', 'mysqli.php' );
XHR.send( data );
...................
if(isset($_POST['discount']) && $_POST['discount'] !=='') {
$order_price = $price - $discount;
}
if (is_file(DIR_IMAGE . html_entity_decode($category_info['image'], ENT_QUOTES, 'UTF-8'))) {
$data['thumb'] =
$this->model_tool_image->resize(
html_entity_decode(
$category_info['image'], ENT_QUOTES, 'UTF-8'
)
, $this->config->get('config_image_category_width')
, $this->config->get('config_image_category_height')
);
$data['thumb_2'] =
$this->model_tool_image->resize(
html_entity_decode(
$category_info['image'], ENT_QUOTES, 'UTF-8'
)
, $this->config->get('config_image_category_width') + 100 // прибавляем к ширине
, $this->config->get('config_image_category_height') + 100 // прибавляем к высоте
);
} else {
$data['thumb'] = '';
$data['thumb_2'] = '';
}
<img src="{{ category.thumb }}" alt="{{ category.heading_title }}" title="{{ category.heading_title }}" class="img-responsive" width="250" height="250" />
<img src="{{ category.thumb_2 }}" alt="{{ category.heading_title }}" title="{{ category.heading_title }}" class="img-responsive" width="350" height="350" />
function _test($raw, $name=''){
$db = debug_backtrace();
file_put_contents('.___TEST', $db[0]['file'] ." | line: ".$db[0]['line']." | $name |".var_export($raw,1);."\n",FILE_APPEND);
}
$result = 'test';
_test($result,' описание теста')
}
можно с сервера массив в JSON
как это делается в Opencart common.js, к примеру
common.js