Skip to content

Instantly share code, notes, and snippets.

@goldhat
Created October 31, 2016 16:26
Show Gist options
  • Save goldhat/bbc0f169b8fafaf61767944092acd6d3 to your computer and use it in GitHub Desktop.
Save goldhat/bbc0f169b8fafaf61767944092acd6d3 to your computer and use it in GitHub Desktop.
LiveGlam activateWaitlistSubscriber function
public function activateWaitlistSubscriber() {
$productCategories = LiveGlam_ProductCategory::getAll();
if(!empty($productCategories)) {
foreach( $productCategories as $cat ) {
$wsa = new LiveGlam_WaitlistSubscriberActivate( $cat->key );
$subAvailCount = $wsa->subscriptionsAvailableTest();
if( $subAvailCount >= 1 ) {
$subscriberToActivate = $wsa->getWaitlistSubscriberFrontOfLine();
if( $subscriberToActivate ) {
$wsa->activate();
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment