Created
June 17, 2011 08:24
-
-
Save larscwallin/1031067 to your computer and use it in GitHub Desktop.
visioncart.deleteorder
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 | |
if($useGetParam){ | |
$orderId = $_GET[$getParamName]; | |
if($orderId == ''){ | |
return false; | |
} | |
} | |
if (!$orderId) { | |
$modx->log(modX::LOG_LEVEL_ERROR, 'Snippet Error: visioncart.deleteorder, parameter orderid missing.'); | |
return false; | |
} | |
$corePath = $modx->getOption('visioncart.core_path', null, $modx->getOption('core_path', null, MODX_CORE_PATH)); | |
$modx->addPackage('visioncart', $corePath.'components/visioncart/model/'); | |
$order = $modx->getObject('vcOrder',$orderId); | |
if($order){ | |
$order->remove(); | |
}else{ | |
$modx->log(modX::LOG_LEVEL_ERROR, 'Snippet Error: visioncart.deleteorder, unable to get Order object with id '.$orderId.'.'); | |
} |
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
[{"name":"orderid","desc":"","xtype":"textfield","options":[],"value":"","lexicon":null,"overridden":false,"desc_trans":"","menu":null},{"name":"useGetParam","desc":"","xtype":"combo-boolean","options":[],"value":true,"lexicon":null,"overridden":false,"desc_trans":"","menu":null},{"name":"getParamName","desc":"","xtype":"textfield","options":[],"value":"orderid","lexicon":null,"overridden":false,"desc_trans":"","menu":null}] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment