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
## Sublime Text 3 Serial key build is 3103 | |
—– BEGIN LICENSE —– | |
Michael Barnes | |
Single User License | |
EA7E-821385 | |
8A353C41 872A0D5C DF9B2950 AFF6F667 | |
C458EA6D 8EA3C286 98D1D650 131A97AB | |
AA919AEC EF20E143 B361B1E7 4C8B7F04 | |
B085E65E 2F5F5360 8489D422 FB8FC1AA |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteCond %{REQUEST_FILENAME} !-s | |
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L] | |
RewriteCond %{REQUEST_FILENAME} -d | |
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L] | |
</IfModule> |
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 | |
class msOrder extends xPDOSimpleObject | |
{ | |
public function updateProducts() | |
{ | |
$originalContext = $this->xpdo->context->get('key'); | |
$this->xpdo->switchContext($this->get('context')); | |
$originalMiniShop = isset($this->xpdo->services['minishop2']) ? $this->xpdo->services['minishop2'] : null; | |
$cart = array(); | |
foreach ($this->getMany('Products') as $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
<script> | |
miniShop2.Order.deliveryCost = '#ms2_delivery_cost'; | |
miniShop2.Callbacks.Order.getcost.response.success = function(response) { | |
var rdc = response.data['delivery_cost']; | |
if(rdc) $(miniShop2.Order.deliveryCost, miniShop2.Order.order).text(miniShop2.Utils.formatPrice(rdc)); | |
else $(miniShop2.Order.deliveryCost, miniShop2.Order.order).text('0'); | |
} |
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 | |
/** | |
* CercecUser | |
* | |
* @author Marc Elie <[email protected]> | |
* | |
* Event: OnUserFormSave | |
* | |
* Modified from Bob Ray's plugin tutorial, Official Guide p. 492-3 | |
* and Bob Ray's online explanation on create class: |
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 | |
define('MODX_API_MODE', true); | |
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/config/config.inc.php'; | |
require_once MODX_BASE_PATH . 'index.php'; | |
if (XPDO_CLI_MODE) { | |
$file = @$argv[1]; | |
$fields = @$argv[2]; | |
$update = (bool) !empty($argv[3]); |
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
$(document).on('click', 'button[name="ms2_action_set"][value="cart/addset"]', function(e) { | |
var parentSelector = '.mssetincart-row'; | |
var formSelector = '.ms2_form'; | |
var sets = { | |
action: 'cart/add', | |
ctx: miniShop2Config.ctx, | |
id: 0, | |
count: 1, | |
options: [] |
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 | |
$tplProduct = 3; //номер шаблона для карточки товара | |
$tplParent = 2; //номер шаблона для категорий | |
$tplChildParent = 2; //номер шаблона для подкатегорий | |
$idParent = 6; //id каталога товаров | |
$fileProduct = 'product.xml'; //имя файла с товарами | |
$xpath_expression['pagetitle'] = '//Товары/Номенклатура'; //DOM структура в XML файле до имени | |
$xpath_expression['article'] = '//Товары/Артикул'; //DOM структура в XML файле до артикула | |
$xpath_expression['parents'] = '//Товары/Родитель'; //DOM структура в XML файле до родителей |
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 | |
$chunk = 'tpl.msdfcMsg'; | |
$discounts = array( | |
'100000' => '10%', | |
'150000' => '15%', | |
'200000' => '20%', | |
); | |
krsort($discounts); | |
reset($discounts); | |
$actionKey = 'msdfc_action'; |
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 | |
class msOrderByPhoneHandler extends msOrderHandler { | |
public function getCustomerId() { | |
$order = $this->ms2->order->get(); | |
if (empty($order['phone'])) {return false;} | |
if ($this->modx->user->isAuthenticated()) { | |
$profile = $this->modx->user->Profile; |