Mass actions do not import non product_id matched

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #228838

-- HikaShop version -- : 2.6.1
-- Joomla version -- : 3.4.8

I am opening a new thread for this problem as my older threads are contaminated with too much parallel evolution.

–––––––––––––––––––––––––––––––––––––––––––––––––––––
The topic started in this thread that now I consider obsolete
www.hikashop.com/forum/product-category-...aving-a-product.html
–––––––––––––––––––––––––––––––––––––––––––––––––––––

After making testing on tricking on the CSV file exported through mass action I found:

1. Products do contain the "product_type" info as 'main'.
2. Products with a "product_id" that are matching some product in the target site will update.
3. Products with a new "product_id" which is not already created in the target site are ignored.

4. Tricking the CSV file and giving the new products a different "product_id" that matches some other product in the target site WILL WORK as an updated product.

So it seems like the CSV Import Mass Action is lacking some logic that lets new products to be added to the database.

I hope this would make your team easier to find out a fix for this.

I can not firmly say this is a standard HikaShop bug as I just tested in my testing sites, both updated to newsest HikaShop Business 2.6.1 [1602031626]

I will be available for any further test if HikaShop team requires me as I really need this to be fixed ASAP.

Best regards.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #228918

Hi,

Wow, so many improvements !! ;)

I just fix this issue, here are the patched files. The same ones as on another of your threads, they contain the fixes of the other thread too.

File Attachment:

File Name: massaction...04-2.zip
File Size:17 KB

File Attachment:

File Name: plg_hikash...04-2.zip
File Size:9 KB

Attachments:
Last edit: 8 years 1 month ago by Xavier.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #228948

Thank you, checkin immediately and reporting ASAP.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #228949

Hi Xavier,

I'm sorry to say that I experienced no difference in this last updates.

Images work the same.

new products not matching an existing product_id in the target site are not getting created.

Could it be that the last links provided are accidentally linking to the older files?

–––––––––––––––––––––––––––––––––––––––
UPDATE: Confirmed outdated link.

As for the massaction.php for the classes folder I see it identical to the one in the early afternoon, compared with textwrangler compare tool.

So this brings me some hope your fixes will work with the right file.

As for the plugin file I see the diferences with a new code section named //Create Prdocut.

So lets hope with the massaction.php file this will work. I will wait for the updated link.

Last edit: 8 years 1 month ago by PeterChain.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #228971

Hi,

I just checked and the two files does not have the same content, you have to use the "massaction_2016-02-04-2.zip" one.

I have done local tests with a simple csv file, and the non-existing products are correctly created.
But I just see that I forgot to give you one important information, when setting up your mass action, you should see a new check box with a not translated string, you have to check this box in order to allow the creation of the products not already in the shop. My bad, without this element that indeed can't work.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229004

Hi Xavier,

sorry that I was wrong with the file comparison, don't know if I got some "cache involved misunderstood", I redownloaded it right now and is diferent form my yesterday evening download.

Anyhow:

I'm not able to see this checkbox in the CSV products filter and also not in the Action Export CSV file (I understand it has to be in the filter).

I checked both in the existing Mass actions and creating new ones from scratch.

My backend interface is in english. I could move to french if needed.




–––––––––––––––––––––––
UPDATE
–––––––––––––––––––––––

I made a new clean install of HikaShop with most recent version (fresh download) and put the massaction-php in classes folder. Uploaded the plugin form the forum.

I can still not see the 'allow the creation of the products not already in the shop' checkbox.

So I assume this lack is not generated by any peculiar thing in my test sites. Hope this helps guiding your team to find out.

Attachments:
Last edit: 8 years 1 month ago by PeterChain. Reason: Update info

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #229012

Hi,

No once again it's my bad, I forgot to give you another edited plugin:

File Attachment:

File Name: plg_system...2-05.zip
File Size:29 KB

Attachments:
Last edit: 8 years 1 month ago by Xavier.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229173

