Is it possible to have a mod that if I ask the script to drop products if mask is not listed in all fields not just single ones.
I was not sure if by adding filter rule it would check each then drop at the end of the process.
I'm working with a large CSV and want to create a niche store.
Please advise.
Thank you.
Hello,
Thank you for your response. Is it possible to have more than one keyword?
Like
$keyword = "mask, fangs, wig";
;)
Thank you.
Hi Mike,
No probs - have a go with this as the replacement:
$dropRecord = TRUE;
$keywords = array("mask","fangs","wig");
foreach($keywords as $keyword)
{
if (
(strpos($importRecord["name"],$keyword)!==FALSE)
||
(strpos($importRecord["description"],$keyword)!==FALSE)
)
{
$dropRecord = FALSE;
break;
}
}
if ($dropRecord) return;
/* check product record for minimum required fields */
Cheers,
David.
--
PriceTapestry.com
Hello David,
How do I add the keyword and have the script avoid just looking for punctuation. I was testig like Mask would only bring up exact Mask and if I added mask also it added 430 more products that had the mask keyword. How would I do that. I was trying to make a site that way and it very tedius to add keywords twice one lower case and one with upper case. Is there a way to add one to just look at the keyword itself?
Thank you,
Michael
Hi Mike,
Very easy to make case insensitive... in place of:
if (
(strpos($importRecord["name"],$keyword)!==FALSE)
||
(strpos($importRecord["description"],$keyword)!==FALSE)
)
...use:
if (
(strpos(strtolower($importRecord["name"]),strtolower($keyword))!==FALSE)
||
(strpos(strtolower($importRecord["description"]),strtolower($keyword))!==FALSE)
)
Cheers,
David.
--
PriceTapestry.com
Hi Mike,
Multi-field record dropping is probably best implemented as a simple modification within the import record handler function in includes/admin.php. In that file, look for the following comment (line 273 in the 12/10A distribution):
/* check product record for minimum required fields */
To drop the record if the word "mask" is not present in the name or description, REPLACE the above code with the following:
$keyword = "mask";
if (
(strpos($importRecord["name"],$keyword)===FALSE)
&&
(strpos($importRecord["description"],$keyword)===FALSE)
)
{
return;
}
/* check product record for minimum required fields */
Hope this helps!
Cheers,
David.
--
PriceTapestry.com