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
-- phpMyAdmin SQL Dump | |
-- version 5.0.2 | |
-- https://www.phpmyadmin.net/ | |
-- | |
-- Host: 127.0.0.1:3306 | |
-- Generation Time: May 29, 2021 at 05:03 AM | |
-- Server version: 5.7.31 | |
-- PHP Version: 7.3.21 | |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; |
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
public function do_enroll($course_id = 0, $order_id = 0, $user_id = 0){ | |
if ( ! $course_id){ | |
return false; | |
} | |
do_action('tutor_before_enroll', $course_id); | |
$user_id = $this->get_user_id($user_id); | |
$title = __('Course Enrolled', 'tutor')." – ".date_i18n(get_option('date_format')) .' @ '.date_i18n(get_option('time_format') ) ; |
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
class add_more_to_cart { | |
private $prevent_redirect = false; //used to prevent WC from redirecting if we have more to process | |
function __construct() { | |
if ( ! isset( $_REQUEST[ 'add-more-to-cart' ] ) ) return; //don't load if we don't have to | |
$this->prevent_redirect = 'no'; //prevent WC from redirecting so we can process additional items | |
add_action( 'wp_loaded', [ $this, 'add_more_to_cart' ], 21 ); //fire after WC does, so we just process extra ones | |
add_action( 'pre_option_woocommerce_cart_redirect_after_add', [ $this, 'intercept_option' ], 9000 ); //intercept the WC option to force no redirect | |
} |