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 | |
// define absolute folder path | |
$storeFolder = 'ABSOLUTE_FOLDER_PATH/' | |
// if folder doesn't exists, create it | |
if(!file_exists($storeFolder) && !is_dir($storeFolder)) { | |
mkdir($storeFolder); | |
} | |
// upload files to $storeFolder |
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
Шаблон | |
Пролог/подключение языковых файлов (header.php/footer.php) | |
<? | |
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die(); | |
IncludeTemplateLangFile(__FILE__); | |
?> | |
Язык шаблона | |
<html lang="<?=LANGUAGE_ID?>"> |
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 | |
use Bitrix\Main; | |
use Bitrix\Main\Loader; | |
Loader::includeModule("catalog"); | |
\Bitrix\Main\EventManager::getInstance()->addEventHandler( | |
'sale', | |
'OnSaleBasketBeforeSaved', |
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 | |
require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php'; | |
use Bitrix\Main\Loader; | |
Loader::includeModule('catalog'); | |
// add discount by product xml id | |
$uuid = 'f0a73f90-57ec-11ec-8ea2-005056b8434b'; |
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 | |
//резервирование товара | |
$productId = 12; | |
$a = new \Bitrix\Catalog\Product\CatalogProvider; | |
$resReserve = $a->reserve(array( | |
$productId => ["PRODUCT_ID" => $productId, "QUANTITY" => 15] | |
)); |
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 certificate | |
openssl req -new -nodes -x509 -out /etc/postfix/smtpd.pem -keyout /etc/postfix/smtpd.pem -days 3650 | |
#/etc/postfix/main.cf | |
smtp_use_tls = yes | |
smtpd_use_tls = yes | |
smtpd_tls_auth_only = yes | |
smtp_tls_note_starttls_offer = yes | |
smtpd_tls_key_file = /etc/postfix/smtpd.pem | |
smtpd_tls_cert_file = /etc/postfix/smtpd.pem |