weixin_33681778 2014-11-14 04:03 采纳率: 0%
浏览 30

来自CMS页面的Prestashop Ajax

I need send data ajax from cms.tpl, but url no works. Display 404.

var formData = { 
    'referencia_producto': $('input[name=reference_product]').val(),
    'tipo_form': $('input[name=tipo_form]').val()
};

$.ajax({
    type: 'POST',
    headers: {"cache-control": "no-cache"},
    url:baseUri+'index.php?id_cms=18&controller=cms',
    data: formData,
    async: true,
    cache: false,
    dataType: 'json',
    success: function (data) {
    }
});

What is the way for implement AJAX from CMS?

Thank You

  • 写回答

1条回答 默认 最新

  • 妄徒之命 2014-11-14 15:43
    关注

    Mh the easiest way to my mind: create module where you could write your JS , CSS , PHP code and hook it to CMS.

    Also, did you try this code in {literal} YOUR CODE {/literal} to use it in TPL File.

    评论

报告相同问题?