Hi David,
Got another question for you!
I have loads of feeds where I'm putting the %BRAND% value before the %PRODUCT% name, using the standard filters. However, I am also using brand mapping to consolidate some of the brand names. Is there a way I can do the brand mapping before applying the user filters as the brands are being changed in the BRAND field but obviously not in the NAME field? I can't just move the code around as the filters use the values from the individual data feeds to determine which field/value to operate on.
The only way I can think of is to remove the filters and then just hard code the 'text before' function in to admin.php after the brand mapping section.
There is a larger can of worms here between the actions of user filters/global filters and all the product/brand/category mapping that takes place so maybe there's some way of covering all of these at once so there's a definitive order as to which action takes place first etc.?
Cheers.
Keeop
Hi David,
Is it?! Not in mine! What should the order be ideally then? I have:
User/Global filters
Brand Mapping
Product Mapping (name/brand/category as required)
Category Mapping
I also don't have $importRecord["brand"]
So, I have the user/global filters, followed by:
/* construct brand value if required */
if ($admin_importFeed["field_brand"])
{
$brand = trim($record[$admin_importFeed["field_brand"]]);
}
elseif($admin_importFeed["user_brand"])
{
$brand = trim($admin_importFeed["user_brand"]);
}
if (strlen($brand) < 2)
{
$brand = "Unknown";
}
Cheers.
Keeop
Hi Keeop,
I was basing that on 11/09A / later as you mentioned Global Filters, but I know you've been a user for a long time and may have added those to an 01/06 distribution. Do you want to email me your current includes/admin.php and I'll make the appropriate changes in-situ for you...
Cheers,
David.
--
PriceTapestry.com
Hi David,
On its way. As mentioned in the email, it's in a bit of state so good luck!
Cheers.
Keeop
Hi Keeop,
As Brand Mapping is applied in includes/admin.php before user filters, what you could do is as follows - look for the following code at around line 183:
if ($importRecord["brand"])
{
$importRecord["brand"] = tapestry_normalise($importRecord["brand"]);
}
...and REPLACE with:
if ($importRecord["brand"])
{
$importRecord["brand"] = tapestry_normalise($importRecord["brand"]);
$record[$admin_importFeed["field_brand"]] = $importRecord["brand"];
$filter_record = $record;
}
In terms of priority, global filters are applied first, followed by feed filters; and in each case in order of creation (but it can be easily switched if necessary)
Hope this helps!
Cheers,
David.
--
PriceTapestry.com