Your account is limited to posting only in the Pre-Sales Questions forum.
Support forum access is limited to members with a purchase history.

If you are working on behalf of another member, please contact us with the name of the license holder and we will upgrade your account.
   
 
Changing Status of entry/s upon Authorisation
Posted: 29 June 2010 12:22 AM   [ Ignore ]
Is a Really Great Dancer
RankRank
Total Posts:  99
Joined  2010-04-28

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.

[ Edited: 17 June 2011 11:14 AM by Rob Sanchez ]
Profile
 
 
Posted: 29 June 2010 12:44 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRankRank
Total Posts:  8342
Joined  2008-09-29

And by the way all, this is in reference to something besides the ORDER or PURCHASED ITEM weblogs. Basically if you allow someone to create their own entry ID, or buy out an existing specific weblog entry.

 Signature 

NOTE: If I say “I will look into x” and you PM me information, please do not hesitate to contact me again about it, if I do not respond in several hours, or at most a day. Please feel free to remind me as you see fit

Profile
 
 
Posted: 29 June 2010 12:50 AM   [ Ignore ]   [ # 2 ]
Is a Really Great Dancer
RankRank
Total Posts:  99
Joined  2010-04-28

Yeah, what he said wink

Profile