Shop / e-Commerce Integration

Joomdle Duplication the Hikashop Courses

  • Wynand Louw
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 months 1 day ago #1 by Wynand Louw
Joomdle Duplication the Hikashop Courses was created by Wynand Louw
HI Antonio
After the Joomdle update, it seemed that the Moodle Courses was no long linked via the Joomdle/HikaShop intergration through Joomdle.
My Active Courses was still listed with the Hika Product Codes which I can see with all the Closed courses on Moodle as well. 

When I activate the current active courses in Joomdle Shop, it recrates the courses again within Hika shop and duplicating the courses. When I unpublish the duplicated courses, it deactivates it in Joomdle Shop Tab. 
I am a bit stuck at what should be the correct process if the courses was added before the last update. Joomla 5.4.5 and Hikashop Essential 6.4.1 and Moodle 4.5.8.

It drives me crazy.

 

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

More
3 months 1 day ago #2 by Antonio Durán
Replied by Antonio Durán on topic Joomdle Duplication the Hikashop Courses
Hi.

The new plugin brings a change in how the courses and products are mapped.
Before, we were using the SKU field in the product.
To be more flexible, we changed this to use our own table.
In theory, the upgrade process should have created all the entries in this new table, thus keeping the relationship.
It seems this didn't happen in your case for some reason, because you see all courses unpublished in Joomdle->Shop right?

First thing: did you upgrade the Hikashop plugins to use the new versions? I guess you did if you are not getting any errors....

Second: check table #__joomdle_products to see if you have entries there. I guess you will at least have some for the courses you created again in the shop.

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

  • Wynand Louw
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 months 1 day ago - 3 months 1 day ago #3 by Wynand Louw
Replied by Wynand Louw on topic Joomdle Duplication the Hikashop Courses
"It seems this didn't happen in your case for some reason, because you see all courses unpublished in Joomdle->Shop right?"

(Yes) they are all unpublish in the Joomdle shop except the latest new workshop. That one did not duplicate in Hikashop.

"First thing: did you upgrade the Hikashop plugins to use the new versions?" (yes) "I guess you did if you are not getting any errors...." (No errors)

plg_joomdleshop_hikashop_v2.0.0
plg_joomdleprofile_hikashop_v2.0.1
plg_system_joomdlehikashop_v2.0.0
plg_system_joomdlehikashopgroups_v2.0.0


"Second: check table #__joomdle_products to see if you have entries there."  Yes I have the 13 original products in there because I have unpublished the duplicates that was created when I activated the course in Joomdle Shop.

When I activate the courses in Joomdle Shop it creates new set of products but without the Hika Product Codes.
For example, the existing course:
Hika Product Name = Test; 
Hika Product Code = 127

When I activate these courses in the Joomdle shop I get a duplicate in Hika Shop Product:
Hika Product Name = Test; (Same Course name)
Hika Product Code = Test (Different Product Code)

If I change the Product Code to 127 it conflicts with the current one and unpublish both. 

The other issue is that Joomdle shop activates the same course and immediately displays the course as free in Hikashop Product Front Page display. 


Must I empty the existing courses in the Hika Shop Products and then reactivate them via Joomdle shop and then make the changes and add the the Hikashop Picture?
 
Last edit: 3 months 1 day ago by Wynand Louw.

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

More
3 months 1 day ago #4 by Antonio Durán
Replied by Antonio Durán on topic Joomdle Duplication the Hikashop Courses
> (Yes) they are all unpublish in the Joomdle shop except the latest new workshop. That one did not duplicate in Hikashop.

Ok, but if you only have a record for each one, and you published all the courses manually again, those records were created by your manual action.
For some reason, the install script did not create the records in this table, so you were left with no records and the shop showing all courses as non published.
When you published the courses again, it did not find any matching records, so it assumed they were new products.

So, what to do now: as you don't have many courses, it may be faster to just update the database manually to link the old Hikashop products to the courses, so you can then delete the new ones created.

To do this you would need to set the product_id field in the table the the Hikashop product ID corresponding to that Moodle course ID (in course_id field, this is the ID that shows in the URL when you open a course in Moodle).

