- Posts: 26
- Thank you received: 2
Subscription Stored Script not executing update
- Nina Mårtensson
- Topic Author
- Offline
- Junior Member
-
Less
More
7 years 8 months ago #102741
by Nina Mårtensson
Subscription Stored Script not executing update was created by Nina Mårtensson
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:
The code works when I try it in Jumi outside of Membership pro but not when I trigger it with "Subscription Stored Script ".
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');
Please Log in or Create an account to join the conversation.
- Tuan Pham Ngoc
- Offline
- Administrator
-
7 years 8 months ago #102774
by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Subscription Stored Script not executing update
Hi Nina
Unless there is something wrong with the setup, the script should be executed. The easiest way to check it is adding a dine command at the top of the script
die('Run');
Then try to subscribe for the plan from frontend of your site and check the result
Could you please try that?
Tuan
Unless there is something wrong with the setup, the script should be executed. The easiest way to check it is adding a dine command at the top of the script
die('Run');
Then try to subscribe for the plan from frontend of your site and check the result
Could you please try that?
Tuan
Please Log in or Create an account to join the conversation.
Support
Documentation
Information
Copyright © 2025 Joomla Extensions by Joomdonation. All Rights Reserved.
joomdonation.com is not affiliated with or endorsed by the Joomla! Project or Open Source Matters.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.
The Joomla! name and logo is used under a limited license granted by Open Source Matters the trademark holder in the United States and other countries.