Jump to content

Saving an edited product - Does not save changes or show updated message


5ummer5

Recommended Posts

Hi all,

 

I have been going round and round AND ROUND in circles about this issue for a while now and still cannot solve it.  I will be as detailed as I can about the issue.

 

 

Overview

 

I have a multistore install setup with 2 shops

I run prestashop 1.6.1.6

 

 

The issue

 

When editing a product (in either store) it doesn't save the information I just entered when clicking "Save and Stay" OR "Save".  It just reloads the page without the information I just entered.

 

It only manages to save the information every so often, intermittently, there doesn't seem to be a pattern, it just saves when it wants to.  As you can imagine this make maintaining the store with over 2k products almost an impossible task as it take a whole day to update only a few products because of the constant re-entry needed.

 

 

Other info

 

All caches, on prestashop and on the server are disabled.  There is nothing in the prestashop log.  There is nothing in the servers error log.  I have tried using several browsers on 3 machines in 2 locations to see if it a client side issue, it isnt.

 

 

I really hope that someone has come across this issue and has been able to resolve it as I am starting to pull my hair out.

 

Thank you in advance to anyone that can help with this issue!

 

  • Like 1
Link to comment
Share on other sites

Thanks for the quick reply.  I have just tried Safari and it seems to be ok 10 times in a row!  I tested with chrome & firefox last week and was having the issues in both so I ruled out that it was a browser issue!  Bloody typical it seems to work ok with Safari.

 

Thank you very much for your help!

Edited by 5ummer5 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

I had the same issue, some changes were saving (Enabled, product code) and almost everything else not. A few items of note for the devs.

 

- Error occurred in both Chrome and Edge but went away with Firefox Dev Edition

- Turning on Debug mode in config\defines.inc.php took away the problem in Chrome but not a long term solution

- Cleared cache, force compile themes, didn't help

 

So for now, using Firefox Dev Edition

Link to comment
Share on other sites

  • 1 month later...

Posting my temp unworkable solution here as well:

 

I downloaded a contained version of Chromium - Version 30.0.1556.0 (210028)

 

http://commondatasto...Win_x64/210028/

 

downloaded and extracted the zip package 

https://www.googleap...86000&alt=media

 

using it as a standalone browser - no install

Prestashop Back Office Product save and update seems to work with this 2013 version

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...

Hi, yes, chrome in some versions doesn't send fields 'submitAddproduct'  and 'submitAddproductAndStay' in http post request. So i added lines to /js/admin/products.js at the end of $(document).ready() :

$(document).on('click','button[name="submitAddproduct"]',function(e) {
        e.preventDefault();
        $('form#product_form').append('<input type="hidden" name="submitAddproduct" value="1" />');
        $('form#product_form').submit();

    });

    $(document).on('click','button[name="submitAddproductAndStay"]',function(e) {
        e.preventDefault();
        $('form#product_form').append('<input type="hidden" name="submitAddproductAndStay" value="1" />');
        $('form#product_form').submit();
    });

hope it will help somebody

 

edit: i dont know, but maybe, chrome have problems with fact, that element with name 'submitAddproduct' is actually multiple times in that product form and does not have a value 

Edited by daveyrow (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

Hi, yes, chrome in some versions doesn't send fields 'submitAddproduct'  and 'submitAddproductAndStay' in http post request. So i added lines to /js/admin/products.js at the end of $(document).ready() :

$(document).on('click','button[name="submitAddproduct"]',function(e) {
        e.preventDefault();
        $('form#product_form').append('<input type="hidden" name="submitAddproduct" value="1" />');
        $('form#product_form').submit();

    });

    $(document).on('click','button[name="submitAddproductAndStay"]',function(e) {
        e.preventDefault();
        $('form#product_form').append('<input type="hidden" name="submitAddproductAndStay" value="1" />');
        $('form#product_form').submit();
    });

Hi daveyrow

 

Can you show me the code after yours is inserted - I'm not exactly sure where to place it .... Thanks so much!

Link to comment
Share on other sites

Hi daveyrow

 

Can you show me the code after yours is inserted - I'm not exactly sure where to place it .... Thanks so much!

 

Hi , the file is located in /js/admin/products.js

 

the end of file with added code looks like this this:

 

please dont forget to ctrl+f5 the admin product page or remove browser cache to reload the loaded js file and report if trouble is gone thx)

var tabs_manager = new ProductTabsManager();
tabs_manager.setTabs(product_tabs);

$(document).ready(function() {
	// The manager schedules the onReady() methods of each tab to be called when the tab is loaded
	tabs_manager.init();
	updateCurrentText();
	$("#name_" + id_lang_default + ",#link_rewrite_" + id_lang_default)
		.on("change", function(e) {
			$(this).trigger("handleSaveButtons");
		});
	// bind that custom event
	$("#name_" + id_lang_default + ",#link_rewrite_" + id_lang_default)
		.on("handleSaveButtons", function(e) {
			handleSaveButtons()
		});

	// Pressing enter in an input field should not submit the form
	$('#product_form').delegate('input', 'keypress', function(e) {
			var code = null;
		code = (e.keyCode ? e.keyCode : e.which);
		return (code == 13) ? false : true;
	});

	$('#product_form').submit(function(e) {
		$('#selectedCarriers option').attr('selected', 'selected');
		$('#selectAttachment1 option').attr('selected', 'selected');
		return true;
	});

    $(document).on('click','button[name="submitAddproduct"]',function(e) {
        e.preventDefault();
        $('form#product_form').append('<input type="hidden" name="submitAddproduct" value="1" />');
        $('form#product_form').submit();

    });

    $(document).on('click','button[name="submitAddproductAndStay"]',function(e) {
        e.preventDefault();
        $('form#product_form').append('<input type="hidden" name="submitAddproductAndStay" value="1" />');
        $('form#product_form').submit();
    });
});
Edited by daveyrow (see edit history)
Link to comment
Share on other sites

  • 10 months later...
  • 1 year later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...