MijoShop import #2

  • Posts: 70
  • Thank you received: 3
6 years 9 months ago #288353

-- HikaShop version -- : 3.3.0
-- Joomla version -- : 3.8.5
-- PHP version -- : 5.6
-- Browser(s) name and version -- : Chrome
-- Error-message(debug-mod must be tuned on) -- : None

All my catalog numbers are coming through concatenated as in MijoCatNo_HikaProdNo

What was a Cat # H1K240 in Mijoshop is now a Cat # H1K240_3744 in Hikashop. I want only the Mijoshop Cat #.

Where is the code in mijo.php that makes this happen? Can I comment part of that out?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 9 months ago #288367

Hi,

What is "Cat No" ?
Are you talking about categories ? Are you talking about products ?
What field of categories or products in HikaShop has the value you want to change exactly ?

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

  • Posts: 70
  • Thank you received: 3
6 years 9 months ago #288398

Sorry - that was not very clear.

The import script is joining mijoshop_product 'model' and 'product_id' into hikashop_product 'product_code'.

See the attached files. I do not want the underscore and what follows.

Our correct product code format is CYT-151 not CYT-151_351.

I'd like to modify the script to NOT add the 'product_id' to the 'model' before writing it to hikashop_product 'product_code'

Where is this done in your script? I can't locate it.

Attachments:
Last edit: 6 years 9 months ago by virusys.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 9 months ago #288401

Hi,

You would have to change the line:
$this->db->setQuery("UPDATE `#__mijoshop_product` AS mjp SET mjp.hika_sku = CONCAT(mjp.model,'_',mjp.product_id) WHERE mjp.hika_sku='';");
to:
$this->db->setQuery("UPDATE `#__mijoshop_product` AS mjp SET mjp.hika_sku = mjp.model WHERE mjp.hika_sku='';");
in the administrator/components/com_hikashop/helpers/import/mijo.php file.
Note that we do that because the "model" in MijoShop is not necessarily unique while the product_code in HikaShop is unique.
Because of that, if we were doing that by default, you would loose some of the products with the same "model" during the import.

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

  • Posts: 70
  • Thank you received: 3
6 years 9 months ago #288578

After deleting the concat statement, I needed to run the import again.

I emptied product and category tables and deleted the mijo_hika product, category tables. Now the import errors out.

How do I clear a previous import?

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
6 years 9 months ago #288607

Hi,

Well, if you delete these tables the import now thinks that all the products and categories of mijoshop are not in HikaShop but if they are still there, then the import won't work properly.
The best would be to delete all the hikashop_* tables, install HikaShop again, add the modification in the mijo.php file again, and then run the import again.
Note however that this means that you'll loose the settings and data you already had done in HikaShop.

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

  • Posts: 70
  • Thank you received: 3
6 years 9 months ago #288641

OK - thanks. That's what I did and I'm back on track again.

Thanks for your help.

Last edit: 6 years 9 months ago by virusys.

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

Time to create page: 0.051 seconds
Powered by Kunena Forum