Skip to content

Instantly share code, notes, and snippets.

@matdave
matdave / pdftojpeg.snippet.php
Last active January 29, 2019 20:26 — forked from mkschell/pdftojpeg.snippet.php
PDF Thumbnailing in MODX - Proof of Concept
<?php
/**
* Warning: this code is for demonstration purposes only
*/
if (!preg_match("/\.pdf$/", $input)) {
return "PDF file not specified.";
}
$options = explode('&', $modx->getOption('options', $scriptProperties, null));
if(empty($options)){
@matdave
matdave / scCartQuantities.snippet.php
Last active June 19, 2017 12:20 — forked from anonymous/scCartQuantities
modmore SimpleCart - Adjust cart quantities based on stock
<?php
/**
* Created by PhpStorm.
* User: Mat
* Date: 6/19/2017
* Time: 3:33 AM
*/
$sc = $modx->getService('simplecart','SimpleCart',$modx->getOption('simplecart.core_path',null,$modx->getOption('core_path').'components/simplecart/').'model/simplecart/',$scriptProperties);
if (!($sc instanceof SimpleCart)) return '';