Skip to Content Skip to Menu

Get option value from plan and insert in to field

  • wintercorn
  • wintercorn
  • ONLINE
  • Posts: 198
  • Thanks: 20
  • Karma: 2
5 hours 41 minutes ago #343384 by wintercorn
Replied by wintercorn on topic Get option value from plan and insert in to field
That works great. 

I've changed the code slightly to truncate to two decimal places to allow to odd amounts when upgrading. Pasted here for others reference.

SELECT TRUNCATE(p.`rate`, 2)
FROM `#__cbsubs_subscriptions` AS s
JOIN `#__cbsubs_payment_items` AS p
ON p.`subscription_id` = s.`id`
WHERE s.`user_id` = '[user_id]'
AND s.`plan_id` = 16
ORDER BY s.`id` DESC
LIMIT 1

 

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum