Results 1 to 15 of 15

Thread: Image upload for customers

  1. #1
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Image upload for customers

    I noticed a feature request was made a while ago for customer uploadable images. I need it for a project. Anyone else who'd like this as well? I'd like to have it receive higher priority. Ticket: http://projects.winanscreative.com/proj ... tickets/64

    In any case; if the ticket is not picked up soon I need to look into this myself. Can anyone give me an idea of how you would implement it (Blair, Fred, Andreas, ...?)

  2. #2
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Image upload for customers

    Take a look at Isotope's config.php file. That should give you hints at creating custom product attributes that can be set as customer defined. You'll need to combine that with a tl_iso_attributes.php DCA file to add the palette.

    That's as much as I can tell you without getting very technical. All depends on how well you know the Contao framework.

  3. #3
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Image upload for customers

    Thanks! I have written several Isotope extensions of which one is in the repository (ideal payment method). So I think I'll manage. How would I handle the uploads, or is the basic code for that in place? If I am correct Isotope adds a custom file uploader that is used for products as well, so I need to figure out how to use that one in the frontend I guess...

  4. #4
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Image upload for customers

    I would not use the Isotope image uploader in this case... Probably just a frontend file upload widget. If I am not mistaken, you can specify a number of things for the widget such as where to store files.

    You would add this to the $GLOBALS['ISO_ATTR'] array and then need to create a palette for it in the tl_iso_attributes DCA. From there you may need to develop a custom Product Type that can handle the file values. That's where I would start!

  5. #5
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Image upload for customers

    I'm currently building the option. I think I'll manage because I had the widget itself in in nearly no time.

    The logic is not quite clear yet. Should I have the image uploaded when adding a product to the cart? In that case I should have some logic for removing the product as well, right? Possibly with a javascript alert to the user... What method where you planning for implementation? There are also websites where you add products to your cart and upload as a part of the checking out. I'm not sure about the best way.

    edit: I've managed the upload. The biggest problem was I mixed up which fields where used for the backend and frontend (for example I added to the dca 'extensions', but that was supposed to be a field in the palette). Now I still need to store the filename that was used to be able to delete the file as well.

    And what happens when sessions are abandoned???

    I'll add my code to the repository, but these issues should be addressed before I can do that.

    Are subpalettes not implemented? I wanted to duplicate the form fields functionality, that requires subpalettes to be the exact same.

  6. #6
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Image upload for customers

    I will add what I have to the extension repository. It allows for file uploads upon adding to the shopping cart. This is not close to an ideal solution because this means abandoned sessions take up server space. This could be solved by removing files when files get removed (the products are in the database) I have not tried to see if they get removed. If so I could save the filename and have the code remove the files (and add an option to allow this behavior) But that is not in.

    Since large files are involved in this case the approach I built today won't suffice. What I think should be done is adjusting the workflow and add a step that is completed AFTER payment as last part of checkout. That step can also be completed at a later time via user order details. So I need to figure out how extra steps are added, I know the system is designed to allow this. Any hints would be appreciated.

    edit:
    For anyone interested; I have added the file upload attribute field as an extension to the repository: http://www.contao.org/extension-list/vi ... pload.html

  7. #7
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Image upload for customers

    Hi Ruud, just curious (i haven't tried Isotope yet), but for what reason would a customer upload a file?

  8. #8
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Image upload for customers

    Custom products. Printing pictures and business designs on canvas, tshirt, banner, sticker, business cards and so on. Quite common actually. But there can be other applications as well (like uploading indesign files to publish a book) or anything else that requires digital files.

  9. #9
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Image upload for customers

    I've got it working now;
    1. Admin can define an upload attribute and can select if the file is uploaded before or after checkout.[/*:m:39fbmz5y]
    2. After checkout a client can go to the order details page that now contains an upload field for each upload attribute[/*:m:39fbmz5y]
    3. Client uploads a file after which the upload option is blocked[/*:m:39fbmz5y]


    I still need to do:
    1. The admin can check the uploaded file and unlock the upload again if errors are found. (or delete, and so on)[/*:m:39fbmz5y]
    2. Store uploads before checkout in the database (because that would be a different table, haven't gotten around that yet)[/*:m:39fbmz5y]
    3. Find a way around large file problem; ftp?[/*:m:39fbmz5y]


    Any input appreciated. Anyone interested in the work I've done?

  10. #10
    User winanscreative's Avatar
    Join Date
    06-21-09.
    Location
    Massachusetts, United States
    Posts
    261

    Default Re: Image upload for customers

    That is awesome, Ruud... I may have a project coming up where this would come in handy, so I will take a peek through your code and see how it works and offer some input. Is the full code in the ER, or can you post it here?

  11. #11
    Experienced user
    Join Date
    01-12-10.
    Posts
    814

    Default Re: Image upload for customers

    Quote Originally Posted by winanscreative
    That is awesome, Ruud... I may have a project coming up where this would come in handy, so I will take a peek through your code and see how it works and offer some input. Is the full code in the ER, or can you post it here?
    I sent you the code, although I have improved on it.

    The next hurdle for me to tackle is adding an administrative interface. I thought of adding a button to each order row (in main.php?do=iso_orders). I got that in through the tl_iso_orders.php file:
    Code:
    $GLOBALS['TL_DCA']['tl_iso_orders']['list']['operations']['uploads'] = array
    (
    	'label'				=> &$GLOBALS['TL_LANG']['tl_iso_orders']['uploads'],
    	'href'				=> 'table=tl_iso_uploads',
    	'icon'				=> 'tablewizard.gif',
    	'button_callback'	=> array('iso_orders_uploads', 'uploadsButton')
    );
    If I have that link point to an key (like uploads) I can use a custom function to generate the contents. But I thought it would be nice to have contao handle it as per normal functionality. But when I add tl_iso_order_uploads.php and add some default dca contents I get an error. I'm not sure what the link should be and what contao parts I have to add to continue from the iso_orders junction....

    edit: I looked through the log and figured out I did not include the table in the backend modules list of tables. After that all went well and I can now do basic administration as well. Given more time I could make it good enough for the repository, right now it has too many holes to fix.

  12. #12

    Default Re: Image upload for customers

    Just to say thankx for your script!!!

  13. #13
    New user
    Join Date
    07-14-12.
    Posts
    1

    Default Re: Image upload for customers

    Hi,
    This doesn't seem to work anymore with contao 2.11.4 and the newest version of isotope. Or is it just me?

  14. #14
    New user
    Join Date
    01-03-12.
    Location
    Essen
    Posts
    2

    Default Re: Image upload for customers

    It‘s not working on 2.11.5 and Isotope 1.3.8.

    I saw there is a new attribute type upload in the 1.4 beta, but I don’t know when it will be published.

    Is there a way to make the extension work in 2.11.4+ again?

  15. #15
    New user
    Join Date
    03-17-15.
    Posts
    1

    Default Please help me on this

    Quote Originally Posted by Ruud View Post
    I've got it working now;
    1. Admin can define an upload attribute and can select if the file is uploaded before or after checkout.[/*:m:39fbmz5y]
    2. After checkout a client can go to the order details page that now contains an upload field for each upload attribute[/*:m:39fbmz5y]
    3. Client uploads a file after which the upload option is blocked[/*:m:39fbmz5y]


    I still need to do:
    1. The admin can check the uploaded file and unlock the upload again if errors are found. (or delete, and so on)[/*:m:39fbmz5y]
    2. Store uploads before checkout in the database (because that would be a different table, haven't gotten around that yet)[/*:m:39fbmz5y]
    3. Find a way around large file problem; ftp?[/*:m:39fbmz5y]


    Any input appreciated. Anyone interested in the work I've done?
    Hello Where can i found the option "uploaded before or after checkout."

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •