Shop / e-Commerce Integration

Virtuemart 4 integration problem

  • Simon Cole
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 weeks ago #1 by Simon Cole
Virtuemart 4 integration problem was created by Simon Cole
I'm struggling to get the Virtuemart integration working properly between Virtuemart 4 and Moodle.

Relevant versions are:
Joomla 4.2.9 / Virtuemart 4.0.12 / Moodle 4.1.2 / PHP 8.1.17 / Joomdle (Core) 2.1.0 /
VM integration Plugins: plg_joomdleshop_joomdlevirtuemart_v1.3.0 and plg_system_joomdlevm2_v1.1.2

I have cloned my live production site (running Joomla 3 / VM 3 / Moodle 4.1.2 / Joomdle 2.0.4 / PHP 7.4) onto a development server and checked that everything worked before upgrading the Joomla, Virtuemart, PHP versions and installing latest Joomdle code on both Joomla and Moodle sides of the equation.

System Check shows everything to be OK, I am able to remove and add course products within VM and from the front end can buy a course. It registers the new user on Moodle and I get back confirmation emails from both VM for the order, and Moodle for the new user registration. But, it just does not enrol the user into the selected course.

I have read and re-read all the documentation to make sure I have not missed anything. Any ideas as to where I am going wrong?

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

More
3 years 2 weeks ago #2 by Antonio Durán
Replied by Antonio Durán on topic Virtuemart 4 integration problem
Hi. I am sorry,I worked on a new plugin for VM4 and was waiting for some feedback and forgot to release it. It's attached. It is meant to replace VirtueMart 2 Orders plugin.
Attachments:

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

  • Simon Cole
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 weeks ago #3 by Simon Cole
Replied by Simon Cole on topic Virtuemart 4 integration problem
Thanks Antonio, I loaded that on my Joomla 4 site and it now enrols the selected course OK, and the link sent out by email out allows my test user to access the Moodle site and see the course. So far so good.

Unfortunately, at the Joomla end when exiting the VM order confirmation screen I get 'COM_JOOMDLE_WEB_SERVICES_ERROR: Error reading from database' which I cannot clear unless I go into the Joomla back end and log off the test user from there. Any ideas?

ATB
Simon

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

More
3 years 2 weeks ago #4 by Antonio Durán
Replied by Antonio Durán on topic Virtuemart 4 integration problem
Please enable debugging in Moodle to see if you can get more info about the error.

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

  • Simon Cole
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 weeks ago #5 by Simon Cole
Replied by Simon Cole on topic Virtuemart 4 integration problem
Hi Antonio,

My knowledge of Moodle is not great. I switched on debugging but cannot for the life of me find documentation as to where I will find the resulting log file to attach here. I have done a screen print from the Log page from within Site Administration (attached) but it doesn't seem to show any errors at all (and everything does seem to be OK at the Moodle end.)

I switched debugging on at the Joomla end and got the following errors in Joomla Front End:-

When trying to register a new user as part of the purchase process:-
Warning: Undefined array key "username" in .[JOOMLAROOT]/administrator/components/com_virtuemart/models/user.php on line 614
COM_JOOMDLE_WEB_SERVICES_ERROR: array_key_exists(): Argument #2 ($array) must be of type array, null given

