- Posts: 86233
- Thank you received: 14225
auto-import csv file every 10 minutes
If you remove the beginning of the code in your cron function:
$pluginsClass = hikashop::get('class.plugins');
$plugin = $pluginsClass->getByName('hikashop','rates');
if(empty($plugin->params)){
$plugin->params = 86400;
}
if(!empty($plugin->params) && $plugin->params+$plugin->params>time()){
return true;
}
$plugin->params=time();
$pluginsClass->save($plugin);
then, it will import the CSV each time the cron url is triggered.
Please Log in or Create an account to join the conversation.
- Posts: 22
- Thank you received: 0
You guys deserve a medal :woohoo:
This is by far the best (and fastest) support I ever received.
Great work on Hikashop!
Nikajoloem
Please Log in or Create an account to join the conversation.
- Posts: 22
- Thank you received: 0
Manually, the cron works fine.
I setup the cron to work every 15min in Hikashop backend, but the automated cron is not importing the csv...
Any ideas?
Nikajoloem
Please Log in or Create an account to join the conversation.
Do you have some extension/plugin which redirects the page on the front end ?
That would explain why it doesn't work as the cron system we have on our end does not follow redirects like a browser in order to reduce the load on our end.
So if you removed the redirection that would solve the problem.
Another solution would be to use the cron manager of your hosting and set the cron URL in there so that you are independent from us.
Please Log in or Create an account to join the conversation.
There is also an option to specify columns conversion :
old_column1_name:new_column1_name;old_column2_name:new_column2_name
This attachment is hidden for guests.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
Almost none of my supplier's columns match up with Hika shop.
Please Log in or Create an account to join the conversation.
In the options of the plugin, you have one option to tell the system which column correspond to which one in hikashop as explained in my previous post.
Please Log in or Create an account to join the conversation.
Here is the format it uses:
I do have an email in to them to see if they have a csv update.
So, regarding the plugin in, this is what I should be entering in the "Column Names" box:
productcode:product_code;inventorylevel:product_quantity
Lastly, can I use this plug-in if I have to do a manual update? I might just to an update weekly if I can't do it in real time.
Please Log in or Create an account to join the conversation.
What you entered in the option of the plugin is fine but you would first need to have a CSV...
You can always run the cron manually when you need to run the import by calling the cron URL that you will find in the tab cron of the configuration via your browser.
Please Log in or Create an account to join the conversation.
- Posts: 22
- Thank you received: 0
I have a follow-up question on csv-import.
Is it possible to define the product order in the csv?
Kind regards,
Nikajoloem
Please Log in or Create an account to join the conversation.
What you can do though is to put the products in your CSV in the order you want them and then, insteadof sorting them by the ordering field on your modules/menus, you could order them by product_id.
Please Log in or Create an account to join the conversation.
- Posts: 22
- Thank you received: 0
Product ordering = set to ordering (manual), but after uploading the csv (with new prices for example), the order field is ste to 0 for all products...
Please Log in or Create an account to join the conversation.
All the links to the categories are deleted for the imported product and the new ones in the CSV recreated.
Please Log in or Create an account to join the conversation.
And i have had alot of problems.
It seems that the Column names part doesn't work...
If i set the right collumnames i the csv, i can get it to work, but only for the collums i have set the right names in the file for.
Also if the file doesn't end on .csv it doesn't work either.
And i can noway define multi files by wildcard or other way, so i can only do this for one file... what now, if i have more than one file uploaded to me ?
The most important thing to get a fix for, is the Column names part as i need this asap so the site can go live.
Please Log in or Create an account to join the conversation.
You didn't say how you configured your column names part, so I can't tell you what you did wrong.
Having the CSV would also help.
There is indeed code in the plugin which checks that you import only CSV files. So if the extension of the file is not CSV, it will reject it. If you don't want that, you can remove the code below in the file of the plugin:
There is indeed no way to specify multiple files in the plugin. You won't have to generate several plugins based on that one by changing the name of the plugin for each instance in the code and then enter each file in the options of the plugins.
Please Log in or Create an account to join the conversation.
Column names ItemID:product_code;Item:product_name;ItemWebDescription:product_description;StockActual:product_quantity;Price:price_value;CreateDateTime:product_created;
charset UTF-8
a few lines from the file
"product_code";"Qty";"ItemOEM";"ItemEAN";"Item";"ItemTxt";"ItemWebDescription";"Unit";"StockActual";"ExpectedDate";"price_value";"PriceTaxAndFees";"Currency";"VatTax";"ItemType";"Brand";"Weight";"Volume";"Height";"Width";"Depth";"AddFeesTax";"CustItemId";"CreateDateTime";"StatCode";"OrigCountry";"MinQ";"Multiples";"Colli";"BrandTxt";"ItemTypeTxt";"NonStockItemTxt";"BIDID"
"BROBP60PA";1;"BP60PA";"4977766628501";"Ink-jet paper (250 ark)";"";" 250 ark Ink-jet papir - A4. Gramvægt:80 g/m2.Passer til følgende printere:Alle Brother blækprintere/-fax.";1;0;"2013/05/30";21.19;21.19;"DKK";5.2975;"PAP140";"BRO";0.269;0;0;0;0;0;"";"30052013043325";"48025620";"JP";1;1;20;"Brother";"Office paper";0;""
"BROBP71D1BOM";1;"BP71D1BOM";"";"Brother paperstand incl. paper.";"";" Nu har du mulighed for at gøre en ekstra god forretning på den originale BP71-papirserie til Brothers inkjet-printere.Bestil en startpakke nu! Startpakken indeholder følgende:10 pk. BP71GA3 A3 glossy fotopapir – 20 ark10 pk. BP71GA4 A4 glossy fotopapir – 20 ark20 pk. BP71GP50 10 × 15 cm glossy fotopapir – 50 ark(Alle papirtyper er 260g/m2)";1;0;"";1999;1999;"DKK";499.75;"PAP100";"BRO";0.05;0;0;0;0;0;"";"30052013043325";"84439990";"JP";1;1;20;"Brother";"Photo paper, special";1;""
anything else you need to be able to help me ?
Please Log in or Create an account to join the conversation.
Same for the column Price, so you should remove Price:price_value too.
Please Log in or Create an account to join the conversation.
"itemId";"Qty";"ItemOEM";"ItemEAN";"Item";"ItemTxt";"ItemWebDescription";"Unit";"StockActual";"ExpectedDate";"Price";"PriceTaxAndFees";"Currency";"VatTax";"ItemType";"Brand";"Weight";"Volume";"Height";"Width";"Depth";"AddFeesTax";"CustItemId";"CreateDateTime";"StatCode";"OrigCountry";"MinQ";"Multiples";"Colli";"BrandTxt";"ItemTypeTxt";"NonStockItemTxt";"BIDID"
"BROBP60PA";1;"BP60PA";"4977766628501";"Ink-jet paper (250 ark)";"";" 250 ark Ink-jet papir - A4. Gramvægt:80 g/m2.Passer til følgende printere:Alle Brother blækprintere/-fax.";1;0;"2013/05/31";21.19;21.19;"DKK";5.2975;"PAP140";"BRO";0.269;0;0;0;0;0;"";"31052013043335";"48025620";"JP";1;1;20;"Brother";"Office paper";0;""
"BROBP71D1BOM";1;"BP71D1BOM";"";"Brother paperstand incl. paper.";"";" Nu har du mulighed for at gøre en ekstra god forretning på den originale BP71-papirserie til Brothers inkjet-printere.Bestil en startpakke nu! Startpakken indeholder følgende:10 pk. BP71GA3 A3 glossy fotopapir – 20 ark10 pk. BP71GA4 A4 glossy fotopapir – 20 ark20 pk. BP71GP50 10 × 15 cm glossy fotopapir – 50 ark(Alle papirtyper er 260g/m2)";1;0;"";1999;1999;"DKK";499.75;"PAP100";"BRO";0.05;0;0;0;0;0;"";"31052013043335";"84439990";"JP";1;1;20;"Brother";"Photo paper, special";1;""
Please Log in or Create an account to join the conversation.
Notice
The line '"BROBP60PA";1;"BP60PA";"4977766628501";"Ink-jet paper (250 ark)";"";" 250 ark Ink-jet papir - A4. Gramvægt:80 g/m2.Passer til følgende printere:Alle Brother blækprintere/-fax.";1;0;"2013/05/31";21.19;21.19;"DKK";5.2975;"PAP140";"BRO";0.269;0;0;0;0;0;"";"31052013043335";"48025620";"JP";1;1;20;"Brother";"Office paper";0;""' could not be imported Product not found
Please Log in or Create an account to join the conversation.
It's the column itemId which is there.
The product_code column is the most important one. If the system cannot find it, it can cause a lot of issues.
Please Log in or Create an account to join the conversation.