Created
October 31, 2016 16:26
-
-
Save goldhat/bbc0f169b8fafaf61767944092acd6d3 to your computer and use it in GitHub Desktop.
LiveGlam activateWaitlistSubscriber function
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
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