When trying to login as an existing Joomla/Moodle user on the order checkout screen:
Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in [JOOMLAROOT]/modules/mod_joomdle_my_certificates/mod_joomdle_my_certificates.php on line 20
COM_JOOMDLE_WEB_SERVICES_ERROR: Error reading from database (Table '[DB].mdlp5_certificate' doesn't exist SELECT c.name, c.id, ci.timecreated as certdate FROM mdlp5_certificate c LEFT JOIN mdlp5_certificate_issues ci ON c.id = ci.certificateid WHERE ci.userid = ? AND c.course = ? ORDER BY ci.timecreated DESC [array ( 0 => '26', 1 => '2', )])

When having logged into Joomla front end as an existing Joomla/Moodle user, then gone through order process and clicked Confirm Purchase
COM_JOOMDLE_WEB_SERVICES_ERROR: array_key_exists(): Argument #2 ($array) must be of type array, null given

I have removed site specific folder path and database name for security reasons. Hope that gives some clues? I am thinking the next step is to completely strip Joomdle out of the Joomla installation and start again in case there are any hang overs from previous version installed but shall wait for you to come back to me in case anything in the above leaps out at you and you can suggest a quick fix.

ATB
Simon
Attachments:

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

More
3 years 2 weeks ago - 3 years 2 weeks ago #6 by Antonio Durán
Replied by Antonio Durán on topic Virtuemart 4 integration problem
Hi.

Sorry for not giving more precise information.There's no log to look at, it was just enabling the debugging and testing again, as you did.
From what I see here:
COM_JOOMDLE_WEB_SERVICES_ERROR: Error reading from database (Table '[DB].mdlp5_certificate' doesn't exist SELECT c.name, c.id, ci.timecreated as certdate FROM mdlp5_certificate c LEFT JOIN mdlp5_certificate_issues ci ON c.id = ci.certificateid WHERE ci.userid = ? AND c.course = ? ORDER BY ci.timecreated DESC [array ( 0 => '26', 1 => '2', )])

It seems your problem is not related to the VM orders, but with the "my certificates" module that you are using in Joomla, and the fact that you don't have the certificate module installed in Moodle. I think it should be fine if you disable the "my certificates"< module, or if you install the certificate module in Moodle.
Last edit: 3 years 2 weeks ago by Antonio Durán.

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

  • Simon Cole
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 2 weeks ago #7 by Simon Cole
Replied by Simon Cole on topic Virtuemart 4 integration problem
Thanks again, Antonio.

I disabled My Certificates and although the errors stopped appearing it just will not enrol users at the Moodle end when Web Services is set to REST. I have reverted to XML-RPC and it is now working fine.

Apart from the REST issue, I am now left with one minor problem. When the new user first logs into Moodle having been registered through VM/Joomdle, instead of going straight to the course page they are presented with their user profile, which they need to click Save on before being taken to the Moodle dashboard. It seems that it is waiting for some piece of information not carried over but none of the required fields in the profile are empty. I remember I had a similar issue when I first installed the old version of Joomdle and fixed it somehow, but just cant remember how. I'm sure its a setting somewhere but I have checked my development site against the production server (still running the old versions) and cannot see any differences.

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

More
3 years 2 weeks ago #8 by Antonio Durán
Replied by Antonio Durán on topic Virtuemart 4 integration problem
Hi Simon.

> it just will not enrol users at the Moodle end when Web Services is set to REST

I am currently away without my development laptop, so if it can wait until April 25th I will test it when I return.

> instead of going straight to the course page they are presented with their user profile, which they need to click Save on before being taken to the Moodle dashboard

I don't know why this can happen if the required profile fields are filled. If you need me to check before I return you can send me credentials (including cPanel/ssh) to antonio at joomlde and I will try to check it out.

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

  • Simon Cole
  • Topic Author
  • Offline
  • New Member
  • New Member
More
3 years 1 week ago #9 by Simon Cole
Replied by Simon Cole on topic Virtuemart 4 integration problem
Thanks Antonio,

It can wait until after the 25th no problem. If I sort the profile problem in the meantime I will update the post here.

ATB
Simon

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

More
2 years 11 months ago #10 by Antonio Durán
Replied by Antonio Durán on topic Virtuemart 4 integration problem
Hi Simon.

Sorry for the delay, I forgot about this.

I have tested, and could not reproduce the problem: enrollment works fine for me, even when using REST.
Maybe something else is having problems with REST and that prevents the enrollment from happening.... I would need to take a look to try to get more information.

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