You are here:  » pt_productsmap on import


pt_productsmap on import

Submitted by philstone on Thu, 2017-09-28 18:05 in

Hi David

Hope all is well

I wanted to ask a question ref the pt_productsmap field in the database during import. I have about 6000 products mapped out of 2.6 million total products, but when i do a full import with the pt_productsmap field empty it takes about 1 hour and when it has the 6000 mapped lines it takes 18+ hours.

Would there be anyway to do a similar process to the import when a full import starts similar to pt_products_import where the importing products move to a temporary field until all products are imported, so the mapped products move to pt_productsmap_import then after pt_products_import completes pt_productsmap_import move back to pt_productsmap before the uidmap begins?

ps. hope this makes sense

Regards

Phil

Submitted by support on Fri, 2017-09-29 08:18

Hello Phil,

If the majority of your Product Mapping configurations use =Exact Match alternatives there is in fact a much more efficient way for these to be applied so if you could email me includes/admin.php i'll apply that for you to try in the first instance...

Cheers,
David.
--
PriceTapestry.com

Submitted by sirmanu on Fri, 2017-09-29 13:42

Hi David. Could you share the solution over here?
I am using pt_categories_hierarchy with =Exact Match, and maybe this is useful to me.

Submitted by support on Fri, 2017-09-29 13:55

Hi,

For Product Mapping;

Edit includes/admin.php and look for the following code at line 128:

    global $admin_importProductMappings;

...and REPLACE with:

    global $admin_importProductMappings;
    global $admin_importProductMappingsExact;

And then the following code at line 266:

    if (isset($admin_importProductMappings["=".$importRecord["name"]]))
    {
      $importRecord["name"] = $admin_importProductMappings["=".$importRecord["name"]];
    }

...and REPLACE with:

    if (isset($admin_importProductMappingsExact["=".$importRecord["name"]]))
    {
      $importRecord["name"] = $admin_importProductMappingsExact["=".$importRecord["name"]];
    }

And then the following code at line 274:

        if (substr($k,0,1) !== "=")

...and REPLACE with:

        if (TRUE)

And then the following code at line 555:

    global $admin_importProductMappings;

...and REPLACE with:

    global $admin_importProductMappings;
    global $admin_importProductMappingsExact;

And finally the following code at line 636:

          $admin_importProductMappings[$alternate] = $productsmap["name"];

...and REPLACE with:

          if (substr($alternate,0,1) === "=")
          {
            $admin_importProductMappingsExact[$alternate] = $productsmap["name"];
          }
          else
          {
            $admin_importProductMappings[$alternate] = $productsmap["name"];
          }

For Category Hierarchy Mapping;

Edit includes/admin.php and look for the following code at line 122:

    global $admin_importCategoryHierarchyMappings;

...and REPLACE with:

    global $admin_importCategoryHierarchyMappings;
    global $admin_importCategoryHierarchyMappingsExact;

And then the following code at line 416:

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

...and REPLACE with:

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

And then the following code at line 424:

        if (substr($k,0,1) !== "=")

...and REPLACE with:

        if (TRUE)

And then the following code at line 555:

    global $admin_importCategoryHierarchyMappings;

...and REPLACE with:

    global $admin_importCategoryHierarchyMappings;
    global $admin_importCategoryHierarchyMappingsExact;

And finally the following code at line 615:

          $admin_importCategoryHierarchyMappings[$alternate] = $category["id"];

...and REPLACE with:

          if (substr($alternate,0,1) === "=")
          {
            $admin_importCategoryHierarchyMappingsExact[$alternate] = $category["id"];
          }
          else
          {
            $admin_importCategoryHierarchyMappings[$alternate] = $category["id"];
          }

Cheers,
David.
--
PriceTapestry.com