Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Preview/Update


Xplod

Recommended Posts

When you create or edit a product you hate to preview it first...

 

How do I go about chukin a Update button next to Preview so I can just update it without previewing... saves so time when changing prices <_<

 

ta~~

Link to comment
Share on other sites

If you're staying out of the database, don't count on doing anything quickly!

 

There may be a way of disabling the preview but I don't know how - I never did it. The db isn't so scary once you get used to it and we were all noobs once ;)

 

Good luck

Link to comment
Share on other sites

  • 4 weeks later...

Hello,

I have found a quick and dirty solution, which changes the preview button into an update button.

 

In admin/categories.php find :

tep_image_submit('button_preview.gif', IMAGE_PREVIEW)

and change it into:

tep_image_submit('button_update.gif', IMAGE_PREVIEW)

 

find:

tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'] . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"'); ?>

and chang it into:

tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'] . '&action=update_product', 'post', 'enctype="multipart/form-data"'); ?>

 

kind regards Fred Stuurman

With kind regards ,

Fred Stuurman

Link to comment
Share on other sites

  • 3 years later...
I was too quick, this screws up adding a new product.

So forget the previous.

 

Not so fast! You were on the right track!

 

Find (part of 1 line):

echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit('button_preview.gif', IMAGE_PREVIEW)

Replace with (a new line and part of 1 line):

$save_button_name = (isset($HTTP_GET_VARS['pID'])) ? 'button_update.gif' : 'button_save.gif';
echo tep_draw_hidden_field('products_date_added', (tep_not_null($pInfo->products_date_added) ? $pInfo->products_date_added : date('Y-m-d'))) . tep_image_submit($save_button_name, IMAGE_PREVIEW)

 

Find (part of 1 line):

tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $HTTP_GET_VARS['pID'] . '&action=new_product_preview', 'post', 'enctype="multipart/form-data"');

Replace with (a new line and part of 1 line):

 $form_action = (isset($HTTP_GET_VARS['pID'])) ? 'update_product' : 'insert_product';
echo tep_draw_form('new_product', FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '') . '&action='.$form_action, 'post', 'enctype="multipart/form-data"');

 

I just copied the code from below in the new_product_preview action. The above code works perfectly for add and update. It even uses the "Save" button instead of "Update" for the actual add page.

 

Thanks Fred!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...