Butch0071 Posted April 5, 2024 Share Posted April 5, 2024 Hi there, I have a small problem and would appreciate any help. On product edit page (product combination edit page) I have created an extra form - you give there and id and the extra content of product is loaded from external source. That works OK - it loads extra content, however you can not save product changes. You can only load extra data with this form - but when go to 'save product' - it gives error and do not save product data. I think probably the problem is, there are two forms with sumbit. I got it all in a module. I generate the extra form with tpl <form action="{Context::getContext()->link->getModuleLink('productsmanagment', 'default')}" method="post"> <input type="hidden" id="product_ID" name="product_ID" aria-label="product_ID" class="form-control" value="{$product_ID}"> <input type="hidden" id="ID_product_attribute" name="ID_product_attribute" class="form-control" value="{$ID_product_attribute}"> <input type="hidden" id="admin_combination_url" name="product_attribute_url" class="form-control" value="{$url}"> <div class="row form-group"> <label class="form-control-label col-sm-2">ERP ID</label> <div class="col-md-4"> <input type="text" id="combination_erp_id" name="combination_erp_id" aria-label="combination_erp_id input" class="form-control"> </div> <div class="col-md-4"> <input type="submit" id="take_from_ERP" name="take_from_ERP" aria-label="take_from_ERP input" class="btn btn-primary" value="Pobierz"> </div> </div> </form> and my default controller in module is handling the post data and actions (connect to ERP and take data, save them and redirect to Tools::redirectAdmin($url);) My quess is that I suppose to generate the form the different way ? Thank you Link to comment Share on other sites More sharing options...
Nickz Posted April 5, 2024 Share Posted April 5, 2024 3 hours ago, Butch0071 said: - it gives error and do not save product data. publish the error if you need help, otherwise its just a story. Link to comment Share on other sites More sharing options...
Butch0071 Posted April 5, 2024 Author Share Posted April 5, 2024 (edited) It is PrestaShop Error: Nie można zaktualizować ustawień from console: XHRPOST index.php/sell/catalog/products/341?_token=fxxxeetttttteee#tab-step1 returns 500: [HTTP/2 500 349ms] Uncaught SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data in main.bundle.js In server logs I also see now: AH01630: client denied by server configuration... Edited April 5, 2024 by Butch0071 (see edit history) Link to comment Share on other sites More sharing options...
Butch0071 Posted April 5, 2024 Author Share Posted April 5, 2024 Do i need to mody function getFieldShop() in Product.php ? Link to comment Share on other sites More sharing options...
Butch0071 Posted April 8, 2024 Author Share Posted April 8, 2024 Any tips? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now