Jump to content

extra form on product edit page to load data from external source - Presta 8.0.1


Recommended Posts

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

It is PrestaShop Error: Nie można zaktualizować ustawień

obraz.png.f11eb2f7e36e5495d336a14e376aa9f2.png

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 by Butch0071 (see edit history)
Link to comment
Share on other sites

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...