• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

run form plugins when importing CSV

mahmoodee

Member
Hello,
I have used J2store form plugin to create products .
I want create products when import csv to list , so I add this code to ./components/models/importcsv.php to run j2store form plugin when import csv
Code:
FabrikWorker::getPluginManager()->runPlugins('onAfterProcess', $formModel, 'form');
But it work only for the last row in CSV .
It is creating product only for the last row , so how I can run form plugin for each CSV row , not only for last row .
thank you
 
The best place to do anything with a CSV import or export is with the 'listcsv' plugin (you'll have to install it from our downloads section, or discover/install it if you've done a github update).

This plugin allows you to run code at every stage of the import - before it starts, before and after every row import (with the ability to skip a row import), and after it finishes.

You should be able to do ...

Code:
$listModel = $this->getModel();
$formModel = $listModel->getFormModel();

... and then do whatever you need to do from there.

-- hugh
 
The best place to do anything with a CSV import or export is with the 'listcsv' plugin (you'll have to install it from our downloads section, or discover/install it if you've done a github update).

This plugin allows you to run code at every stage of the import - before it starts, before and after every row import (with the ability to skip a row import), and after it finishes.

You should be able to do ...

Code:
$listModel = $this->getModel();
$formModel = $listModel->getFormModel();

... and then do whatever you need to do from there.

-- hugh

I have downloaded listCSV plugin.
Do you mean I must create file like (create_client_user.php example) to create products.
It is difficult for me to do that ,
I am searching on a way to run form j2store plugin when import csv without writing new code .
Is there a way in listCSV plugin to run form j2store plugin ?
thank you
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top