This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->session->data['order_id'] = $order_id; | |
$products_to_crm = array(); | |
foreach ($this->cart->getProducts() as $product) { | |
$products_to_crm[] = [ | |
'product_title' => $product['name'], | |
'price' => $product['price'], | |
'product_sku' => $product['model'], | |
'amount' => $product['quantity'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import base64 | |
import time | |
import ecdsa | |
import hashlib | |
# Docs - https://api.monobank.ua/docs/corporate.html#tag/Avtorizaciya-ta-nalashtuvannya-kompaniyi | |
if __name__ == '__main__': |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_checkout_order_processed', 'action_function_mydropppua' ); | |
function action_function_mydropppua( $order_id ){ | |
$order = wc_get_order($order_id); | |
$order_data = $order->get_data(); | |
$orderUrl = $order_id; // Номер заказа | |
$phone = $order_data['billing']['phone']; // Телефон | |
$first_name = $order_data['billing']['first_name']; // Имя | |
$last_name = $order_data['billing']['last_name']; // Фамилия | |
$payment_method = $order_data['payment_method'] == 'cod' ? 'Наложенный платеж' : 'Предоплата'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$product1 = wc_get_product( $product_id ); | |
$products = array(); | |
foreach($order->get_items() as $item) { | |
$product = $item->get_data(); | |
$product_meta = $product['meta_data'][0]; | |
$product_not_exist_vendor_not_exist = array( | |
'product_title' => $product1->get_name(), // название нового товара | |
'product_sku' => wc_get_product($product['product_id'])->get_sku(), | |
'price' => $product1->get_price(), // цена продажи товара | |
'amount' => $product['quantity'], // количество товара |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//***************** Страница с завершением заказа ****************** | |
session_start(); | |
$product = array( | |
'product_title' => 'Кеды Nike', // название нового или существующего товара | |
'product_sku' => 'ld-1245' // артикул (необязательно) | |
'manufacturer' => 'nike', // производитель (необязательно) | |
'assembly_price' => 450, // цена закупки товара (необязательно) | |
'price' => 780, // цена продажи товара (заменить) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$product1 = wc_get_product( $product_id ); | |
$products = array(); | |
foreach($order->get_items() as $item) { | |
$product = $item->get_data(); | |
$product_meta = $product['meta_data'][0]; | |
$product_not_exist_vendor_not_exist = array( | |
'product_title' => $product1->get_name(), // название нового товара | |
'product_sku' => wc_get_product($product['product_id'])->get_sku(), | |
'price' => $product1->get_price(), // цена продажи товара | |
'amount' => $product['quantity'], // количество товара |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'woocommerce_checkout_order_processed', 'action_function_mydropppua' ); | |
function action_function_mydropppua( $order_id ){ | |
$order = wc_get_order($order_id); | |
$order_data = $order->get_data(); | |
$orderUrl = $order_id; // Номер заказа | |
$phone = $order_data['billing']['phone']; // Телефон | |
$first_name = $order_data['billing']['first_name']; // Имя | |
$last_name = $order_data['billing']['last_name']; // Фамилия | |
$payment_method = $order_data['payment_method'] == 'cod' ? 'Наложенный платеж' : 'Предоплата'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
$period_cookie = 2592000; // 30 дней (2592000 секунд) | |
if($_GET){ | |
setcookie("utm_source",$_GET['utm_source'],time()+$period_cookie); | |
setcookie("utm_medium",$_GET['utm_medium'],time()+$period_cookie); | |
setcookie("utm_term",$_GET['utm_term'],time()+$period_cookie); | |
setcookie("utm_content",$_GET['utm_content'],time()+$period_cookie); | |
setcookie("utm_campaign",$_GET['utm_campaign'],time()+$period_cookie); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//***************** Страница с завершением заказа ****************** | |
session_start(); | |
// используйте структуру $product_exist, если товар уже добавлен в CRM | |
$product_exist = array( | |
'product_id' => 40, // код товара (заменить) | |
'drop_price' => 450, // дроп цена товара (заменить) | |
'price' => 780, // цена продажи товара (заменить) | |
'amount' => 1, // количество товара |