Hi David
Trust you are well
In my product mapping I feel it would benefit me to add a 'Delete Product Mapping' button on the productsmap_configure.php page which I have done below, however is there anyway when it deletes it could return to the same productsmap_configure.php that it was on? (which I know would show empty fields, but as I have over 10,000 mapped products it would save waiting for the productsmap.php to load), I usually use the prev or next links to navigate through my product maps.
if ($id > 1) print "<a href='".$href."?id=".($id-1)."'>Prev</a> ";
print "<a href='".$href."?id=".($id+1)."'>Next</a> ";
print "<form action='productsmap_delete.php?id=".$productmap["id"]."' method='post'><input type='submit' name='submit' value='Delete Product Mapping'></form>";
print "<h3>".$productmap["name"]."</h3>";
any help with this would be greatly appreciated
regards
Phil
As always David that works perfect!!
Thanks so much
regards
Phil Stone
Hi Phil,
A "Reset" function would be straight forward, in productsmap_configure.php if you look for the following code at line 27:
if ($submit == "Save")
...and REPLACE with;
if ($submit == "Reset")
{
$sql = "UPDATE `".$config_databaseTablePrefix."productsmap` SET
alternates = '',
description = '',
category = '',
brand = '',
image_url = ''
WHERE id ='".database_safe($id)."'";
database_queryModify($sql,$insertId);
header("Location: productsmap_configure.php?id=".$id);
exit();
}
if ($submit == "Save")
And then to add the Reset button to the form, look for the following code at line 133:
print "<input type='submit' name='submit' value='Cancel' /> ";
...and REPLACE with:
print "<input type='submit' name='submit' value='Cancel' /> ";
print "<input type='submit' name='submit' value='Reset' /> ";
Cheers,
David.
--
PriceTapestry.com