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.2 3.2.3 3.3.0 3.3.1 3.4.0 3.4.1 3.4.2 3.5.0 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.8.0 3.8.1 3.8.2 3.8.3 3.9.0 3.9.1 3.9.10 3.9.2 3.9.3 3.9.4 3.9.5 3.9.6 3.9.7 3.9.8 3.9.9
tutor / templates / single / course / add-to-cart-woocommerce.php
tutor / templates / single / course Last commit date
enrolled 1 month ago add-to-cart-edd.php 1 month ago add-to-cart-tutor.php 1 year ago add-to-cart-woocommerce.php 1 year ago continue-lesson.php 3 years ago course-benefits.php 4 months ago course-content.php 4 months ago course-entry-box.php 1 month ago course-requirements.php 4 months ago course-target-audience.php 4 months ago course-topics.php 1 month ago instructors.php 3 years ago lead-info.php 11 months ago material-includes.php 4 months ago q_and_a_turned_off.php 3 years ago reviews-loop.php 1 month ago reviews.php 1 month ago social_share.php 3 years ago tags.php 3 years ago wc-price-html.php 3 years ago
add-to-cart-woocommerce.php
85 lines
1 <?php
2 /**
3 * Tutor add to cart for WC product that will be visible on the course details page
4 *
5 * @package Tutor\Templates
6 * @subpackage Single\Course
7 * @author Themeum <support@themeum.com>
8 * @link https://themeum.com
9 * @since 1.4.3
10 */
11
12 $product_id = tutor_utils()->get_course_product_id();
13 $product = wc_get_product( $product_id );
14
15 $is_logged_in = is_user_logged_in();
16 $enable_guest_course_cart = tutor_utils()->get_option( 'enable_guest_course_cart' );
17 $required_loggedin_class = '';
18 if ( ! $is_logged_in && ! $enable_guest_course_cart ) {
19 $required_loggedin_class = apply_filters( 'tutor_enroll_required_login_class', 'tutor-open-login-modal' );
20 }
21
22 if ( $product ) {
23 if ( tutor_utils()->is_course_added_to_cart( $product_id, true ) ) {
24 ?>
25 <a href="<?php echo esc_url( wc_get_cart_url() ); ?>" class="tutor-btn tutor-btn-outline-primary tutor-btn-lg tutor-btn-block tutor-woocommerce-view-cart">
26 <?php esc_html_e( 'View Cart', 'tutor' ); ?>
27 </a>
28 <?php
29 } else {
30 $regular_price = wc_get_price_to_display( $product, array( 'price' => $product->get_regular_price() ) );
31 $sale_price = wc_get_price_to_display( $product, array( 'price' => $product->get_sale_price() ) );
32 $tax_display = get_option( 'woocommerce_tax_display_shop' );
33 ?>
34 <div>
35 <div class="tutor-course-sidebar-card-pricing tutor-d-flex tutor-align-end tutor-justify-between">
36 <?php ob_start(); ?>
37 <div>
38 <span class="tutor-fs-4 tutor-fw-bold tutor-color-black">
39 <?php echo wc_price( $sale_price ? $sale_price : $regular_price ); //phpcs:ignore?>
40 </span>
41 <?php if ( $regular_price && $sale_price && $sale_price !== $regular_price ) : ?>
42 <del class="tutor-fs-7 tutor-color-muted tutor-ml-8">
43 <?php echo wc_price( $regular_price ); //phpcs:ignore?>
44 </del>
45 <?php endif; ?>
46 </div>
47 </div>
48 <div class="tutor-color-muted">
49 <?php
50 if ( 'incl' === $tax_display ) {
51 echo wp_kses(
52 $product->get_price_suffix(),
53 array( 'small' => array( 'class' => true ) )
54 );
55 }
56 ?>
57 </div>
58 <?php
59 /**
60 * Added to show info about price.
61 *
62 * @since 2.2.0
63 */
64 do_action( 'tutor_after_course_details_wc_cart_price', $product, get_the_ID() );
65 ?>
66 <?php echo apply_filters( 'tutor_course_details_wc_add_to_cart_price', ob_get_clean(), $product ); //phpcs:ignore ?>
67 </div>
68 <?php ob_start(); ?>
69 <form action="<?php echo esc_url( apply_filters( 'tutor_course_add_to_cart_form_action', get_permalink( get_the_ID() ) ) ); ?>" method="post" enctype="multipart/form-data">
70 <button type="submit" name="add-to-cart" value="<?php echo esc_attr( $product->get_id() ); ?>" class="tutor-btn tutor-btn-primary tutor-btn-lg tutor-btn-block tutor-mt-24 tutor-add-to-cart-button <?php echo esc_attr( $required_loggedin_class ); ?>">
71 <span class="btn-icon tutor-icon-cart-filled"></span>
72 <span><?php echo esc_html( $product->single_add_to_cart_text() ); ?></span>
73 </button>
74 </form>
75 <?php
76 echo apply_filters( 'tutor_add_to_cart_btn', ob_get_clean(), get_the_ID() ); //phpcs:ignore
77 }
78 } else {
79 ?>
80 <p class="tutor-alert-warning">
81 <?php esc_html_e( 'Please make sure that your product exists and valid for this course', 'tutor' ); ?>
82 </p>
83 <?php
84 }
85