Hi David,
I'd like to import the word "ETC", if the user_brand field is empty.
I put it in include/admin.php, but it didn't work.
Thank you
if ($admin_importFeed["field_brand"])
{
if (isset($record[$admin_importFeed["field_brand"]]))
{
$importRecord["brand"] = $record[$admin_importFeed["field_brand"]];
}
else
{
$importRecord["brand"] = "";
}
}
elseif($admin_importFeed["user_brand"])
{
$importRecord["brand"] = $admin_importFeed["user_brand"];
}
else
{
$importRecord["brand"] = "ETC";
}
if ($importRecord["brand"])
{
$importRecord["brand"] = tapestry_normalise($importRecord["brand"]);
}
Hi senaite,
Code looks fine but would rely also on no field being selected. Double check on Feed Registration Step 2 that it hasn't auto-detected to a common field name for brand, and if so you can change back to "Select...".
Alternatively, to simply set brand to ETC if it would otherwise be imported empty then after the above section of code you could add:
if (!$importRecord["brand"])
{
$importRecord["brand"] = "ETC";
}
Cheers,
David.
--
PriceTapestry.com