Announcement

Collapse
No announcement yet.

Single Radio Button does not Default Select.

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Single Radio Button does not Default Select.

    Hi,
    been look around for answers to this with no success.

    I have a product which is a bundle that you have to select a colour for each of the alarms and with the three alarms comes the receiver. The problem is that the receiver RadioButton is Disabled by default, since there is one options surely it should default to on. All the Alarms Default to the first colour which is fine.

    Only on the Dev site at the moment:
    http://dev.sheltonsfishing.co.uk/aca...fo_SH0732.html

    If I use the 'Is Optional' box then I get an extra line with a tick box above my Choice.

    What I need is a Variable - "IsChoicesEqualToOne" then I can add checked="checked" in a Block If.

    I added checked="checked" to input line in Radio Button Permutation Entry Layout which gets me around the problem but then it selects the last option instead of the first (I understand why this is) on the Alarm colours, but it worries me that other products could be affected adversly.

    Hopefully someone can help me with this.

    Thanks
    John.

    Version 11.0.6
    John
    Sheltons Fishing Tackle
    www.sheltonsfishing.co.uk
    sigpic

  • #2
    It looks like you've moved some SellerDeck layout code around in order to display the Attribute name below the set of choices. This is breaking some PHP code that needs to run before the choices are displayed. Check layout "Permutation Radio Button List" and see if it looks like this (the standard V11.0.6 code below):
    Code:
    <actinic:variable name="PermutationAttributeList" value="Attribute Names" />
    <br />
    <actinic:block php="true" >
    	$bOptionSelected = false;
    </actinic:block>
    <div id="id<Actinic:Variable Name="UIWidgetName"/>_Table">
    <actinic:variable value="Radio Button Permutation List" name="PermutationList" />
    </div>
    The bit of code I've marked in red must come before <actinic:variable value="Radio Button Permutation List" name="PermutationList" />.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


    • #3
      Originally posted by NormanRouxel View Post
      It looks like you've moved some SellerDeck layout code around in order to display the Attribute name below the set of choices. This is breaking some PHP code that needs to run before the choices are displayed. Check layout "Permutation Radio Button List" and see if it looks like this (the standard V11.0.6 code below):
      Code:
      <actinic:variable name="PermutationAttributeList" value="Attribute Names" />
      <br />
      <actinic:block php="true" >
      	$bOptionSelected = false;
      </actinic:block>
      <div id="id<Actinic:Variable Name="UIWidgetName"/>_Table">
      <actinic:variable value="Radio Button Permutation List" name="PermutationList" />
      </div>
      The bit of code I've marked in red must come before <actinic:variable value="Radio Button Permutation List" name="PermutationList" />.
      Hi Norman,
      Thanks for the reply, wasn't in work yesterday - went fishing.

      That was not by design so I restored a backup and reloaded. I checked the dev before I left work and that problem had been rectified so you may have got a cached page? Can you look again please as the attribute name should be above the choices.



      In "Radio Button Permutation List" I have:
      Code:
      <actinic:variable name="PermutationAttributeList" value="Attribute Names" />
      <br />
      <actinic:block php="true" >
      	$bOptionSelected = false;
      </actinic:block>
      <div id="id<Actinic:Variable Name="UIWidgetName"/>_Table">
      <actinic:variable value="Radio Button Permutation List" name="PermutationList" />
      </div>
      which looks the same as yours to me.

      I really try not to tinker with the code as much as possible, I can usually find my way around but I usually end up spending days to get what I want - I am not experienced in coding in SellerDeck but needs must.

      Thanks.
      John.
      John
      Sheltons Fishing Tackle
      www.sheltonsfishing.co.uk
      sigpic

      Comment


      • #4
        Could you post the code within layout "Radio Button Permutation Entry"? Post within [c o d e] and [/c o d e] tags but type "code" without the spaces.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


        • #5
          Originally posted by NormanRouxel View Post
          Could you post the code within layout "Radio Button Permutation Entry"? Post within [c o d e] and [/c o d e] tags but type "code" without the spaces.
          This should be it:
          Code:
          <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationIsValid%22%20%2f%3e" >
          	<actinic:block if="%3cactinic%3avariable%20name%3d%22IsPermutationHidden%22%20%2f%3e%20%3d%3d%20FALSE%20%0dOR%0d%28%3cactinic%3avariable%20name%3d%22IsPermutationHidden%22%20%2f%3e%20%3d%3d%20TRUE%20AND%20%28%3cactinic%3avariable%20name%3d%22IsAssociatedProductInStock%22%20%2f%3e%20%3d%3d%20TRUE%20OR%20%3cactinic%3avariable%20name%3d%22RealTimeStockEnabled%22%20%2f%3e%20%3d%3d%20TRUE%29%29" >
          		<input type="radio" name="<actinic:variable name="PermutationAttributeList" value="Attribute IDs" />" value="<actinic:variable name="PermutationChoiceList" value="Permutation Choice ID List" />" <actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationIsValid%22%20%2f%3e%20%3d%3d%20False" >disabled</actinic:block>
          			<actinic:block if="%28%3cactinic%3avariable%20name%3d%22IsUsedNoneChoiceLabel%22%20%2f%3e%20%3d%3d%20FALSE%29%0dOR%0d%28%28%3cactinic%3avariable%20name%3d%22IsUsedNoneChoiceLabel%22%20%2f%3e%20%3d%3d%20TRUE%29%20AND%20%28%3cactinic%3avariable%20name%3d%22IsSelectedByDefault%22%20%2f%3e%20%3d%3d%20FALSE%29%29" >
          				<actinic:block php="true" >
          					echo ($bOptionSelected == false) ? 'checked="checked"' : '';
          						$bOptionSelected = true;
          				</actinic:block>
          			</actinic:block> 
          		<actinic:block if="%3cactinic%3avariable%20name%3d%22AssociatedProduct%3a%3aProductID%22%20%2f%3e" >
          			class="rts_<actinic:variable name="AssociatedProduct::ProductID" />_
          				<actinic:block php="true" if="%3cactinic%3avariable%20name%3d%22IsComponentCheckboxShown%22%20%2f%3e%20%3d%3d%20TRUE" >	echo ' chk_' . $sCompCheckBox . '_';</actinic:block>"
          		</actinic:block>>
          		<actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationAssociatedNameIsUsed%22%20%2f%3e%20%3d%3d%20FALSE">
          			<span class="ProdPermutationDesc"> <actinic:variable name="PermutationChoiceList" value="Permutation Choice Name List" /> </span>
          		</actinic:block>
          		<actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationAssociatedNameIsUsed%22%20%2f%3e">
          			<actinic:variable name="AssociatedProduct::ProductName" /> 
          		</actinic:block>
          		<actinic:block if="%3cactinic%3avariable%20name%3d%22IsPriceShownForComponents%22%20%2f%3e">
          			<span class="ProdPermutationPrice"> <actinic:variable name="PermutationPrice" /> </span>
          		</actinic:block>
          	</actinic:block>
          </actinic:block>
          
          
          	<actinic:block if="%3cactinic%3avariable%20name%3d%22PermutationIsValid%22%20%2f%3e%20%3d%3d%20False" >
          		<input type="radio" name="Buttondisabled" disabled>
          		<span class="ProdPermutationDescDisabled"> <actinic:variable name="PermutationChoiceList" value="Permutation Choice Name List" /> </span>	
          		<span class="ProdPermutationPrice">  </span>
          		<div style="text-align:right;"> Call the Shop for Availability and Pricing.</div>
          	
          	
          </actinic:block>
          John
          Sheltons Fishing Tackle
          www.sheltonsfishing.co.uk
          sigpic

          Comment


          • #6
            That code is significantly different from standard SD code but it should work.

            Looks like you've got the bug described in http://community.sellerdeck.com/showthread.php?t=54991 - See post #5. This is an SD 2013 thread but the fix may be the same.

            You'll have to adapt your modifications (the "Call the Shop for Availability and Pricing" stuff) if you use the reworked layouts suggested in the post I've linked to.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment


            • #7
              For V11 use:
              Permutation Radio Button List - replace all code with:
              Code:
              <actinic:variable name="PermutationAttributeList" value="Attribute Names" />
              <br />
              <actinic:block php="true" >
              	$bOptionSelected = false;
              	$nPermCount = <actinic:block type="PermutationList"><actinic:variable name="ListCount" /></actinic:block>;
              </actinic:block>
              <div id="id<Actinic:Variable Name="UIWidgetName"/>_Table">
              <actinic:variable value="Radio Button Permutation List" name="PermutationList" />
              </div>
              And in your customised Radio Button Permutation Entry, replace:
              Code:
              ($bOptionSelected == false)
              With:
              Code:
              ($bOptionSelected == false || $nPermCount == 1)
              Norman - www.drillpine.biz
              Edinburgh, U K / Bitez, Turkey

              Comment


              • #8
                Originally posted by NormanRouxel View Post
                That code is significantly different from standard SD code but it should work.

                Looks like you've got the bug described in http://community.sellerdeck.com/showthread.php?t=54991 - See post #5. This is an SD 2013 thread but the fix may be the same.

                You'll have to adapt your modifications (the "Call the Shop for Availability and Pricing" stuff) if you use the reworked layouts suggested in the post I've linked to.
                Hi Norman,
                thanks for that it initially looked good and could see in the Permutation Radio Button that it would now check to see if there was only 1 in the list.

                I applied the changes but the Designer came up with an Error in 22 places.
                "Variable DynamicPriceCGIURL is not Defined in 22 places"

                I can see that Variable is used in the replacement code of "Radio Button Permutation Entry" in 2 places, is this a 2013 Variable that does not exist in 2011?

                Thanks
                John
                Sheltons Fishing Tackle
                www.sheltonsfishing.co.uk
                sigpic

                Comment


                • #9
                  Go back to your customised Radio Button Permutation Entry (as you've posted in post #5). Then use the code in my post #7. It's for SD V11 and works here.
                  Norman - www.drillpine.biz
                  Edinburgh, U K / Bitez, Turkey

                  Comment


                  • #10
                    Originally posted by NormanRouxel View Post
                    Go back to your customised Radio Button Permutation Entry (as you've posted in post #5). Then use the code in my post #7. It's for SD V11 and works here.
                    Sorry Norman, I only saw post #7 and not #8, must have been bad timing when I viewed.

                    Post #8 seems to have sorted it out a treat. Just uploading for online test - takes so long when you alternate between live and dev.

                    This customized template has been altered by 2 different Sellerdeck developers + myself since 2004 that I think it has had it's day but it is such a big job to upgrade to 2016 and start with a New Responsive template, time I just don't have.

                    Thanks very much for you help, appreciated.
                    John
                    Sheltons Fishing Tackle
                    www.sheltonsfishing.co.uk
                    sigpic

                    Comment


                    • #11
                      Hi Norman,

                      sorry, thought it was going well until the shop manager insisted it was not fixed even though it was showing correct on my PC, he was looking on his iPad.

                      It would seem, it fails to show on an iPad, chrome or safari but ok on Firefox, Explorer 11 & Edge with the code changes.

                      Since a lot of people use Apple devices to do their browsing this does present a problem?

                      Are you able to check on an iPad/ do you have anymore ideas? Apreciate all you have done so far.

                      Thanks
                      John
                      Sheltons Fishing Tackle
                      www.sheltonsfishing.co.uk
                      sigpic

                      Comment


                      • #12
                        The checked="checked" attribite is now being set. However you may not have any stock for that first item so the SD stock control is disabling the checkbox.
                        Norman - www.drillpine.biz
                        Edinburgh, U K / Bitez, Turkey

                        Comment

                        Working...
                        X