Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 62
  1. #11
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    Ok I have the images working in IE now (yay!), but not Firefox still. Here's my code for my PROD_50:

    Code:
    <style type="text/css">
    #attrib-9 {display: none;};
    </style>
    
    <table border="0" cellspacing="0" cellpadding="0" width="300">
    <tr><td width="250">
    
    <select name="picture1" size="1" onChange="showimage1()">
    <option selected value="37">Amethyst</option>
    <option value="45">Azurite</option>
    <option value="48">Black Onyx</option>
    <option value="47">Blue Goldstone</option>
    <option value="44">Blue Onyx</option>
    <option value="36">Coral</option>
    <option value="34">Crystal</option>
    <option value="38">Garnet</option>
    <option value="29">Goldstone</option>
    <option value="41">Green Onyx</option>
    <option value="49">Hematite</option>
    <option value="39">Jade</option>
    <option value="46">Lapis</option>
    <option value="31">Leopard Jasper</option>
    <option value="40">Malachite</option>
    <option value="35">Red Fossil</option>
    <option value="32">Rhodonite</option>
    <option value="33">Rose Quartz</option>
    <option value="50">Snowflake</option>
    <option value="43">Syn. Opal</option>
    <option value="28">Syn. Pearl</option>
    <option value="30">Tiger Eye</option>
    <option value="42">Turquoise</option>
    
    </select>
    
    </td>
    <td width="50">
    <align="center"><img src="includes/templates/beige/images/PROD_50/37" name="pictures1">
    </td></tr></table>
    
    <style type="text/css">
    #attrib-10 {display: none;};
    </style>
    
    <table border="0" cellspacing="0" cellpadding="0" width="300">
    <tr><td width="250">
    
    <select name="picture2" size="1" onChange="showimage2()">
    <option selected value="37">Amethyst</option>
    <option value="45">Azurite</option>
    <option value="48">Black Onyx</option>
    <option value="47">Blue Goldstone</option>
    <option value="44">Blue Onyx</option>
    <option value="36">Coral</option>
    <option value="34">Crystal</option>
    <option value="38">Garnet</option>
    <option value="29">Goldstone</option>
    <option value="41">Green Onyx</option>
    <option value="49">Hematite</option>
    <option value="39">Jade</option>
    <option value="46">Lapis</option>
    <option value="31">Leopard Jasper</option>
    <option value="40">Malachite</option>
    <option value="35">Red Fossil</option>
    <option value="32">Rhodonite</option>
    <option value="33">Rose Quartz</option>
    <option value="50">Snowflake</option>
    <option value="43">Syn. Opal</option>
    <option value="28">Syn. Pearl</option>
    <option value="30">Tiger Eye</option>
    <option value="42">Turquoise</option>
    
    </select>
    
    </td>
    <td width="50">
    <align="center"><img src="includes/templates/beige/images/PROD_50/37 " name="pictures2">
    </td></tr></table>
    
    <style type="text/css">
    #attrib-11 {display: none;};
    </style>
    <table border="0" cellspacing="0" cellpadding="0" width="300">
    <tr><td width="250">
    
    <select name="picture3" size="1" onChange="showimage3()">
    <option selected value="37">Amethyst</option>
    <option value="45">Azurite</option>
    <option value="48">Black Onyx</option>
    <option value="47">Blue Goldstone</option>
    <option value="44">Blue Onyx</option>
    <option value="36">Coral</option>
    <option value="34">Crystal</option>
    <option value="38">Garnet</option>
    <option value="29">Goldstone</option>
    <option value="41">Green Onyx</option>
    <option value="49">Hematite</option>
    <option value="39">Jade</option>
    <option value="46">Lapis</option>
    <option value="31">Leopard Jasper</option>
    <option value="40">Malachite</option>
    <option value="35">Red Fossil</option>
    <option value="32">Rhodonite</option>
    <option value="33">Rose Quartz</option>
    <option value="50">Snowflake</option>
    <option value="43">Syn. Opal</option>
    <option value="28">Syn. Pearl</option>
    <option value="30">Tiger Eye</option>
    <option value="42">Turquoise</option>
    
    </select>
    
    </td>
    <td width="50">
    <align="center"><img src="includes/templates/beige/images/PROD_50/37 " name="pictures3">
    </td></tr></table>
    
    <script type="text/javascript">
    function showimage1()
    {
    if (!document.images)
    return
    document.getElementById("attrib-9").value = cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value;
    <!--change the src to where you have the pictures stored for the download -->
    document.images.pictures1.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value
    }
    </script>
    
    <script type="text/javascript">
    function showimage2()
    {
    if (!document.images)
    return
    document.getElementById("attrib-10").value = cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value;
    <!--change the src to where you have the pictures stored for the download -->
    document.images.pictures2.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value
    }
    </script>
    
    <script type="text/javascript">
    function showimage3()
    {
    if (!document.images)
    return
    document.getElementById("attrib-11").value = cart_quantity.picture3.options[document.cart_quantity.picture3.selectedIndex].value;
    <!--change the src to where you have the pictures stored for the download -->
    document.images.pictures3.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture3.options[document.cart_quantity.picture3.selectedIndex].value
    }
    </script>
    The only thing is, all three drop-down menus are being treated as part of the same attribute, Bead 1. On the page, they are all lined up under the one lable, and if I make some selections and go to my cart, only the first bead shows up. I'm sure it has something to do with the code in tpl_modules_attributes.php, but I don't know how to modify it to recognize three separate drop-down attributes. Here's what that part of the code looks like:

    Code:
    <!--bof DROP DOWN SELECT -->
    <?php
    if ($i == 1) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50.php';
    }
    }
    ?>
    
    <!--eof END OF DROP DOWN SELECT -->
    Here's another link to the page: click.
    Thanks to everyone for helping me out with this! The fact that I've got it this far is a miracle in my mind. :)

  2. #12
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    Ok if I use this code for the tpl_modules_attributes.php page, I get the drop-down menus to line up with their respective labels, but the images disappear:

    Code:
    <!--bof DROP DOWN SELECT -->
    <?php
    
    if ($i == 1) {
    if ($i == 2) {
    if ($i == 3) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50.php';/
    }
    }
    }
    }
    ?>
    
    <!--eof END OF DROP DOWN SELECT -->
    On the plus side, the selections are carried over to the cart now. :)

  3. #13
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    Ok this should be some of the tweaks:

    Take the javascript code and put it in your JScript_showimage.js file This would put the function in the header field which I think is what FireFox needs. Currently you have in the body. Also try moving this line

    document.getElementById("attrib-9").value = cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value;

    To after this line

    document.cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value


    On the tpl_modules_attributes.php I think you'll need to code it like this:

    <php
    if ($i == 1) {

    if (($_GET['products_id']) == 50) {
    include 'PROD_50_1.php';
    }
    }

    if ($i == 2) {

    if (($_GET['products_id']) == 50) {
    include 'PROD_50_2.php';
    }
    }

    if ($i == 1) {

    if (($_GET['products_id']) == 50) {
    include 'PROD_50_3.php';
    }
    }

    ?>

    So basically create a separate PHP file for each of the Beads. If you cant get it to work I'll put my test server on line and provide the link so you can see how it is coded

  4. #14
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    Oh CREEPUR, I can't thank you enough for all your hard work! Here's what I have for the jscript_showimage.js file:
    Code:
    function showimage()
    {
    if (!document.images)
    return
    
    document.images.pictures1.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value
    document.getElementById("attrib-9").value =document.cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value;
    
    document.images.pictures2.src="includes/templates/ beige/images/PROD_50/"+
    document.cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value
    document.getElementById("attrib-10").value =document.cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value;
    
    document.images.pictures3.src="includes/templates/ beige/images/PROD_50/"+
    document.cart_quantity.picture3.options[document.cart_quantity.picture3.selectedIndex].value
    document.getElementById("attrib-11").value =document.cart_quantity.picture3.options[document.cart_quantity.picture3.selectedIndex].value;
    
    }
    Here's what my PROD_50_1 php file looks like:
    Code:
    <style type="text/css">
    #attrib-9 {display: none;};
    </style>
    
    <table border="0" cellspacing="0" cellpadding="0" width="300">
    <tr><td width="250">
    
    <select name="picture1" size="1" onChange="showimage1()">
    <option selected value="37">Amethyst</option>
    <option value="45">Azurite</option>
    <option value="48">Black Onyx</option>
    <option value="47">Blue Goldstone</option>
    <option value="44">Blue Onyx</option>
    <option value="36">Coral</option>
    <option value="34">Crystal</option>
    <option value="38">Garnet</option>
    <option value="29">Goldstone</option>
    <option value="41">Green Onyx</option>
    <option value="49">Hematite</option>
    <option value="39">Jade</option>
    <option value="46">Lapis</option>
    <option value="31">Leopard Jasper</option>
    <option value="40">Malachite</option>
    <option value="35">Red Fossil</option>
    <option value="32">Rhodonite</option>
    <option value="33">Rose Quartz</option>
    <option value="50">Snowflake</option>
    <option value="43">Syn. Opal</option>
    <option value="28">Syn. Pearl</option>
    <option value="30">Tiger Eye</option>
    <option value="42">Turquoise</option>
    
    </select>
    The others are the same but changed to match their corresponding attribute.

    And here's my tpl_modules_attributes.php:
    Code:
    <php
    if ($i == 1) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50_1.php';
    }
    }
    
    if ($i == 2) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50_2.php';
    }
    }
    
    if ($i == 1) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50_3.php';
    }
    }
    But alas, my images still don't show up on the page in either IE or Firefox. Seems like it should work to me. Anyway, I'm going home for the day and will be back tomorrow. Hopefully by the end of the day I'll have it working. :)

  5. #15
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    Ok since you are using showimage1(), showimage2(), showimage3() in your PHP file which makes since then your jscript_showimage.js file should look like this

    Code:
    function showimage1()
    {
    if (!document.images)
    return
    document.images.pictures1.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value
    document.getElementById("attrib-9").value =document.cart_quantity.picture1.options[document.cart_quantity.picture1.selectedIndex].value;
    }
    
    function showimage2()
    {
    if (!document.images)
    return
    document.images.pictures2.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value
    document.getElementById("attrib-10").value =document.cart_quantity.picture2.options[document.cart_quantity.picture2.selectedIndex].value;
    }
    
    function showimage3()
    {
    if (!document.images)
    return
    document.images.pictures3.src="includes/templates/beige/images/PROD_50/"+
    document.cart_quantity.picture3.options[document.cart_quantity.picture3.selectedIndex].value
    document.getElementById("attrib-11").value =document.cart_quantity.picture3.options[document.cart_quantity.picture3.selectedIndex].value;
    }
    You are missing the following after the </select> At the end of the PROD_50_1 php. This is the line that displays the picture.

    </td>
    <td width="253">
    <align="center"><img src="includes/templates/beige/images/PROD_50/37" name="pictures1">
    </table>

    And in the tpl_modules_attributes.php you have the last if statment like this

    if ($i == 1)
    and probably should be

    if ($i == 3)

    I think its getting close to working

  6. #16
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    lol...I need to proof-read my posts a little better; I had the end of the PROD_50_1 php in the file, I just didn't get it copied into my post.
    I did the other things you gave me but it's not working yet. I will keep working on it today and see what I can come up with. I guess I don't understand why it worked before when it was being treated as one attribute, and now it doesn't. Oh well. I'd be bored without a challenge.

  7. #17
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    I viewed your source code from your latest link. It actually has the PHP code from the tpl_modules_attributes.php that suppose call the PROD_50_1.php So actually the PROD_50_1.php is not loading at all. Suggest to double check the tpl_modules_attributes.php

  8. #18
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    Ok well I found one of my problems; I needed a question mark at the beginning of the tpl_modules_attributes.php code. I had this:
    Code:
    <php
    if ($i == 1) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50_1.php';
    }
    }
    ...etc.
    and now I have this:
    Code:
    <?php
    if ($i == 1) {
    
    if (($_GET['products_id']) == 50) {
    include 'PROD_50_1.php';
    }
    }
    Now the beads show up in both IE and Firefox! The only thing is now, only the first bead selection is passed on to the cart. And I'm not sure why if I view the source it's still messed up. But we're definitely making progress...

  9. #19
    Join Date
    Jul 2008
    Location
    PA
    Posts
    23
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    This get passed in the Jscript_showimage.js file. Suggest start there and make sure everything looks like bead 1 since that one is working.

  10. #20
    Join Date
    Jul 2007
    Location
    Washington, MO
    Posts
    50
    Plugin Contributions
    0

    Default Re: Dynamic DropDown with Image

    I checked the jscript_showimage.js file and all three are identical except for the numbers, so I don't suppose that's it, but it would've made sense. The only time I got all three selections to carry over yesterday was when I messed around with the tpl_modules_attributes.php file, but I don't know what I knocked loose to make it happen.

 

 
Page 2 of 7 FirstFirst 1234 ... LastLast

Similar Threads

  1. v151 Dynamic Dropdown on Home Page (not stock by attributes).
    By Axeman in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 29 May 2015, 05:37 PM
  2. v151 Dynamic Dropdown Menus on Product Page
    By evildave in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 22 Oct 2013, 05:08 PM
  3. Problem with dynamic dropdown
    By genyux in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 10 Jun 2010, 12:33 PM
  4. Dynamic Dropdown Issues
    By valfodr in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 28 Mar 2009, 04:47 AM
  5. Dynamic Dropdown Categories - Is it possible?
    By AATECH in forum General Questions
    Replies: 4
    Last Post: 21 Jul 2008, 08:10 PM

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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR