admiralchip
Forum Replies Created
-
Forum: Hacks
In reply to: Using $wpdb->get_results with Select and a comparing a column with a variableThen copy the query and paste it into phpmyadmin as an SQL query, what happens ?
@rossmitchell I just tried it and it brought out the number that has already expired. I then put the value from $scheduleddate in single quotes and then it started working as expected. The query now looks like this:
$table_name = $wpdb->prefix . 'nbsms_subscribers'; $query = 'SELECT number FROM ' . $table_name . ' WHERE list_id=' . $list . ' AND expiry_date > ' . "'".$scheduleddate."'"; // echo 'Fetch still live qry: ' . $query . "\n"; $result = $wpdb->get_results( $query ); // print_r( $result );
Thanks a lot!
Forum: Hacks
In reply to: Using $wpdb->get_results with Select and a comparing a column with a variableMy code looks like this now:
global $wpdb; $table_name = $wpdb->prefix . "subscribers"; $result = $wpdb->get_results($wpdb->prepare('SELECT number FROM ' . $table_name . ' WHERE list_id= %d AND expiry_date > %s', $list_id, $scheduleddate));
I still get the same problem.
Also I’ve tried your code @rossmitchell and I echoed my query. The query string looks correct.
Forum: Hacks
In reply to: Using $wpdb->get_results with Select and a comparing a column with a variableThanks for your reply!
I’ve actually tried an echo on
$scheduleddate
and it echoed the date I entered.I’ll try your suggestions.
Thanks for the reply!
The $user_id variable is coming from the notification that the payment processor sends to my notify url. (I included the {{user-id}} as a value that gets sent to the payment processor using the payment button code.)
Alright here’s how far I’ve gone:
I’m now using this to update the database but it’s still not working. The status doesn’t change to active:
if($transaction['status'] == 'Approved') { $wpdb->query($wpdb->prepare("UPDATE wp_konnichiwa_subscriptions SET status='1' WHERE user_id=$user_id")); }
I’ve tried using this as well but it didn’t work either:
$wpdb->update('wp_konnichiwa_subscriptions', array('status' => '1'), array('user_id' => $user_id));
I have no idea why it’s not working.
Hi,
I’ve been able to make the payment button code and it successfully redirects to the payment gateway site to process the payment. However, the DB query doesn’t update the records. I copied this and edited it accordingly:
$wpdb->query($wpdb->prepare("INSERT INTO ".KONN_PAYMENTS." SET user_id=%d, plan_id=%d, sub_id=%d, date=CURDATE(), status=%s, method=%s, payment_key=%s, amount=%s", $user_ID, $plan->id, $sub->id, 'completed', 'stripe', $customer->ID, $plan->price));
Do I need to add this line to it?
KonnichiwaSubs :: activate($sub, $plan);
Thanks for the reply. I’ll try that and keep you posted. ??
Thanks for the reply! In the custom plugin that processes the payment, do I need to extend the payment class found in payment.php? (sorry if it sounds like a newbie question.)
Forum: Plugins
In reply to: [WooCommerce] how to make a page available only is the order is processing?I’m still having the same issue. I’ll be really glad if someone can help or point me in the right direction.
Hi Betsy!
Check out this page. There’s an explanation on using the Pmpro Addon to charge for access to a page:
https://www.paidmembershipspro.com/2012/06/using-pmpro-addons-plugin/
I hope it helps! Keep us posted. ??
Not sure if there’s a way around that.
I was going through the list of pmpro addons and I found this:
https://www.paidmembershipspro.com/add-ons/plugins-on-github/pmpro-roles/
I haven’t tried it, but I think you might find it useful if you’re still interested in that different designation stuff.
And here is a link to the page with other addons:
https://www.paidmembershipspro.com/add-ons/
Good luck!
You’re welcome!
I’m not really sure if there’s a way to do that but you could try it.
Lol glad to know that something worked! ?? haha
Best of luck!
We’re all here to support each other so I’m gonna try my best!
Alright, I’ve checked out your site. Why don’t try this:
– Create one membership level using PmPro (just something to encourage people to register. It could be a free one.)
– Use Konnichiwa to create the Basic, Healthy Habits, Plus and Premium membership levels by creating them as subscription plans. Make a page that shows what subscription plans are available.
Added thought: You could use the membership level created under PmPro to grant access to the page that shows the Konnichiwa subscription plans.
Hope this works!
Hi Betsy!
You see the PmPro Addon thing when you’re making a new post or page.
Good luck with the Konnichiwa plugin! I hope it works for you.