I want to update "to_date" in #__osmembership_subscribers` with another date. It's part of a larger script and the idea is to create a plan with seperate issues
connected to it. The issues have set dates and the customer would buy five issues and the script would find the five next issues from now and so on.
This is the part of my script that should update the to_date but isn't:
Code:
//Current customer subscription id, plan_id and user_id
$sub_id = $row->id;
$customer_id = $row->user_id;
$plan = $row->plan_id;
$new_end_date = [value I've gotten in another query]
///Update osmembership with new date for last of the five issues
$my_new_date = new stdClass();
// Must be a valid primary key value.
$my_new_date->id = $sub_id;
$my_new_date->to_date = $new_end_date;
// Update their details in the users table using id as the primary key.
$result = JFactory::getDbo()->updateObject('#__osmembership_subscribers', $my_new_date, 'id');
The code works when I try it in Jumi outside of Membership pro but not when I trigger it with "Subscription Stored Script ".