OSCOMMERCE SUPPORT CALL 702-453-3332

 

Help - Search - Members - Calendar
Full Version: Skip Preview on Product Insert or Update
osCommerce Community Support Forums > osCommerce Online Merchant v2.x > Tips and Tricks
Chemo
In admin/categories.php find this code:
CODE
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

...and change it to this:
CODE
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<?
switch($_GET['action']){
    case 'new_product_preview':
 $onload = isset($_GET['pID']) ? 'document.update_product.submit();' : 'document.insert_product.submit();';
 break;
    default:
 $onload = 'SetFocus();';
 break;
}
?>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="<? echo $onload; ?>">

...all done.

Now on new product insert or existing product update it will skip the preview page completely (actually, auto submit instantly on page load).

Enjoy!

Bobby
spr1nt
chemo....thaaaaaank you. ive been trying to do this but with my limited php knowledge the only results ive been getting are error messages. im sure this will help many others !
kitchenniche
Great! this saves a lot of time!
BTBJ
Fabulous ... thanks a lot, love this
bibleman
QUOTE (Chemo @ May 31 2005, 07:56 AM)
In admin/categories.php find this code:
CODE
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="SetFocus();">

...and change it to this:
CODE
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
<script language="javascript" src="includes/general.js"></script>
</head>
<?
switch($_GET['action']){
    case 'new_product_preview':
 $onload = isset($_GET['pID']) ? 'document.update_product.submit();' : 'document.insert_product.submit();';
 break;
    default:
 $onload = 'SetFocus();';
 break;
}
?>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="<? echo $onload; ?>">

...all done.

Now on new product insert or existing product update it will skip the preview page completely (actually, auto submit instantly on page load).

Enjoy!

Bobby
*


Hi Bobby,

GREAT hack BUT.....

It all worked great but when you double click on a product in the products list under it's catagory then the product gets deleted!

Did anyone else experience this?
yello
QUOTE (bibleman @ Jul 23 2005, 10:22 PM)
Hi Bobby,

GREAT hack BUT.....

It all worked great but when you double click on a product in the products list under it's catagory then the product gets deleted!

Did anyone else experience this?
*


Yep. I have the same problem
PVK
Hmmm this was exactly what i was searching for, but the last 2 posts are a bit worrysome, which make me a bit unsure if it is wise to implement this great modification since it is a bit scary that you can actually delete products so easy (which sooner or later is bound to happen!)



Anybody figured it out yet?
Rochdalemark
QUOTE (PVK @ Jul 24 2005, 06:50 PM)
Hmmm this was exactly what i was searching for, but the last 2 posts are a bit worrysome, which make me a bit unsure if it is wise to implement this great modification since it is a bit scary that you can actually delete products so easy (which sooner or later is bound to happen!)
Anybody figured it out yet?
*



Anyone Fixed this yet???
J0hnnyBr4v0
QUOTE (Rochdalemark @ Jul 27 2005, 09:17 AM)
Anyone Fixed this yet???
*


Yup I also have the same problem.

Mod uninstalled.
pulsecheck
I had to uninstall the mode cause I experienced the same problem
rbartz
Here is the fix for the problem where the product is "deleted" (actually emptied of data...) when you click the product line to preview it:

Between the </head> and <body....... lines make it like this:

</head>
<?
if ($_GET['read'] != "only") {
switch($_GET['action']){
case 'new_product_preview':
$onload = isset($_GET['pID']) ? 'document.update_product.submit();' : 'document.insert_product.submit();';
break;
case 'new_master_preview':
$onload = isset($_GET['pID']) ? 'document.update_master.submit();' : 'document.insert_master.submit();';
break;
default:
$onload = 'SetFocus();';
break;
}
} else {
$onload = 'SetFocus();';
}
?>
<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF" onload="<? echo $onload; ?>">

There! You might want to change the Preview Button to Save....

SORRY about the tabbing and spacing, for some reason I cannot get the input to do it.... I edited it three times trying, I am done. duhhhhh
akvario
Thanks, just what i was looking for, confirmed working.
qiang
Thank you so much, it works!!!
melhaa
Hi
I really want this, but I already have an onload in my body from ajax attribute manager.
Any idea how to get this anyway?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.