Ok. Sorry that I didn't come back to you until now. Strangely I never got an email reporting for this update :( so I found it now through my desperation process to find a solution.

I checked the new plugin. I can confirm now the checkbox to add new products is there. But sadly I can confirm it STILL NOT creates new products. Maybe something else be missing in the process. Should I configure some special rights somewhere or something maybe you at HikaShop take for granted but not me as a user?

If your experimental site is doing this well, please don't hesitate to check my sites for which you have access. Maybe you find something unusual there.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229193

###### FINDING THE DEFINITIVE SOLUTION ######

Hi and thanks to all at Hikari support team for helping me make massactions Import / Export work and add features.

Sadly after the last update from Xavier I am still not able to make it work as expected / desired so in my desperation to find a solution I did this:

––––––––––––––––
Created two sites, one as a source of products and one as a target.

Both sites are absolutely clean with most recent HikaShop, no one single customization except for the most up to date files offered by Xavier:

massaction.php that replaces the original one in the folder administrator/components/com_hikashop/classes

the product massaction plugin.

After doing this I created the right Massaction for export and import in each site.

Modified a product of three that are equally created in both sites.
Created a new product in the source site.

Exported from source.

Imported in target.

As in my project site I get the same result:

Previously exiting product gets updated.
New created product is not getting imported.
––––––––––––––––

###### PLEASE I NEED YOUR HELP ######

I believe this experiment is enough to proof something is missing in all friendly advice I am receiving these late days from Hikari Support Team.

If your developing site is working right and mine downloaded from your site is not there must be something lost in the explanations or that I am getting wrong.
I don't dare to speculate anymore as I am not the developer but I really need your best assistance on this to clear this now too bad situation for me.

I am sending the access to both PROOF SITES to your contact@ email so you can check whatever you want. I hope this will help and make realistic the small last step that should make this work.

Thanks in advance for your understanding and good will to help fix this.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #229215

Hi,

Could you provide FTP accesses ? That way I will be able to debug the issue on the website directly.

Last edit: 8 years 1 month ago by Xavier.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229256

Thank you Xavier,

I send them via HikaShop contact form yesterday afternoon, can't say exact hour.

The form was identified with this thread URL and post number #229193

I will send this again now to make sure it arrives to you.

Regards.

UPDATE!

Oh sorry! Tehre was no FTP access!

I will send it right now.

Last edit: 8 years 1 month ago by PeterChain.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #229285

Hi,

I just updated the files on your server, I don't know why but the content was not up to date.
The code for the new product creation was missing.

Please do a test with these latest versions and keep me informed.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229319

Just created anew product in site hikasource.xxxx with this name product:

SECOND NEW PRODUCT AFTER XAVIER TEST REQUIREMENT

then I executed the massaction Product Exporter.

then downloaded the file to check if the new product is there. It is.

Then went to the site hikatarget.xxxxx

executed the massaction Product Importer.

