Jump to content

Ajouter Au Panier Un Champ Notes Produit

Recommended Posts

bonjour je suis entrain dajouter dans la page product.tpl un champ text saisi par le client 

<inputname="nickname" class="form-control customization_block_input" />

le champ saisie sauvegarder dans le panier.


jai rajouter un code dans la page cartcontroller.php


$authorized_text_fields = array('nickname');
    foreach ($_POST as $field_name => $value)
        if (in_array($field_name, $authorized_text_fields) &&
         $value != '')
            if (!Validate::isMessage($value))
                $this->errors[] = Tools::displayError('Invalid message');
   'nickname', Product::CUSTOMIZE_TEXTFIELD,Tools::getValue('nickname')); 
        else if (in_array($field_name, $authorized_text_fields) 
        && $value == '')
----dans la page ajax-cart.js
var nickname = $('input[name=nickname]').val();
        type: 'POST',
        headers: { "cache-control": "no-cache" },
        url: baseUri + '?rand=' + new Date().getTime(),
        async: true,
        cache: false,
        dataType : "json",        
data: 'controller=cart&add=1&ajax=true&qty=' + ((quantity && quantity != null) ? quantity :'1')+'&id_product=' + idProduct
 +'&nickname='+nickname+ '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + 
parseInt(idCombination): '')});
je veux savoir comment afficher les notes produit dans blockart.tpl




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