Results 1 to 10 of 31

Threaded View

  1. #19
    Join Date
    Sep 2006
    Location
    Gillette, NJ, USA
    Posts
    35
    Plugin Contributions
    0

    Default Re: Attribute File Upload

    Continuing on the bad practice described above - I have changed the .htaccess file to allow access to the uploaded images from IP address of the store owner - and created a link on the edit order page to view the file. To do this on your site:
    (using 1.3.5)
    change line 401 of admin/orders.php FROM:
    Code:
              echo '<br /><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);
    TO:
    Code:
    //          echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);
    		echo '<br><nobr><small>&nbsp;<i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ';
    		if ($order->products[$i]['attributes'][$j]['option'] == "Logo 1" || $order->products[$i]['attributes'][$j]['option'] == "Logo 2" || $order->products[$i]['attributes'][$j]['option'] == "Logo 3" || $order->products[$i]['attributes'][$j]['option'] == "Logo 4" || $order->products[$i]['attributes'][$j]['option'] == "Logo 5") {
    		$full_logo_name  = $order->products[$i]['attributes'][$j]['value'];
    $pieces = explode(".", $full_logo_name);
    		echo nl2br($order->products[$i]['attributes'][$j]['value']) . ' <a href="/images/uploads/' . $pieces[0] . '.' . $pieces[2] . '" target="_blank">View ' . $pieces[0] . '.' . $pieces[2] . '</a>';
    		} else {
    		echo nl2br($order->products[$i]['attributes'][$j]['value']);
    		}
    Which results in something like this:
    Logo 1: 4. joomla_logo_black.jpg View 4.jpg

    The above only works because the Option Name for uploaded images is "Logo 1" through "Logo 5". If the Option Name for your uploaded file is different, then change those names. It will also fail if there is more than one "." in a filename - but I'm not sure Zen-Cart would allow it to be uploaded.

    It currently works on my site, but no guarantees. Hope this helps some people - its not a full uploaded file editor, but it will allow unskilled store admins to at least see the uploaded files referenced without typing a bunch of stuff.
    Last edited by boylan; 6 Nov 2006 at 08:45 AM.

 

 

Similar Threads

  1. Thumbnail Preview of file after upload via Attribute File uploader?
    By NWFAP in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 7 Aug 2015, 03:40 AM
  2. v139h uploading artwork file (attribute) does not upload file
    By delia in forum General Questions
    Replies: 11
    Last Post: 1 Sep 2013, 08:41 PM
  3. File Upload Attribute - File Size Limit?
    By Genevieve in forum General Questions
    Replies: 2
    Last Post: 4 May 2010, 06:33 PM
  4. Attribute Upload File
    By leilanddale in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 26 Feb 2010, 06:39 PM

Posting Permissions

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