<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - Showing and hiding dropdowns on product page, based on selected values</title>
    <link>https://forums.adobe.com/community/business_catalyst/how_to-html-css-javascript?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Wed, 12 Nov 2014 18:11:28 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2014-11-12T18:11:28Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: Showing and hiding dropdowns on product page, based on selected values</title>
      <link>https://forums.adobe.com/message/6923301?tstart=0#6923301</link>
      <description>&lt;!-- [DocumentBodyStart:e72ca2ea-2df7-49be-b4d2-3e8389045cd3] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Hi Machinette,&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I apologise for not replying, I didn't receive any notification that there was a reply.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:e72ca2ea-2df7-49be-b4d2-3e8389045cd3] --&gt;&lt;img src='/beacon?t=1415884495376' /&gt;</description>
      <pubDate>Wed, 12 Nov 2014 18:11:28 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6923301?tstart=0#6923301</guid>
      <dc:date>2014-11-12T18:11:28Z</dc:date>
      <clearspace:dateToText>19 hours 3 minutes ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: Showing and hiding dropdowns on product page, based on selected values</title>
      <link>https://forums.adobe.com/message/6904345?tstart=0#6904345</link>
      <description>&lt;!-- [DocumentBodyStart:8bcd5c8b-326d-4799-bf2f-32d0d07285ab] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Erased due to noone feedback from author&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:8bcd5c8b-326d-4799-bf2f-32d0d07285ab] --&gt;</description>
      <pubDate>Thu, 06 Nov 2014 07:39:31 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6904345?tstart=0#6904345</guid>
      <dc:date>2014-11-06T07:39:31Z</dc:date>
      <clearspace:dateToText>5 days 3 hours ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Showing and hiding dropdowns on product page, based on selected values</title>
      <link>https://forums.adobe.com/message/6879074?tstart=0#6879074</link>
      <description>&lt;!-- [DocumentBodyStart:055683fd-3102-4a38-9f0f-2310b22081d6] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Hello.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I would like my product page to show different subsequent dropdowns based on individual dropdown values. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;I've managed to achieve this via JavaScript, but I do not like how it works.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;As far as I can tell, there is no proper identifier for each individual dropdown to determine which one it is, so all I can do at the moment is to rely on their order in the DOM, which is bad and makes it difficult for me to create a solution that would work for all products.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;For instance, if the following is a single attribute:&lt;/p&gt;&lt;p&gt;&amp;lt;div class="catProductAttributeGroup" style="display: none;"&amp;gt;&amp;lt;div class="catProdAttributeTitle"&amp;gt;Metallic Foiling&amp;lt;/div&amp;gt;&amp;lt;div class="catProdAttributeItem"&amp;gt;&amp;lt;select&amp;gt;&amp;lt;option value=""&amp;gt;-- Please select --&amp;lt;/option&amp;gt;&amp;lt;option value="6051720"&amp;gt;Not required &amp;lt;/option&amp;gt;&amp;lt;option value="6051721"&amp;gt;Foil ONE side + &amp;pound;45&amp;lt;/option&amp;gt;&amp;lt;option value="6051722"&amp;gt;Foiling BOTH sides + &amp;pound;75&amp;lt;/option&amp;gt;&amp;lt;/select&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I would like the outer-most div to have some sort of html attribute that holds the product attribute id. Something like, data-attribute-id="XXXXXXX". Is that possible?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Here's what I have up to this point:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I use {tag_attributes_json}, {tag_product_json} and {tag_currency} to get these values into javascript on page load, so I can use them later.&lt;/p&gt;&lt;p&gt;&lt;br/&gt;Then, I hook to change events of the drodpowns I have and then toggle their visibility based on which ones are selected. I rely on the jequery ':eq(n)' selector to achieve this, which I do not like. Is there an option for the {tag_attributes} helper which would make it add some extra information (such as attribute ID on the dropdown) on the generated HTML?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;All of this works initially, but If I then 'Add to cart', the product element get's ajax-reloaded and the events are suddenly unhooked, so it doesn't work anymore. For that one, there are two options:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;1. I could hook to an event that triggers once the product has been added to cart and the page is ready again. &lt;strong&gt;Is there such an event?&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;2. I could implement my own add to cart using bcInternals.shop.addToCart. I tried doing this, but I have two problems with it.&lt;/p&gt;&lt;p style="padding-left: 30px;"&gt;a. addToCart seems to add my selection twice, for some reason.&lt;strong&gt; Any ideas what I might be doing wrong?&lt;/strong&gt;&lt;/p&gt;&lt;p style="padding-left: 30px;"&gt;b. the cart info in&amp;nbsp; the top right corner doesn't refresh. it seems it tries to refresh, but there's some sort of access error in the script. This part is not yet fully added to the page, but there's a function that would do the adding to cart at the bottom of the bigger script block. &lt;strong&gt;Am I using the built in addToCart function incorrectly?&lt;/strong&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px; padding-left: 30px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is the page I have the partially implemented functionality added on:&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-external-small" href="http://www.afterhourscreativestudio.com/business-cards/matt-laminated-business-cards" rel="nofollow"&gt;Matt Laminated Business Cards&lt;/a&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;The scripts are currently embedded inside the HTML. Once I have it properly implemented, I'd like to extract it into a separate file. Search for "&lt;span style="color: #222222; font-family: Consolas, 'Lucida Console', monospace; font-size: 12px;"&gt;$productAttributesElement" &lt;span style="font-family: arial, helvetica, sans-serif;"&gt;to find the block with the functionality and for&lt;/span&gt; "productInfo" &lt;span style="font-family: arial, helvetica, sans-serif;"&gt;to find the part where I store the product data with the _json tags.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:055683fd-3102-4a38-9f0f-2310b22081d6] --&gt;</description>
      <pubDate>Wed, 29 Oct 2014 13:14:20 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/6879074?tstart=0#6879074</guid>
      <dc:date>2014-10-29T13:14:20Z</dc:date>
      <clearspace:dateToText>2 weeks 1 day ago</clearspace:dateToText>
      <clearspace:replyCount>2</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

