Question 1: With the name field it works (sample from the doc of the module), but how to reach the description/details field of a product?
Question 2: this code check for the first letters of the first word from a product name, how to check for others words in a name? I know it's a jquery question but if anybody has a tip... ! Thanks !
My code:
Code: Select all
  var ajax_url = '{/literal}{module_action_link module=Products action=ajax_propval urlonly=1 jsfriendly=1}{literal}';
  ajax_url = ajax_url + '&showtemplate=false';
  $('#productname').autocomplete({
    source: function(req,add){
      var tmp =  ajax_url+'&cntnt01field=::name::&cntnt01fieldval='+req.term;
      $.getJSON(tmp,function(json){
        if( json.status == 'OK' && json.data.length > 0) {
          add(json.data);
        }
      })
    }
  });
  $('#productdesc').autocomplete({
    source: function(req,add){
      var tmp =  ajax_url+'&cntnt01field=::[b]description(dont' work...)[/b]::&cntnt01fieldval='+req.term;
      $.getJSON(tmp,function(json){
        if( json.status == 'OK' && json.data.length > 0) {
          add(json.data);
        }
      })
    }
  });


