Just had a colleague, Justin Jones, do a quick snippet of code to modify the ‘Status’ of an entry for an Awards site from ‘Draft’ to ‘Paid’.
This code was put inside:
/system/modules/cartthrob/process/cartthrob.on_authorize.php
<?php
// Add code here that you would like to be parsed upon confirmation of authorization.
// $this refers to an instance of mod.cartthrob.php
global $FNS, $TMPL, $IN, $REGX, $PREFS, $DB;
foreach ($this->_get_cart_items() as $row_id => $item) {
// Each item's original entry_id is in $item['entry_id']
$entry_id = $item['entry_id'];
$data = array('status' => 'Paid');
$sql = $DB->update_string('exp_weblog_titles', $data, "entry_id = '$entry_id'");
$DB->query($sql);
}
?>
Thanks to Justin for doing this for me. Will be in play soon on the Australian Web Awards (www.webawards.com.au) website.
