Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

admin categories avoid preview


Juto

Recommended Posts

Hi, I have tried to write a script to avoid product preview when the products id is set.

So far I have this:

 

<?php
//Avoid preview:
//Bobby Easland (RIP)
//http://www.oscommerce.com/forums/topic/153391-skip-preview-on-product-insert-or-update/
//Add before the body tag:
switch($_GET['action']){
 case 'new_product_preview':
 $onload = isset($_GET['pID']) ? 'document.update_product.submit();' : 'document.insert_product.submit();';
 break;
 default:
 $onload = 'SetFocus();';
 break;
}
?>

 

Which I have changed to include ajax attribute manager, like so:

 

<?php
if ($current_page == FILENAME_CATEGORIES) {
//Avoid preview, update instantly:
 if ( (isset($_GET['read']) && ($_GET['read'] != 'only')) && ( isset($_GET['action']) == 'new_product_preview') ) {
   $onload = isset($_GET['pID']) ? 'document.update_product.submit();' : 'document.insert_product.submit();';
 } else {
//ajax attribute manager
   $onload = 'goonload();';
   require_once( 'attributeManager/includes/attributeManagerHeader.inc.php' );
   echo '</head>'."\n".'<body onload="'. $onload .'">';
 }
} else {
echo '</head>'."\n".'<body onload="SetFocus();">';
}
?>

 

Sorry to say I still get the preview, not instant update (clicking the preview button)

 

So anybody have a suggestion, please comment. I would love to have this working

 

Many Thanks

Sara

Link to comment
Share on other sites

Try changing

} else {
//ajax attribute manager
 $onload = 'goonload();';
 require_once( 'attributeManager/includes/attributeManagerHeader.inc.php' );
 echo '</head>'."\n".'<body onload="'. $onload .'">';
}

to

} else {
//ajax attribute manager
 $onload = 'goonload();';
 require_once( 'attributeManager/includes/attributeManagerHeader.inc.php' );
}
echo '</head>'."\n".'<body onload="'. $onload .'">';

Always back up before making changes.

Link to comment
Share on other sites

@@ecartz

Hi Matt! Thanks for your answer. I have just tested your suggestion, which gave the same result... no instant update...

If you have a site with AMA installed, Could you please test the snippet? I am totally lost...

 

Thanks

 

Sara

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...