Created
August 10, 2015 19:19
-
-
Save yojance/362a30d35c26f5ca7d3a to your computer and use it in GitHub Desktop.
This file contains 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
$protection_engine = new MM_ProtectedContentEngine(); | |
$attached_bundle = $protection_engine->getPostAccessRights( $course_id ); | |
$bundle_id = $attached_bundle[0]->access_id; | |
$bundle = new MM_Bundle( $bundle_id ); | |
$associated_product_id = key( $bundle->getAssociatedProducts() ); | |
$associated_product = new MM_Product( $associated_product_id ); | |
$buy_link = add_query_arg( array( 'rid' => $associated_product->getReferenceKey() ), home_url( '/' ) . 'checkout/' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment