Guest Posted November 25, 2004 Posted November 25, 2004 Problem: want to be able to change the product image when selecting an option from the drop down box. Status: the images change...but the names are the actual product attribute filenames...ie 1.jpeg, 2.jpeg and so on...the images change though! What needs to be done: [need help on] 1. pass some other identifier to the function so that I can name the pictures unique for each product 2. get the "Add to basket" button working. it seems to have died Resources: 1. I have been using this site extensively: http://www.oscdox.com/crossx/nav.html?_functions/index.html 2. Previous posts: http://www.oscommerce.com/forums/index.php?showtopic=122735 Code: product_info.php head: <script LANGUAGE="JavaScript"> function JumpTo(theMenu){ var theDestination = theMenu.options[theMenu.selectedIndex].value; document.mypic.src=('/catalog/images/' + theDestination + '.jpeg') } </SCRIPT> body: replace this line: <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td> with these lines: <td class="main"> <FORM METHOD="POST" ACTION=""> <select name="JUMP" onChange="JumpTo(this)"> <option value="<?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?> </select> </FORM> any help or tips would greatly be appreciated from the community! thank you, RobertG... <{POST_SNAPBACK}>
Guest Posted November 26, 2004 Posted November 26, 2004 Robert, It seems you need a different file naming convention. Something like p-a.jpg where p is the product code and a is the attribute code. You already have a solved. p should be easily available as the product number is known to display the product. ed
Guest Posted November 29, 2004 Posted November 29, 2004 Robert, It seems you need a different file naming convention. Something like p-a.jpg where p is the product code and a is the attribute code. You already have a solved. p should be easily available as the product number is known to display the product. ed <{POST_SNAPBACK}> Thats the problem, I am not sure how to pass the product ID to the Javascript function that handles the image change. I need serious PHP and Javascript help to solve this. thank you, RobertG...
Guest Posted December 2, 2004 Posted December 2, 2004 Can anyone help me on the code for this. I am not sure how to pass the correct variables. Thank you, RobertG...
Guest Posted December 2, 2004 Posted December 2, 2004 Robert, I've been mulling this over for the last day or 2. Can you PM me your current version of the code (the whole file)? I'd like to work on it tonight. ed
Guest Posted December 5, 2004 Posted December 5, 2004 Robert, I've been mulling this over for the last day or 2. Can you PM me your current version of the code (the whole file)? I'd like to work on it tonight. ed <{POST_SNAPBACK}> I sent you a PM with the product_info.php code in it. I just copied and pasted. Thank you for your help on this. I am thinking of making this a contribution once it is working. Thank you, RobertG...
Guest Posted December 9, 2004 Posted December 9, 2004 Are there any experts out there that can save me?
diva_uno Posted January 29, 2005 Posted January 29, 2005 Are there any experts out there that can save me? <{POST_SNAPBACK}> I wish people on this board were more responsive. When I first started using OSC I would really get fustrated with this board. But now I understand that people do this for money. Anything that can be added to this already excellent (and free) script is most appreciated. It would have been great if this could have been a contribution. I really needed something like this. Wish I understood PHP more. I gave up on all the multi - image contributions and decided just to use animated gifs...Now aint that something!?! :rolleyes:
Recommended Posts
Archived
This topic is now archived and is closed to further replies.