The new product is not showing. :(

––––––––––––––––
What do you exactly mean with 'The code for the new product creation was missing.' ?


–––––– UPDATE –––––

Then updated an already existing product in both sites with this text in both prodcut_name and product_code:

CHANGES ON ALREADY EXISITING PRODUCT

They show in the target site. New products still not showing.

Last edit: 8 years 1 month ago by PeterChain.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #229367

Hi,

Ok I know why the products were not created, that's because we must not export the "product_id" column.
If there is an id, so it means update. So there was conflict.

It is a very litigious part, because in your case you have to export all the columns but the id one, but if you change a product code so it will create a new product. If we handle the ids, we will have to do a lot of complementary checks so resource consuming.
And same thing, to check if the product exist and is the one we want to update so we compare the product_codes, so if they are edited we will not create the product.

I will continue to think of an improvement, but for now the product creation and edition is working fine, except for the product codes.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229400

So if I understand right:

I can create new products and update products.

But if part of the update is a change in product_code then a new product will be created. Right?

If i understood right I can live with it by now.

I can also create a mass action that includes product_id so i use it in special cases in which the product_code is changed which will be a very unusual situation in my project.

Then, finally:

To to a real world test in my real sites. Could you provide me with the latests newest versions of the files I have to change?

After so many tries I am afraid I could be using some outdated files and start the wheel again.

Thank you very much for all support and dedication.

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229455

Hi Xavier,

I realised that after some 'to me unknown changes' the experimental hikatarget.xxx site finally imported the new products created in the hikasource.xxx site.

After your product_id statement I made my own tests both with and without checking the product_id in the export Massaction and I can't reproduce your success (in the same site you did).

Are you making further changes or testing so this could be why I can't make it to work?

I need to implement last improvements in my real life testing sites before putting them really online. But at this moment don't know what final files must be replaced from the standard HikaShop distribution and what else 'trick' is needed to make products created in a Massaction import as enabling / disabling product_id in the product table does not look like (in my case) enough to make it work.

I planned this to be already working some days ago as I believed Massactions import / Export was fully functional. I understand everything needs testing and evolution so this is not a complain at all but just a humble 'beg for your empathy' as I think we must be really a very small step to full success and I really need this feature available.

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #229528

Hi,

When testing, I was removing manually the product_id column from the csv file, I forgot that the product_id column is always exported even if we uncheck the checkbox for the export mass action.
This allow to do complete checks on the products.

So I edited once again the code to handle that, and improve the algo to do more checks about the ids, if the id is existing so we replace the product, if not we create it.

Now the product code can be edited, if the id is correct the product code will be changed as expected, but if the product code is edited and the id is not a valid id, we create a new product as the system can't know if it is only a code edition in that case.

Here is attached all the latest file versions:

File Attachment:

File Name: massaction...2-10.zip
File Size:17 KB


File Attachment:

File Name: plg_hikash...2-10.zip
File Size:9 KB


File Attachment:

File Name: plg_system...2-10.zip
File Size:15 KB



I hope this time is the good one ;)

Attachments:
Last edit: 8 years 1 month ago by Xavier.
The following user(s) said Thank You: PeterChain

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229543

Big thank you Xavier, I am aware you are investing a lot of time in this. Hope it will be useful for many HikaShop users.

I will be back to you ASAP with feedback during the day as it is difficult to start checking this right now.

Best regards

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

  • Posts: 634
  • Thank you received: 16
  • Hikashop Business
8 years 1 month ago #229587

Hi Xavier,

made some tests and the system looks to work quite well and for now enough to let me go on with it and test in my own customized test sites.

Indeed could be that the system works perfect and is only me who has to adapt some method.

Because of this I sent you by email a PDF with some analysis of what I saw after some testing, hope is useful for you and maybe brings some help to provide some improvement if needed.

For any other part you want to test we can go on as far as you want to use our hikasource / hikatarget sites and i will provide you with betatesting exercices as long as you require me even if is not for any direct petition from me.

let me repeat a warm THANK YOU for your professionalism and implication in helping go forward with this Massaction affaire.

UPDATE:

Just wanted to add that now have tested this on my real website clones for test with a lot of product customization and so and is working as good as in the clean fresh install test sites.

Last edit: 8 years 1 month ago by PeterChain. Reason: UPDATE info

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

  • Posts: 13201
  • Thank you received: 2322
8 years 1 month ago #229632

Hi,

Thank you for having tested that feature, we will come back at this to improve that part of the mass actions.
The modifications done were to help you, I don't have developed it as we do usually, so no tests, etc.

Glad to hear that it is working on the website with a lot of products.
I will have a look at your PDF file to see your analysis in order to do the correct improvements.

I can't give a date for these developments as it is not our first priority for the moment ;)

The following user(s) said Thank You: PeterChain

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

Time to create page: 0.113 seconds
Powered by Kunena Forum