Jump to content

Change position of customizable content


Recommended Posts

Per product you can specify customizable content (let users upload images, or give certain text)
I use this alot for my site, but i don't like the position of this, when i change this in product.tpl in my theme, it will change but it will lose it's functionality (it doesnt save the customizable content anymore)

Is there something I also need to change (like a piece of javascript somewhere that needs to be changed of place as well) I cannot find it out.

Please help.

Link to comment
Share on other sites

http://www.goedhuysverf.nl/webshop11/product.php?id_product=68

is an example

>
<!-- 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}" value="" class="customization_block_input" />{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



Is the piece of code I change the position of in product.tpl bij just copy and paste the code in the place where I want it to appear. But then saving the customization doesn't work. If I place it back to it's original location then the saving of the customization works again. To save this customization it calls a script saveCustomization() -- this happens onClick but nothing happens.

Ah i think i have found it......

I tried to put it inside another piece of the product.tpl code (Just below the price where I want it) in which it doesnt work, now if i place it somewhere else it works, but i'm gonna have to style it a little bit more, and then it is to my satisfaction.

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