Duplicate all download files to another plan

  • Peter Kuhlmann
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 1 week ago #112586 by Peter Kuhlmann
Duplicate all download files to another plan was created by Peter Kuhlmann
Hi there,
I couldnt find the table in SQL where i can copy&paste the files which are assgined to one plan to another plan!

- I have 2 Memberships ( 3 month, 6 month)
- The 3 month membership have 60 files
- The 6 month membership have 1 file

Now I want to add all item from the 3-months plan to the 6-months plan within SQL, but couldnt find the table row in xxx_osmembership_plans

Or do you have another idea?
Thanks, Peter

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

More
7 years 1 week ago #112591 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Duplicate all download files to another plan
Hi Peter

It's stored in a different table #__osmembership_documents. Please look at that table, and you should be able to get the SQL command to insert the data

Regards,

Tuan

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

  • Peter Kuhlmann
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 1 week ago #112597 by Peter Kuhlmann
Replied by Peter Kuhlmann on topic Duplicate all download files to another plan
Hi Tuan, thanks for the quick response.
I saw this table before, but where I can assign the files to another plan?


Attachments:

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

More
7 years 1 week ago #112598 by Tuan Pham Ngoc
Replied by Tuan Pham Ngoc on topic Duplicate all download files to another plan
Maybe I mis-understand your question but I think you can edit any plan, then add new document for that new plan, choose an existing file for that new document?

If you want to insert all files from a plan to new plan, try to run this SQL command:

INSERT INTO #__osmembership_documents (plan_id, title, attachment, ordering)
SELECT NEW_PLAN_ID, title, attachment, ordering FROM #__osmembership_documents WHERE plan_id = OLD_PLAN_ID

- #__osmembership_documents must be replaced with correct table name
- NEW_PLAN_ID is ID of the plan you want to insert documents to
- OLD_PLAN_ID is ID of the original plan which you want to get documents to insert to new plan

Tuan

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

  • Peter Kuhlmann
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
7 years 1 week ago #112599 by Peter Kuhlmann
Replied by Peter Kuhlmann on topic Duplicate all download files to another plan
Ok, now I understand the SQL entry.
You create a new table row for each plan!! Sad, therefore I have to assign all files manually.. grrr

Attachments:

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