Академический Документы
Профессиональный Документы
Культура Документы
php
//***************** Страница с завершением заказа ******************
session_start();
// формируем массив с товарами в заказе (если товар один - оставляйте только первый
элемент массива)
$products_list = array(
0 => array(
'product_id' => 5, //код товара (из каталога CRM)
'price' => 199, //цена товара 1
'count' => '1', //количество товара 1
)
);
$products = urlencode(serialize($products_list));
$sender = urlencode(serialize($_SERVER));
// параметры запроса
$data = array(
'key' => "66ef75a5f575d2e127bcb4b2669909c2", //Ваш секретный
токен
'order_id' => number_format(round(microtime(true)*10),0,'.',''),
//идентификатор (код) заказа (*автоматически*)
'country' => 'UA', // Географическое
направление заказа
'office' => '1', // Офис (id в CRM)
'products' => $products, // массив с товарами в
заказе
'bayer_name' => $_REQUEST['name'], // покупатель (Ф.И.О)
'phone' => $_REQUEST['phone'], // телефон
'email' => $_REQUEST['email'], // электронка
'comment' => $_REQUEST['product_name'], // комментарий
'delivery' => $_REQUEST['delivery'], // способ доставки (id в
CRM)
'delivery_adress' => $_REQUEST['delivery_adress'], // адрес доставки
'payment' => '', // вариант оплаты (id в CRM)
'sender' => $sender,
'utm_source' => $_SESSION['utms']['utm_source'], // utm_source
'utm_medium' => $_SESSION['utms']['utm_medium'], // utm_medium
'utm_term' => $_SESSION['utms']['utm_term'], // utm_term
'utm_content' => $_SESSION['utms']['utm_content'], // utm_content
'utm_campaign' => $_SESSION['utms']['utm_campaign'],// utm_campaign
'additional_1' => '', // Дополнительное поле 1
'additional_2' => '', // Дополнительное поле 2
'additional_3' => '', // Дополнительное поле 3
'additional_4' => '' // Дополнительное поле 4
);
// запрос
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,
"http://shopslavik.lp-crm.biz/api/addNewOrder.html");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
$out = curl_exec($curl);
curl_close($curl);
input.btn-back:hover {
background-color: #DEDEDE;
-webkit-transition: none;
-moz-transition: none;
-ms-transition: none;
-o-transition: none;
transition: none;
}
input.btn-back:active {
position: relative;
top: 3px;
-moz-box-shadow: 0px 1px 0px #FA501E;
-webkit-box-shadow: 0px 1px 0px #FA501E;
box-shadow: 0px 1px 0px #FA501E;
}
/*
*/
.html
{
background-color: #FFFFFF;
}
#page
{
z-index: 1;
width: 940px;
min-height: 374px;
background-image: none;
border-style: none;
border-color: #000000;
background-color: transparent;
/*padding-bottom: 6626px;*/
margin-left: auto;
margin-right: auto;
}
#u1193
{
z-index: 2;
width: 820px;
border-width: 6px;
border-style: solid;
border-color: #FCC92F;
background-color: transparent;
position: relative;
margin-right: -10000px;
margin-top: 68px;
left: 22px;
padding: 36px 32px 24.274999999999977px;
}
#u1191-6
{
z-index: 3;
width: 820px;
min-height: 33px;
background-color: transparent;
line-height: 58px;
/*font-size: 40px;*/
color: #FA501E;
font-weight: 900;
position: relative;
}
#u1194
{
z-index: 13;
width: 200px;
min-height: 49px;
border-style: none;
border-color: transparent;
background-color: transparent;
font-size: 18px;
line-height: 22px;
font-weight: 400;
margin-left: 310px;
margin-top: 69px;
position: relative;
}
#u1192-4
{
z-index: 9;
width: 620px;
min-height: 34px;
background-color: transparent;
line-height: 36px;
text-align: center;
font-size: 25px;
color: #181615;
font-family: Arial, Helvetica, sans-serif;
font-weight: 400;
position: relative;
margin-right: -10000px;
margin-top: 226px;
left: 160px;
}
body
{
position: relative;
min-width: 940px;
}
#page .verticalspacer
{
clear: both;
}
body,div,dl,dt,dd,ul,ol,li,nav,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,inpu
t,button,textarea,p,blockquote,th,td,a
{
margin: 0;
padding: 0;
border-width: 0;
-webkit-transform-origin: left top;
-ms-transform-origin: left top;
-o-transform-origin: left top;
transform-origin: left top;
}
h1,h2,h3,h4,h5,h6
{
font-size: 100%;
font-weight: inherit;
}
.form_text
{
color: #FFFFFF;
font-family: Arial, Helvetica, sans-serif;
font-size: 34px;
font-weight: 700;
text-align: center;
text-transform: uppercase;
padding: 0px;
}
</div>
</div>
<div class="clearfix grpelem" id="u1192-4"><!-- content -->
<h3>Мы свяжемся с Вами в ближайшее время!</h3>
</div>
<div class="verticalspacer"></div>
</div>
<script type="text/javascript">
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, "
"));
}
id = getParameterByName('id');
if( id ){
document.getElementById('lead-id').innerHTML = '# '+id;
}
</script>
</body>
</html>