Jump to content

[SOLVED]Customized text/combination for products


Recommended Posts

Is there a module or something that allows the customer to add a specified text to the product before he ads it in the cart?

I mean, I have thousands of combinations and it would be lot more simple that the client specifies exactly what he wants instead of choosing from a long list of drop down combinations.

Link to comment
Share on other sites

If you want to just use a text box, check out the customization tab in the product editor.

If you want to use a text area, or attach a price impact to it (if the customer uses that field), check out my Attribute Wizard Pro module on my site (address is in my signature)

Link to comment
Share on other sites

In /themes/prestashop/product.tpl move

>
<!-- Customizable products -->
{if $product->customizable}
</pre>
<ul>
{l s='Product customization'}
</ul>
<br><div>
       <form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm">



               {l s='After saving your customized product, do not forget to add it to your cart.'}
               {if $product->uploadable_files}
{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}

           {if $product->uploadable_files|intval}
{l s='Pictures'}

               {counter start=0 assign='customizationField'}
               {foreach from=$customizationFields item='field' name='customizationFields'}
                   {if $field.type == 0}
{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
                           {if isset($pictures.$key)}getUrlWith('deletePicture', $field.id_customization_field)}">{/if}
<input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />{if $field.required}*{/if}
{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}

                       {counter}
                   {/if}
               {/foreach}

           {/if}

           {if $product->text_fields|intval}
{l s='Texts'}

               {counter start=0 assign='customizationField'}
               {foreach from=$customizationFields item='field' name='customizationFields'}
                   {if $field.type == 1}
{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
                           {if !empty($field.name)}{$field.name}{/if}<input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" class="customization_block_input" />{if $field.required}*{/if}

                       {counter}
                   {/if}
               {/foreach}

           {/if}


               <input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
               <input type="hidden" name="submitCustomizedDatas" value="1" />
               <input type="button" class="button" value="{l s='Save'}">

       </form>

* {l s='required fields'}
</div>
<br>{/if



from the bottom of the file to another place like under the attributes

Link to comment
Share on other sites

  • 3 weeks later...
  • 1 month later...
In /themes/prestashop/product.tpl move
>
<!-- Customizable products -->
{if $product->customizable}
</pre>
<ul>
{l s='Product customization'}
</ul>
<br><div>
       <form method="post" action="{$customizationFormTarget}" enctype="multipart/form-data" id="customizationForm">



               {l s='After saving your customized product, do not forget to add it to your cart.'}
               {if $product->uploadable_files}
{l s='Allowed file formats are: GIF, JPG, PNG'}{/if}

           {if $product->uploadable_files|intval}
{l s='Pictures'}

               {counter start=0 assign='customizationField'}
               {foreach from=$customizationFields item='field' name='customizationFields'}
                   {if $field.type == 0}
{assign var='key' value='pictures_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
                           {if isset($pictures.$key)}getUrlWith('deletePicture', $field.id_customization_field)}">{/if}
<input type="file" name="file{$field.id_customization_field}" id="img{$customizationField}" class="customization_block_input {if isset($pictures.$key)}filled{/if}" />{if $field.required}*{/if}
{if !empty($field.name)}{$field.name}{else}{l s='Please select an image file from your hard drive'}{/if}

                       {counter}
                   {/if}
               {/foreach}

           {/if}

           {if $product->text_fields|intval}
{l s='Texts'}

               {counter start=0 assign='customizationField'}
               {foreach from=$customizationFields item='field' name='customizationFields'}
                   {if $field.type == 1}
{assign var='key' value='textFields_'|cat:$product->id|cat:'_'|cat:$field.id_customization_field}
                           {if !empty($field.name)}{$field.name}{/if}<input type="text" name="textField{$field.id_customization_field}" id="textField{$customizationField}" value="{if isset($textFields.$key)}{$textFields.$key|stripslashes}{/if}" class="customization_block_input" />{if $field.required}*{/if}

                       {counter}
                   {/if}
               {/foreach}

           {/if}


               <input type="hidden" name="quantityBackup" id="quantityBackup" value="" />
               <input type="hidden" name="submitCustomizedDatas" value="1" />
               <input type="button" class="button" value="{l s='Save'}">

       </form>

* {l s='required fields'}
</div>
<br>{/if



from the bottom of the file to another place like under the attributes


Product.tpl move meaning of original product.tpl rename.. or deleted?
Link to comment
Share on other sites

  • 7 months later...
  • 1 year later...
  • 1 year later...

You need to rebuild the core of prestashop for this, because in default PS is looking for FORM element on the page, where are two form element inside each other (probably).

 

I'm developing something around this and I've done it.

 

The changes are many in 3 or more files (.js, .tpl, .php)

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...

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