Hi david,
say i have all the datafeeds in one format and have uploaded all the datafeeds on the /feeds folder
Is it possible to create a one click setup/import for all the datafeeds?
the setup will have a common header datafeed names.
thank you for the continuing support.
regards,
oisin
thanks for the quick reply. this is a nice mod.
how do i add the category and manufacturer auto check?
an "unbranded" and "nocategory" default would be cool also if the categories and manufacturer fields are empty.
Hi,
You can add another couple of lines to the code that builds the $default array as follows to do this for category and brand:
$defaults["fieldCategory"] = array("CATEGORY","MASTERCATEGORY");
$defaults["fieldBrand"] = array("BRAND","MANUFACTURER");
If the defaults don't exist then it will revert back to unbranded / no category as these are the existing defaults (they are optional fields)...
Cheers,
David.
Hi Oisin,
This is effectively what the register.php automation script is intended to do. If you have command line access to your server (via Telnet or SSH) you can register lots of similar feeds quickly. Check the following page for more info...
http://www.pricetapestry.com/node/8
However, something else you might want to do and this is a nice mod that i've been thinking about for some time is to make the Feed Registration (Step 2) page automatically look for common field names for each of the fields and set them by default if they exist. Then, all you need to do is enter the merchant name and click Register.
In admin/feeds_register_step2.php you will find the following function:
function field($title,$name,$prefixHTML="")
{
global $productRecordFields;
print "<tr>";
print "<td><nobr>".$title."</nobr></td>";
print "<td>".$prefixHTML;
$default = (isset($_POST[$name]) ? $_POST[$name] : "");
widget_selectArray($name,$productRecordFields,$default,"Select..");
widget_errorGet($name);
print "</td>";
print "</tr>";
}
Replace this function with the following new version:
function field($title,$name,$prefixHTML="")
{
global $productRecordFields;
$defaults["fieldName"] = array("PRODUCTNAME","NAME");
$defaults["fieldDescription"] = array("PRODUCTDESCRIPTION","DESCRIPTION");
$defaults["fieldImageURL"] = array("IMAGEURL","SMALLIMAGE","IMG","PICTUREURL");
$defaults["fieldBuyURL"] = array("BUYURL","DEEPLINK","URL");
$defaults["fieldPrice"] = array("PRICE");
print "<tr>";
print "<td><nobr>".$title."</nobr></td>";
print "<td>".$prefixHTML;
$default = (isset($_POST[$name]) ? $_POST[$name] : "");
if (!$default && is_array($defaults[$name]))
{
foreach($defaults[$name] as $fieldName)
{
if (isset($productRecordFields[$fieldName])) $default = $fieldName;
}
}
widget_selectArray($name,$productRecordFields,$default,"Select..");
widget_errorGet($name);
print "</td>";
print "</tr>";
}
In the new version, you will see arrays created for each of the main field types, containing a list of common field names for that field. Simply edit this section to add the field names that you want to be automatically selected for the appropriate entry!
Hope this helps,
Cheers,
David.