Jump to content

Cher

Members
  • Posts

    4
  • Joined

  • Last visited

Profile Information

  • First Name
    Cher
  • Last Name
    A

Cher's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I solved it myself, you need to call save customisations submit from core.js line 1836 in ps1.7.1.0 $body.on('click', '[data-button-action="add-to-cart"]', function (event) { add if( $('#customizationForm').length > 0 ) { var customAction = $('#customizationForm').attr('action'); $('body select[id^="group_"]').each(function() { customAction = customAction.replace(new RegExp(this.id + '=\\d+'), this.id +'=' + this.value); }); // ajax to product page with custom action var customization_entries = $('#customizationForm').serialize(); console.log(customization_entries); $.ajax({ async:false, type: 'POST', data: customization_entries+ '&ajax=1', dataType: 'json', url: customAction, success: function(data){ if(typeof(data.errors) !== 'undefined') { alert('Error while saving customization data'); return; } alert(data); }, error : function(resultat, statut, erreur){ //"errors..."; }, complete: function(resultat, statut){ //important. update customization_id $('#product_customization_id').val( resultat.responseText ); } }) }
  2. Hello I'm using Prestashop 1.7.0.6, fresh install. If i add some custom fields on the product Options tab. it works fine. the custom fields are added to DB table "ps_customization_field" with an id=1 and id=2 ...etc. The problem is. if you push save button again and again without any change on the product properties... or for example to save other change on the product tabs... THE IDs of the customisation are updated to id=3, id=4...etc. on the "ps_customization_field". can some one here let me know why prestashop change IDs of customisations ?? that my problem coz the module i'm making add a new table with id_customization_field as table key... if this ids are changed without notice, my module can't see the change... Thanks in advance for any help on this problem. PS. on the Beta version of prestashop, this problem do not exist. but for production i can't use beta.
  3. Hello, I have same issue with Tools::getValue(), it always give back NULL. in my case i call it from hookActionProductUpdate(), where i have extra text field on BO displayAdminProductsExtra.tpl
  4. Hello, I have a question about how to make a call to "submitCustomizedData", its inthe Save Customization button on the product page. in fact, i wish to save submitCustomizedData in one step when user click on the "add-to-cart" button. Please help
×
×
  • Create New...