Forums / Setting Up Categories, Products, Attributes / Editing a product - Skip the preview, and update immediately

Editing a product - Skip the preview, and update immediately

Views: 3,577

Results 1 to 12 of 12
4 Aug 2008, 9:57 AM
#1
xxdrag0nxx avatar

xxdrag0nxx

New Zenner

Join Date:
May 2008
Posts:
98
Plugin Contributions:
0

Editing a product - Skip the preview, and update immediately

Is this possible?
I have exhausted all means :(

Everytime I edit a product,
I MUST click preview,
and a preview pages shows up with the option to "Back", "Update", Cancel"

can i skip clicking preview, and have the update button on the product editing page instead?

It would save some time espically editing a few products at one go :)

TIA :)

10 Aug 2008, 6:09 PM
#2
xxdrag0nxx avatar

xxdrag0nxx

New Zenner

Join Date:
May 2008
Posts:
98
Plugin Contributions:
0

Re: Editing a product - Skip the preview, and update immediately

Anyone has any idea?

I still havent found a solution :(

21 May 2009, 6:23 AM
#3
xxdrag0nxx avatar

xxdrag0nxx

New Zenner

Join Date:
May 2008
Posts:
98
Plugin Contributions:
0

Re: Editing a product - Skip the preview, and update immediately

many many months have passed :(:frusty:

21 May 2009, 2:30 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Editing a product - Skip the preview, and update immediately

A lot would need to be re-written to make this work ...

When we are re-writting the Admin, we will keep this in mind ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

24 May 2009, 4:28 PM
#5
xxdrag0nxx avatar

xxdrag0nxx

New Zenner

Join Date:
May 2008
Posts:
98
Plugin Contributions:
0

Re: Editing a product - Skip the preview, and update immediately

Oh you mean we just cant create a save button in the edit product page? :(

24 May 2009, 5:02 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Editing a product - Skip the preview, and update immediately

You have to re-write how the image is added to the site for the products_image and then customize the various files that processes the data for the products and that may mean multiple files based on what product types are used ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 May 2009, 3:07 PM
#7
xxdrag0nxx avatar

xxdrag0nxx

New Zenner

Join Date:
May 2008
Posts:
98
Plugin Contributions:
0

Re: Editing a product - Skip the preview, and update immediately

lol in the end i paid someone to write a script to solve the problem :P

Now when I click preview a script runs and it auto saves, save my time :)

8 Feb 2010, 5:46 PM
#8
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Editing a product - Skip the preview, and update immediately

I hope you have had lots of extra time to sell things since May, any chance of sharing/contributing your magic script?:D

regards
Steve

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

4 Aug 2011, 3:20 PM
#9
justlost avatar

justlost

New Zenner

Join Date:
Dec 2008
Posts:
11
Plugin Contributions:
0

Re: Editing a product - Skip the preview, and update immediately

If any one else is still looking for this, this is a quick hack. You'll need javascript to do it but it is quick and simple.

in admin/includes/modules/product/preview_info.php

find the </form> tag towards the end of the file and add this right after it:

<script type="text/javascript">
  // auto submit form
  document.forms['<?php echo $form_action;?>'].submit();
</script>

this will auto submit the preview form for you making the product editing a one step process. Haven't tested it extensibly yet for it works for my current needs.

31 Aug 2011, 2:26 PM
#11
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Editing a product - Skip the preview, and update immediately

Thanks. Easy when you know how!

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

25 Sep 2016, 9:55 PM
#12
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Editing a product - Skip the preview, and update immediately

I updated to this

<[B]script [/B][B]type=[/B][B]"text/javascript"[/B]>
[B]document[/B].[B]forms[/B][[B]'[/B][B]<?php echo [/B]$form_action;[B]?>[/B][B]'[/B]].submit();[I]auto submit form
[/I][B]document[/B].[B]title [/B]= [B]"Preview:" [/B]+ [B]document[/B].[B]title[/B];[I]//prefix title so it shows up in browser Back button/history as distinct to product data entry page
[/I]</[B]script[/B]>

and for belt and braces,
in ADMIN/product.php

case 'new_product_preview':
**if (isset($_POST) && $_POST['master_categories_id'] !='' ) {//steve added next line and clause to prevent empty POST overwriting product info
if (file_exists(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview.php')) {
require(DIR_WS_MODULES . $zc_products->get_handler($product_type) . '/new_product_preview.php');
} **else **{
require(DIR_WS_MODULES . 'new_product_preview.php');
}
**}
**else **{
//steve bof, bail out to categories root
zen_redirect(zen_href_link(FILENAME_CATEGORIES));
}
//eof
break;

Why?
Now and again I would find a product with an empty master_categories id.
https://www.zen-cart.com/showthread.php?221033-products-master_category_id-0

If after editing and saving a product, I did some other admin stuff then used the navigator Back/history button to go back to Edit Product BUT instead went back to the Preview page by mistake, there was no POST info set.
This variable contains all the product info (including its master category) but now it is empty. The page then autosubmits/saves the product with all its fields empty effectively wiping out the product.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...