View Single Post
Old 09-11-2015, 12:09 PM
Heimatstcke Shop's Avatar
Heimatstcke Shop Heimatstcke Shop is offline
Join Date: Sep 2015
Posts: 14
Question Need Programming Help: dependant product-options on single-product (embedded)

Hello everyone, I need some help concerning coding.

Well actually it's not really coding but more like "finding the right names". What I am trying to do is getting dependant product options. For Example: different Types of T-Shirts have different Colors available and depending on what shirttype the user chooses, the other options fitting to his choice appear.

I already found this topic:
The Code provided from Matt ( worked as intended on the product browser. But my situation is different and I am kind of lost because I tried so much to make it work.

The Code works for the product browser but my page is made in Muse and the only part of "ECWID-embed-html" is the box containing the options, the quantaty and the "to-bag" button (and the bag itself but it doesn't matter) as you can see here in my testpage ( on the right, underneath the way too large priceimage . The company I work in uses Muse for webdesign which is why I really want to find a way to make it work so even someone with no programming skills can manipulate the code only with a little guideline. I still want to do all my designs in Muse and only use the product-options, the quantaty, the to-bag button and the bag itself from ecwid.

Now to the part about the code. Of course I changed the expanderName and Flag to the needed parameters which did work just fine in the regular product browser. But when it comes to the single-product-embedding it's not doing anything anymore. I've added a window.alert on the very end of the expander function to see when it goes off. It never did. Oh it did once, but I think that was a bug because everything on the website went bananas. I think the main problem is somewhere in this part:

Ecwid.OnPageLoaded.add(function(page) {
if ('PRODUCT' == page.type) {

// Attach a handler to the 'expander' option
jQuery("div[class *= ecwid-productoption-" + expanderOptionName + "] input[type=radio]").click(function() {
My java-knowledge makes me understand the code to a degree where I would say I can continue writing on it. But I just don't get the if-part from above... or at least I think it doesn't fit with the Single-Product-Embedding because it's not a whole page but a part of it...right? I also changed the .div's from productbrowser-details-etc. to singleproduct-options which had no effect.

Is anyone out there so kind to help me with this one? All I need is the examplecode from Matt to work on my Single-Product-Embedding... I would code the rest myself. We don't really like the product-browser, even with changed CSS. And making it look like the way we want would take too much time and require coding skills on a high level which we don't have. So unless we get this code working soon I have to look for another ecommerce solution unfortunately.

Thanks in advance!

Kind regards!