* @author 		WooThemes
 * @package 	WooCommerce/Templates
 * @version     1.6.4
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
global $product;
global $wpdb;
$config = parse_ini_file("config.ini");
$course_url = $config["canvasurl"];
//echo $course_url;
$user_ID = wp_get_current_user();
$woo_class = new Wooclass();
$result = $woo_class->fused_has_user_bought($user_ID->ID, $product->id);
$get_lmsid = "select lms_id from wp_posts where ID=" . $product->id;
$getlms = $wpdb->get_row($get_lmsid);
//echo $getlms->lms_id;
if (!$product->is_in_stock() && !$result) {
    ?>

	<a href="<?php 
    echo apply_filters('out_of_stock_add_to_cart_url', get_permalink($product->id));
    ?>
" class="button"><?php 
    echo apply_filters('out_of_stock_add_to_cart_text', __('Read More', 'woocommerce'));
    ?>
</a>

<?php 
    echo apply_filters('woocommerce_my_account_my_orders_title', __('My Course', 'woocommerce'));
    ?>
</h2>

	<?php 
    foreach ($customer_orders as $customer_order) {
        $order = new WC_Order();
        $order->populate($customer_order);
        $status = get_term_by('slug', 'completed', 'shop_order_status');
        $item_count = $order->get_item_count();
        ?>
<tr class="order">
					<?php 
        if (sizeof($order->get_items()) > 0) {
            foreach ($order->get_items() as $item) {
                $result = $woo_class->fused_has_user_bought($user_ID, $item['product_id']);
                if ($result) {
                    $_product = get_product($item['variation_id'] ? $item['variation_id'] : $item['product_id']);
                    $get_lmsid = "select lms_id from wp_posts where ID=" . $item['product_id'];
                    $getlms = $wpdb->get_row($get_lmsid);
                    $canvas_url = $course_url . '/courses/' . $getlms->lms_id . '/modules';
                    echo '<h3 style="color:#d03423">' . $item['name'] . '</h3>';
                    //$re1="select * from wp_postmeta where meta_key ='_wp_attached_file' and post_id=".$item['product_id'];
                    //echo $re1;
                    //$getpost_img=$wpdb->get_row($re1);
                    //$img=$getpost_img->meta_value;
                    //echo '<img src="'.$direct.'/wp-content/uploads/'.$img.'" width="200" height="250" alt="image" />'."<br/>";
                    $get_post_content = "select * from wp_posts where ID=" . $item['product_id'];
                    $getpost_content = $wpdb->get_row($get_post_content);
                    echo "<br/>" . $getpost_content->post_content;
                    ?>
Ejemplo n.º 3
0
<p style="text-align:center";>To buy a place on this course, please select the session that you would like to enroll on:</p>
<ul class="enroll  overflow_fix">
	
	<?php 
    foreach ($getcourse_detail as $res) {
        ?>
	<li style="list-style:none;">
<div class="enroll_column1">
<h3 style="text-align:center;"><?php 
        echo $res->post_title;
        ?>
<!--<span class="grey_txt"> (Enroll before <?php 
        echo Date('d-M-Y', strtotime($res->enrollstart));
        ?>
)</span>--></h3><?php 
        $result = $woo_class->fused_has_user_bought($user_ID->ID, $res->ID);
        $get_lmsid = "select lms_id from wp_posts where ID=" . $res->ID;
        $getlms = $wpdb->get_row($get_lmsid);
        $config = parse_ini_file("config.ini");
        $course_url = $config["canvasurl"];
        $canvas_url = $course_url . '/courses/' . $getlms->lms_id . '/modules';
        $siteurls = get_site_url();
        if ($result) {
            ?>
<a href="<?php 
            echo $canvas_url;
            ?>
" style="margin: 0 0 0 0px;">Take this course</a>
<?php 
        } else {
            ?>
        <?php 
            echo $duration;
            ?>
      </div>  
      
      
  </div>  
 <div class="column2">
  <div><div><p><?php 
            the_excerpt();
            ?>
</p>
</div>
</div>  
<?php 
            $result = $woo_class->fused_has_user_bought($user_ID, get_the_ID());
            $get_lmsid = "select lms_id from wp_posts where ID=" . get_the_ID();
            $getlms = $wpdb->get_row($get_lmsid);
            $config = parse_ini_file("config.ini");
            $course_url = $config["canvasurl"];
            $canvas_url = $course_url . '/courses/' . $getlms->lms_id . '/modules';
            $siteurls = get_site_url();
            $link = array('url' => '', 'label' => '', 'class' => '');
            ?>
<div style="right:15%;postion:absolute;margin-top:5px;">
  <?php 
            if ($result) {
                ?>
<a href="<?php 
                echo $canvas_url;
                ?>