Try the Demo

Magento Forum

   
Image Uploading on Checkout
 
urfali_diyar
Jr. Member
 
Total Posts:  2
Joined:  2012-10-30
 

Hi,

I’ve got a problem with the image upload module from this blog:
http://www.excellencemagentoblog.com/onepage-checkout-add-file-upload-field-to-any-step

I’m trying to use this module for the ability to upload an image for each item in the checkout.
But the problem is that the jQuery function, that is used for this uploader is only for the first image uploader.
So you can use this uploader for only one item in the checkout.

I don’t know how o modify the code that all items have its own image uploader that functions.

The complete module is attached to the post!

My code in the giftmessage file(inline.phtml):

<ul class="form-list">
              <
li>
                <
label class="required"><em>*</em><?php echo $this->__('Please Upload Your Address Proof: '?><span id='file_upload_text<?php echo $_item->getId() ?>'></span></label>
                <
div class="input-box">
                  <
input id="file_upload<?php echo $_item->getId() ?>" type="file" name="file_upload" />
                </
div>
                <
input id="file_upload_path<?php echo $_item->getId() ?>" type="hidden" name="file_upload_path" class='required-entry'  />
                <
input type="hidden" value='billing_file<?php echo $_item->getId() ?>' name="file_upload_type" class='required-entry'  />
              </
li>
            </
ul>
            <
script type="text/javascript">
// <![CDATA[
jQuery(document).ready(function() {
    jQuery
('#file_upload<?php echo $_item->getId() ?>').uploadify({
    
'uploader'  '<?php echo $this->getSkinUrl('uploadify/uploadify.swf') ?>',
    
'cancelImg' '<?php echo $this->getSkinUrl('uploadify/cancel.png') ?>',
    
'script'    '<?php echo $this->getUrl('file/index/upload') ?>',
    
'auto'       true,
    
'fileDataName' 'file',
    
'fileExt'     '*.jpg;*.gif;*.png',
    
'fileDesc'    'Image Files',
    
'onComplete' : function(eventIDfileObjresponsedata){
        jQuery
('#file_upload_path<?php echo $_item->getId() ?>').val(response);
        
jQuery('#file_upload_text<?php echo $_item->getId() ?>').html('Bild Hochgeladen: '+fileObj.name);
     
}
    
  }
);
});

File Attachments
Checkout File Upload.zip  (File Size: 263KB - Downloads: 5)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top