File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
wpsc-components/theme-engine-v2/mvc/controllers Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -237,19 +237,24 @@ public function get_purchase_log() {
237237 // otherwise create one
238238 $ purchase_log_id = (int ) wpsc_get_customer_meta ( 'current_purchase_log_id ' );
239239
240+ $ create = true ;
241+
240242 if ( $ purchase_log_id ) {
241243 $ purchase_log = new WPSC_Purchase_Log ( $ purchase_log_id );
242- } else {
244+ $ create = ! $ purchase_log ->exists ();
245+ }
246+
247+ if ( $ create ) {
248+ wpsc_delete_customer_meta ( 'current_purchase_log_id ' );
249+
243250 $ purchase_log = new WPSC_Purchase_Log ();
244251
245252 $ purchase_log ->set ( array (
246253 'user_ID ' => get_current_user_id (),
247254 'date ' => time (),
248255 'plugin_version ' => WPSC_VERSION ,
249256 'statusno ' => '0 ' ,
250- ) );
251-
252- $ purchase_log ->save ();
257+ ) )->save ();
253258 }
254259
255260 return $ purchase_log ;
You can’t perform that action at this time.
0 commit comments