enrolled
7 years ago
add-to-cart-edd.php
7 years ago
add-to-cart-woocommerce.php
7 years ago
add-to-cart.php
7 years ago
complete_form.php
7 years ago
course-benefits.php
7 years ago
course-content.php
7 years ago
course-enroll-box.php
7 years ago
course-enrolled-box.php
7 years ago
course-requirements.php
7 years ago
course-target-audience.php
7 years ago
course-topics.php
7 years ago
instructors.php
7 years ago
lead-info.php
7 years ago
login.php
7 years ago
material-includes.php
7 years ago
q_and_a_turned_off.php
7 years ago
review-form.php
7 years ago
reviews.php
7 years ago
social_share.php
7 years ago
tags.php
7 years ago
wc-price-html.php
7 years ago
add-to-cart.php
47 lines
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * Display single course add to cart |
| 5 | * |
| 6 | * @since v.1.0.0 |
| 7 | * @author themeum |
| 8 | * @url https://themeum.com |
| 9 | */ |
| 10 | |
| 11 | if ( ! defined( 'ABSPATH' ) ) |
| 12 | exit; |
| 13 | $isLoggedIn = is_user_logged_in(); |
| 14 | |
| 15 | $tutor_form_class = apply_filters( 'tutor_enroll_form_classes', array( |
| 16 | 'tutor-enroll-form', |
| 17 | ) ); |
| 18 | |
| 19 | $is_purchasable = tutor_utils()->is_course_purchasable(); |
| 20 | $tutor_course_sell_by = apply_filters('tutor_course_sell_by', null); |
| 21 | |
| 22 | do_action('tutor_course/single/add-to-cart/before'); |
| 23 | ?> |
| 24 | |
| 25 | <div class="tutor-single-add-to-cart-box <?php echo ! $isLoggedIn ? 'cart-required-login' : ''; ?> "> |
| 26 | <?php |
| 27 | if ($is_purchasable && $tutor_course_sell_by){ |
| 28 | tutor_load_template('single.course.add-to-cart-'.$tutor_course_sell_by); |
| 29 | }else{ |
| 30 | ?> |
| 31 | <form class="<?php echo implode( ' ', $tutor_form_class ); ?>" method="post"> |
| 32 | <?php wp_nonce_field( tutor()->nonce_action, tutor()->nonce ); ?> |
| 33 | <input type="hidden" name="tutor_course_id" value="<?php echo get_the_ID(); ?>"> |
| 34 | <input type="hidden" name="tutor_course_action" value="_tutor_course_enroll_now"> |
| 35 | |
| 36 | <div class=" tutor-course-enroll-wrap"> |
| 37 | <button type="submit" class="tutor-btn-enroll tutor-btn tutor-course-purchase-btn"> |
| 38 | <?php _e('Enroll Now', 'tutor'); ?> |
| 39 | </button> |
| 40 | </div> |
| 41 | </form> |
| 42 | |
| 43 | <?php } ?> |
| 44 | </div> |
| 45 | |
| 46 | <?php do_action('tutor_course/single/add-to-cart/after'); ?> |
| 47 |