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
$config = array( | |
'baseUrl' => rtrim('http://mywebsite.com/rest/api/','/'), | |
'format' => 'json', // json or xml, the format to request | |
'suppressSuffix' => false, // if false, will append .json or .xml to the URI requested | |
'username' => 'myuser', // if set, will use cURL auth to authenticate user | |
'password' => 'mypass', | |
'curlOptions' => array( | |
'timeout' => 30, // cURL timeout | |
'otherCurlOption' => 1, |
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
#!/bin/sh | |
# Installing PHP 7.2 | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update | |
sudo apt-get install php7.2-cli | |
sudo apt-get install php7.2-mysql php7.2-curl php7.2-json php7.2-cgi php7.2-xsl | |
# For developer drupal 8 apply patch https://www.drupal.org/files/issues/php_7_2_fatal_error-2894884-3.patch |
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
########## Install NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
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: [] |