You are here:  » Adding brand to mapped products with blank brand field

Support Forum



Adding brand to mapped products with blank brand field

Submitted by Klyde on Tue, 2008-11-04 16:18 in

Hello,

Many of my merchants don't have the brand of each product in there feed so brand always stay blank for many product even if I know the brand it woul be. Do you know if there is a way for mapped product to add a filter like:

If Mapped product name contain "blablabla" brand is "Toto"

Thanks

Submitted by support on Tue, 2008-11-04 16:46

Hi Klyde,

This sort of thing can be patched into the import record handler function quite easily in place of a more comprehensive modification. For example, to apply the logic: IF brand is empty, AND product name is "Foo" then brand = "Bar", look for the following code beginning at line 243 of includes/admin.php:

    else
    {
      $brand = "";
    }

...and replace this with:

    else
    {
      $brand = "";
      // add as many lines like this as necessary replacing Foo and Bar!
      if (strpos($record[$admin_importFeed["field_name"]],"Foo")!==FALSE) $brand = "Bar";
    }

Hope this helps!

Cheers,
David.

Submitted by Klyde on Wed, 2008-11-05 14:28

Perfect ;-)
Thanks