TOPIC:

Integration with Joomdonation Membership Pro 1 month 1 day ago #247319

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1286
  • Karma: 3
  • Thanks: 111
Hi,

something like this:
$db = JFactory::getDbo();
$db->setQuery("Select `name`, `field_value` From #__osmembership As a, #__osmembership_field_values As b Where a.id=b.field_id And b.subscriber_id=".$subscriber->id);
$fieldValues = $db->loadObjectList();

//and so on

Hope this helps

Regards,
Tihana

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

Last edit: Post by tihana.krivic.

Integration with Joomdonation Membership Pro 1 month 1 day ago #247322

  • Topic Author
  • bumbies
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 34
  • Thanks: 0
Hi Tihana,

Can you let me know where exactly I should add that line?
I have provided current full code below.
It does not bring up any error, but it also does not populate the field with the idnumber.

My full code:

$this->execPieceByName('ff_InitLib');
$db = JFactory::getDbo();
$db->setQuery("Select * From #__osmembership_subscribers Where user_id = " . $db->quote(JFactory::getUser()->get('id')));
$subscriber = $db->loadObject();

ff_setValue('last_name', $subscriber->last_name);
ff_setValue('first_name', $subscriber->first_name);
ff_setValue('membership_id', $subscriber->membership_id);


$query = $db->getQuery(true)
->select('a.name, b.field_value')
->from('#__osmembership_fields AS a')
->innerJoin('#__osmembership_field_value AS b ON a.id = b.field_id')
->where('b.subscriber_id = ' . $subscriber->id);
$db->setQuery($query);
$fieldValues = $db->loadObjectList('name');

if (isset($fieldValues))
{
$idnumberValue = $fieldValues->field_value;
}
else
{
$idnumberValue = '';
}

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

Integration with Joomdonation Membership Pro 1 month 1 day ago #247328

  • tihana.krivic's Avatar
  • tihana.krivic
  • Offline
  • Moderator
  • Moderator
  • Posts: 1286
  • Karma: 3
  • Thanks: 111
Hi,

I thought on this part:
$query = $db->getQuery(true)
->select('a.name, b.field_value')
->from('#__osmembership_fields AS a')
->innerJoin('#__osmembership_field_value AS b ON a.id = b.field_id')
->where('b.subscriber_id = ' . $subscriber->id);
$db->setQuery($query);
$fieldValues = $db->loadObjectList('name');

if (isset($fieldValues))
{
$idnumberValue = $fieldValues->field_value;
}
else
{
$idnumberValue = '';
}

Replace it with something like this:
$db = JFactory::getDbo();
$db->setQuery("Select `name`, `field_value` From #__osmembership As a, #__osmembership_field_values As b Where a.id=b.field_id And b.subscriber_id=".$subscriber->id);
$fieldValues = $db->loadObjectList();
if (isset($fieldValues))
{
$idnumberValue = $fieldValues->field_value;
}
else
{
$idnumberValue = '';
}

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

Last edit: Post by tihana.krivic.

Integration with Joomdonation Membership Pro 1 month 19 hours ago #247379

  • Topic Author
  • bumbies
  • Offline
  • Junior Breezer
  • Junior Breezer
  • Posts: 34
  • Thanks: 0
It works now. Thank you!

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

Moderators: ForumSupport
Time to create page: 0.047 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

September Discount!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!