1. Frank
  2. Pre-sale questions
  3. Monday, 09 January 2023
  4.  Subscribe via email
Hi there,
I want to run an XML template several times in a row during import. Is there a possibility of a PHP Forach? I need to run an import template 400 times with the SKU changed. I have changed my SKU every time via Search&replace rules and executed it again. The xml templates would only be too large for my project and would no longer represent process security.
My idea: First import run. Recall Rules. Next Rules Several times next step.
Example: Change all SKU AAA1 to AAA2 on the 2nd run and import continues without clicking again.
can I realize something like that?;)
Accepted Answer Pending Moderation
Hello Frank,
400 templates is quite a long process. There is no direct way to do this in RO CSVI. Calling the same template again and again is only possible through custom coding. With RO CSVI you can create the template as a Frontend import/export template and call this URL using Curl in a for loop. The problem here is with rules to replace SKU. There is no automatic way to run the rules in RO CSVI. Rules are used along with the import template. But if you have the import file stored somewhere using custom PHP code you can read the XML file, find and replace the SKU and then run the import template. This should be also be coded along with foreach loop for calling the import URL.

Hope this helps.
Kind regards,

Tharuna

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. Pre-sale questions
  3. # 1
Accepted Answer Pending Moderation
Thank you very much for your quick reply.:D
  1. more than a month ago
  2. Pre-sale questions
  3. # 2
Accepted Answer Pending Moderation
Hello Frank,

Instead of running the same template 400 times, you could put all replacements in the replacement rule(s) and just run once or am I missing something?
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  1. more than a month ago
  2. Pre-sale questions
  3. # 3
Accepted Answer Pending Moderation
Hello Frank,

Instead of running the same template 400 times, you could put all replacements in the replacement rule(s) and just run once or am I missing something?


Hello
I have 400 times the same article numbers but with different extensions. when importing my template via search&replace the SKU shortcut.
Example: XY-1234-AA1,XY-1234-AA2
so I would have to expand my import xml by 400 articles. Then the file would be too large. so I would have to expand my import xml by 400 articles. Then the file would be too large and confusing and prone to human error
Accepted Answer Pending Moderation
Hello,

If I understand you correctly, you have a file with 1 product but want to import this 400 times with an increasing number for the SKU. I would say the only way to do this easy is via the CLI. You can create a bash script that would call the RO CSVI cron job 400 times and set the product_sku field to be replaced by a rule set to Unique ID. This will not be incremental but it would give you 400 unique produtcs.

The only other way would be to have that bash script replace the SKU in the XML file and then call the RO CSVI import proces.

There is no easy one-click solution I am afraid.
Kind regards,

RolandD

=========================
If you use our extensions, please post a rating and a review at the Joomla! Extension Directory
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Frank
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,jpeg,zip,rar,pdf,csv,txt,tsv,xml,docx,doc,xls,xlsx,ods,tgz
• Insert • Remove Upload Files (Maximum File Size: 4 MB)
In this section you can provide your site details at here and it visible to the moderators only.