call affiliate sponsor to show at wp e commerce

I’m new to MySQL. I have problem with my WordPress plugin. I try to call data from database plugin by another plugin.

Here is the data that i want to call (from file wp-affiliasi/memberarea.php)

Read More
<?php if ($datasponsor->nama) echo '<p>Nama Sponsor : <b>'.$datasponsor->nama.'</b>'; ?>

I want to show it in wpsc-shopping_cart_page.php.

To call the data I am looking this file because it shows the data right. wp-affiliasi/memberarea.php. Here’s the code:

 <?php
 global $premium, $freemember;
 $member = $wpdb->get_row("SELECT * FROM `wp_member` WHERE idwp = '$user_ID'");
 $sponsor = $member->id_referral;
 if ($user_ID != 1) {
  $datasponsor = $wpdb->get_row("SELECT * FROM `wp_member` WHERE idwp = '$sponsor'");
 }

 $datakomisi = get_option('komisi');

 if ($member->membership == 2 || $datakomisi['pps'][0]['free']>0) :
 ?>

I have copy that code to wpsc-shopping_cart_page.php, but still I can see the data
in wpsc-shopping_cart_page.php. Here’s the code:

 <?php
 global $wpsc_cart, $wpdb, $wpsc_checkout, $wpsc_gateway, $wpsc_coupons;

 $wpsc_checkout = new wpsc_checkout();
 $wpsc_gateway = new wpsc_gateways();
 $alt = 0;
 if(isset($_SESSION['coupon_numbers']))
    $wpsc_coupons = new wpsc_coupons($_SESSION['coupon_numbers']);
 if(wpsc_cart_item_count() < 1) :
    _e('Daftar belanja Anda kosong.', 'wpsc') . "<a href=".get_option("product_list_url").">" . __('Please visit our shop', 'wpsc') . "</a>";
    return;     
 endif;
 ?>

How do I call that data?

Related posts

Leave a Reply