You are here:  » Reorganise category per product when importing

Active Forum Topics


Reorganise category per product when importing

Submitted by Randza on Wed, 2020-01-15 19:34 in

Hi,

I would like to ask if either there is a way to reorganise the category per product (or ID product).
I explain my idea.

For feed
1- I import only ID1, ID2, ID3 ... ID20 >>> I think this is a "Drop Record If Not RegExp" matters

2- for ID1 and ID3, I would put them in category 1
for ID2, ID4 and ID15 >> in category 2
and so on.

Category 1 and 2 are new categories than the merchant original feed one.

Thanks for your support

Submitted by support on Thu, 2020-01-16 09:34

Hi Randza,

If ID1, ID2 etc. are being imported as the Category field then you can just use straight forward Category Mapping but if they are product names it is an easy mod to make the code that applies exact match alternatives (=Category) also check the product name. To try this, edit includes/admin.php and look for the following code beginning at line 382:

    if (isset($admin_importCategoryMappings["=".$importRecord["category"]]))
    {
      $importRecord["category"] = $admin_importCategoryMappings["=".$importRecord["category"]];
    }

...and REPLACE with:

    if (isset($admin_importCategoryMappings["=".$importRecord["category"]]))
    {
      $importRecord["category"] = $admin_importCategoryMappings["=".$importRecord["category"]];
    }
    elseif (isset($admin_importCategoryMappings["=".$importRecord["name"]]))
    {
      $importRecord["category"] = $admin_importCategoryMappings["=".$importRecord["name"]];
    }

Cheers,
David.
--
PriceTapestry.com

Submitted by Randza on Thu, 2020-01-30 19:56

Thank you David for your reply.

I will implement it and tell you the result.

Submitted by Randza on Sun, 2020-02-23 14:12

Hi David,

I would like to ask you if it is possible (or how to do) if I have this situation.

I have several feeds F1, F2, and so on
In each feed, the product has its own name and its own category
For example, for the same product P1,

in feed F1, the name is N1 and the category is C1
in feed F2, the name is N3 and the category is C2
in feed FX, the name is N2 and the category is CX

I would like then :
for F1 to import only all the products of category C1 >> I think it is possible via Drop Record If Not RegExp

for F2, the same thing, import only C2 category and the same for FX, import only the choosen category

then after that, I would associate N1, N3 and N2 to the same category CC (without changing their title neither their description) because I would like to maintain their original title and description.

Is there an issue to fix this ?

Thanks,
Randza

Submitted by support on Mon, 2020-02-24 09:58

Hello Randza,

Regarding the import - you can just use Drop Record If Not filter against the category field, and enter the category name who's products you do want imported in the box on the configuration page for the filter.

Then regarding category mapping, I assume you will be using Product Mapping to match N1 / N3 / N2 to your chosen name and you can use the Custom Category field on the configuration page for a product mapping to set your preferred category.

Cheers,
David.
--
PriceTapestry.com