I was wondering if anyone had experience with using multiple image selectors on a page.
I am working to rebuild this page (http://www.canvasgnome.com/3-4-standard-canvas-wrap/) in OSCommerce. It's my brother's site. We are working to move the site to a new cart to allow more functionality.
As you can see, we have 2 sets of image options. I've made some changes to the code, adding js, changing the structure. But I'm stuck on how to separate the two selectors. The first one works fine. The second one has all of the options from both.
This is my objective {
First Set:
Option A:1
Option A:2
Option A:3
Second set:
Option B:1
Option B:2
}
This is what I'm getting {
First Set:
Option A:1
Option A:2
Option A:3
Second Set:
Option A:1
Option A:2
Option A:3
Option B:1 //javascript gives "undefined"
Option B:2 //javascript gives "undefined"
}
The query fetches the correct information, without the extra options.
I think the problem lies in one (or several) of these vars:
$ImageText
$ImageDropdown
$product_options
$First_ImageText
I've tried unset() on the variables after the case: statement, as well as emptying them by redeclaring the arrays, and setting the keys to '' since they are appended to in the script rather than reinitialized.
Unsetting them makes the first image reference (on page load) correct, but makes the selector for the first set not work properly (it tries to grab the images from the second set). It also does not fix the <select> <options>. They remain as above.
The option comes into the cart as an eye icon with a link to the images/uploads directory, rather than an option:value pair.
I have already made a variety of changes. I had to change the IDs to classes to make the js work properly and make a number of changes there. I am just stuck on getting the second selector to have the correct options.
I think I can work around it by rewriting that part of page with js after loading. But I'd rather have the script working. It seems like it should be a simple fix, but I'm not sure why I can't find the bug.
Sorry this is so long; I wanted to give you a full description.
If anyone has any ideas, I'd appreciate it.