Let me know if you have any doubts about this process.

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

  • Wynand Louw
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 months 23 hours ago #5 by Wynand Louw
Replied by Wynand Louw on topic Joomdle Duplication the Hikashop Courses
Thanks Antonio. It worked.

Is it possible in future releases to make the Moodle Course ID to sort the courses according to the that ID to make it easier to check. Currently we can only sort by Course.

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

More
3 months 3 hours ago #6 by Antonio Durán
Replied by Antonio Durán on topic Joomdle Duplication the Hikashop Courses
Great, I am glad to know that you managed to fix it.

> Is it possible in future releases to make the Moodle Course ID to sort the courses according to the that ID to make it easier to check. Currently we can only sort by Course.

I will put it in my list, thanks for the suggestion.

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

  • Wynand Louw
  • Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
2 months 4 weeks ago #7 by Wynand Louw
Replied by Wynand Louw on topic Joomdle Duplication the Hikashop Courses
Thanks

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

More
3 weeks 1 day ago - 3 weeks 1 day ago #8 by Eric vanBok
Replied by Eric vanBok on topic Joomdle Duplication the Hikashop Courses
Hi Antonio,

I'm running into the same issue described above, but with one difference worth flagging: on my test site, the #__joomdle_products table is completely empty after the upgrade — not just missing a few rows, but no entries were migrated at all. So it looks like the auto-migration from the old SKU-based mapping to the new table didn't run at all in my case, rather than partially failing.

My setup: upgrading from Joomdle 2.4.0 to 3.1.1, on Joomla 5.4.7 and Moodle 4.5.12. I followed the documented upgrade steps (removing the old Joomdle plugins before installing the 3.x package), and the Joomla/Moodle sides otherwise came through cleanly.This test site only has one course, so I was able to manually re-link it in #__joomdle_products per your instructions above and confirm that fixes it. But I have other production sites with dozens of active courses each, and manually mapping course_id to product_id for each one isn't really feasible at that scale — especially across multiple sites.

A couple of questions:
  1. Is there a known reason the migration script would skip populating the table entirely (vs. partially, as in the case above)? Is this something on my end I could check/fix before running the upgrade on a bigger site?
  2. Would it be possible to get a bulk-migration script (or the exact logic the old version used to relate a HikaShop product to a course via SKU/product code), so I can write a one-time SQL migration for #__joomdle_products] instead of doing this course-by-course? I still have the pre-upgrade database backups with the old SKU data intact, so I should have everything needed if I know the mapping logic.
Happy to share more details (table dumps, version numbers, etc.) if that helps track this down. Thanks for the help so far — the fix above did work for the single course I tested it on.

Thank you,
Eric
Last edit: 3 weeks 1 day ago by Eric vanBok.

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

More
3 weeks 1 day ago #9 by Antonio Durán
Replied by Antonio Durán on topic Joomdle Duplication the Hikashop Courses
Hi Eric.

Thank you for the bug report. I tested and could confirm the issue.

> Is there a known reason the migration script would skip populating the table entirely

Yes, I found the reason: it turns out we changed the plugin name, but the migration script was running only on updates, so it was never executed (because we are not updating, but uploading a new package).
So I changed it to always check for data to migrate. I have sent you and email with the new package so you can test.

> Would it be possible to get a bulk-migration script (or the exact logic the old version used to relate a HikaShop product to a course via SKU/product code), so I can write a one-time SQL migration for #__joomdle_products] instead of doing this course-by-course? I still have the pre-upgrade database backups with the old SKU data intact, so I should have everything needed if I know the mapping logi

I would just reload the pre-upgrade database backups and perform the upgrade again.

If you really want to do it via SQL you can look at the file plg_joomdleshop_hikashop/install.php where it does the migration, to understand what is done. 
 

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

More
3 weeks 17 hours ago #10 by Antonio Durán
Replied by Antonio Durán on topic Joomdle Duplication the Hikashop Courses
Well, you don't even need to reload the database. Just empty the joomdle products table first and install the new plugin I sent you, it should do the migration.

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