Jump to content

Benutzeranpassung Anpassen


Recommended Posts

Hallo,

 

Ich suche ein Modul wie dieses:

http://addons.prestashop.com/en/20201-additional-product-attributes-custom-product-fields.html

Die Demo ist mir zu buggy, daher kommt es nicht in Frage (Cart-Button läd ewig, keine Weiterleitung), außerdem etwas zu teuer.

 

Möglich wäre auch ein Tutorial wenn jemand eins kennt, um eigene Textfelder und Textarea ect. in die pb-right-column zu bringen.

 

Für die Standardfelder müsste ich den Pfad ändern, wenn ich diese in den Block setze - zumindest geht es nicht einfach den Block <!--Customization --> in den  <!-- pb-right-column--> zu schieben (speichert dann nicht mehr ab), kenne mich mit php aber nicht gut aus, also keine ahnung...

 

also entweder ein modul (keine 60 euro mit fehlern) oder ein tutorial (am besten auf deutsch :-P)

 

Danke :wub:

Edited by Baynomia (see edit history)
Link to comment
Share on other sites

Ich habe Folgendes Gefunden und benötige aber Hilfe:

 

 

in

add : function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist)

you can add your input for example

var nickname = $('input[name=nickname]').val();

and send the value in the ajax call

$.ajax({
        type: 'POST',
        headers: { "cache-control": "no-cache" },
        url: baseUri + '?rand=' + new Date().getTime(),
        async: true,
        cache: false,
        dataType : "json",
/*************** added by TAREK ******************************/         
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): ''),
/*************** added by TAREK ******************************/    

in cartController.php (override), in processChangeProductInCart function, after if (!$this->errors && $mode == 'add')

you should the code that add the customized data value in the database

$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');
            else{
                //var_dump($field_name);exit();


$this->context->cart->deleteCustomizationToProduct((int)$this->id_product,
 'nickname');
$this->context->cart->addTextFieldToProduct($this->id_product, 
   'nickname', Product::CUSTOMIZE_TEXTFIELD,Tools::getValue('nickname')); 

                }
        }
        else if (in_array($field_name, $authorized_text_fields) 
        && $value == '')
$this->context->cart->deleteCustomizationToProduct((int)$this->id_product,

'nickname');

<<<<<<<<<<<<<<<<<<< SO >>>>>>>>>>>>>>>>>>>>>>>

 

Nur verstehe ich nicht, wie und wo mein feld dann erscheinen soll. :-)

 

 

Wo muss denn dieser Ajax Call genau hin????? Ich habe den jetzt unter ( var nickname = $('input[name=nickname]').val(); ) kopiert, also in die ajax-cart.js? hmmm

$.ajax({
        type: 'POST',
        headers: { "cache-control": "no-cache" },
        url: baseUri + '?rand=' + new Date().getTime(),
        async: true,
        cache: false,
        dataType : "json",
/*************** added by TAREK ******************************/         
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): ''),
/*************** added by TAREK ******************************/         
Edited by Baynomia (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...