My site makes custom printed products with the customers images. We use the File Upload Attribute for them to upload their images along with the order.
I've been toying with this for a while, however I don't really have any coding skills... just researching and borrowing code... but syntax... don't know it.
Anyway, originally I thought of the elaborate pop up progress upload meter... then i thought, K.I.S.S. So I thought it would be much simpler to just have the Add to Cart icon change to an animated gif indicating 'Uploading Photos' when clicked.
I created the gif, and researched the jscript code and found this:
PHP Code:
<script type="text/javascript">
function changeImage(a) {
document.getElementById("img").src=a;
}
</script>
<div id="main_img">
<img id="img" src="sourceimage.gif" onclick='changeImage("changetoimage.gif");'>
</div>
So, I created a test page to see if it would work: http://photoballoons.co/cart/test.php. It did!
Now, how do I incorporate that into tpl_product_info_display.php? This is where I run into the problem because I don't know coding that well... especially mixing PHP & HTML. I tried borrowing syntax and conventions by studying the PHP files and how the code is mixed, but can't figure it out. This is what I came up with:
Around line 170 in /includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_display.php you have this:
PHP Code:
<div id="cartAdd">
<?php
echo $display_qty;
echo $display_button;
?>
</div>
which I attempted to change to this:
PHP Code:
<div id="cartAdd">
<?php
echo $display_qty;
echo '<img id="img" src="' . $display_button; . '" onclick='changeImage("images/button_uploading_photos.gif");'>'?>
</div>
with no luck. All I get is a blank product info page. I've tried many variances on it, but no luck.
Anybody have any clues? I'm sure this would be very useful to many people.
Thanks in advance.
Bookmarks