- Микросервис должен работать на простом хостинге, т.е. нельзя использовать composer. Установка на хостинг должна проходить без бубна, просто распаковать в папку сайта, и все должно заработать.
- Для коннекта к Woocommerce использовать официальную PHP библиотеку https://github.com/woocommerce/wc-api-php, но т.к. composer использовать нельзя, то просто скачать ее в корень.
- Для работы с микросервисом будет использоваться JSON-RPC 2.0, подробности https://habr.com/ru/post/441854/.
- Ниже я дам техническое описание, обязательно нужно посмотреть пометки внутри json и между ними, и только потом выполнять, т.к. для того что бы не было дублирования кода, лучше делать Модели для order и product.
This file contains hidden or 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
#Insall Ajenti | |
apt-get update | |
wget http://repo.ajenti.org/debian/key -O- | apt-key add - | |
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list | |
apt-get update | |
apt-get install ajenti | |
service ajenti restart | |
# Uninstall Apache2 |
This file contains hidden or 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 | |
function add_email_to_sendpulse($contact_form) { | |
$wpcf7 = WPCF7_ContactForm::get_current(); | |
$submission = WPCF7_Submission::get_instance(); | |
$data = $submission->get_posted_data(); | |
$cur_email = $data['Email']; | |
if ($cur_email != '') { | |
define( 'API_USER_ID', '' ); |
This file contains hidden or 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
global_log = {}; | |
var cursor = db.getCollection('log').find({}, {}); | |
while(cursor.hasNext()) { | |
var obj = cursor.next(); | |
delete obj._id; | |
if (obj.result) { | |
if (obj.result._id) delete obj.result._id; | |
global_log[obj.active_period_id] = obj; | |
} | |
} |