My Sellerdeck Account | Free Trial

Sellerdeck Community & Knowledge Base

  #1  
Old 05-Jul-2016, 03:39 PM
Sheltons Sheltons is offline
Registered User
Join Date: Jan 2014
Full Name: John Pike
Posts: 37
Thanks: 2
Thanked 3 Times in 2 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
Reply With Quote
  #2  
Old 05-Jul-2016, 04:15 PM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,813
Thanks: 9
Thanked 766 Times in 638 Posts
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
Reply With Quote
  #3  
Old 07-Jul-2016, 08:07 AM
Sheltons Sheltons is offline
Registered User
Join Date: Jan 2014
Full Name: John Pike
Posts: 37
Thanks: 2
Thanked 3 Times in 2 Posts
Quote:
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.
Reply With Quote
  #4  
Old 07-Jul-2016, 08:39 AM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,813
Thanks: 9
Thanked 766 Times in 638 Posts
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
Reply With Quote
  #5  
Old 07-Jul-2016, 09:18 AM
Sheltons Sheltons is offline
Registered User
Join Date: Jan 2014
Full Name: John Pike
Posts: 37
Thanks: 2
Thanked 3 Times in 2 Posts
Quote:
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
Reply With Quote
  #6  
Old 07-Jul-2016, 10:22 AM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,813
Thanks: 9
Thanked 766 Times in 638 Posts
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
Reply With Quote
  #7  
Old 07-Jul-2016, 10:30 AM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,813
Thanks: 9
Thanked 766 Times in 638 Posts
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
Reply With Quote
  #8  
Old 07-Jul-2016, 11:02 AM
Sheltons Sheltons is offline
Registered User
Join Date: Jan 2014
Full Name: John Pike
Posts: 37
Thanks: 2
Thanked 3 Times in 2 Posts
Quote:
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
Reply With Quote
  #9  
Old 07-Jul-2016, 11:26 AM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,813
Thanks: 9
Thanked 766 Times in 638 Posts
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
Reply With Quote
  #10  
Old 07-Jul-2016, 01:50 PM
Sheltons Sheltons is offline
Registered User
Join Date: Jan 2014
Full Name: John Pike
Posts: 37
Thanks: 2
Thanked 3 Times in 2 Posts
Quote:
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
Reply With Quote
  #11  
Old 07-Jul-2016, 04:54 PM
Sheltons Sheltons is offline
Registered User
Join Date: Jan 2014
Full Name: John Pike
Posts: 37
Thanks: 2
Thanked 3 Times in 2 Posts
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
Reply With Quote
  #12  
Old 07-Jul-2016, 08:05 PM
NormanRouxel's Avatar
NormanRouxel NormanRouxel is offline
Registered User
Join Date: Dec 2002
Full Name: Norman Rouxel
Posts: 10,813
Thanks: 9
Thanked 766 Times in 638 Posts
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:07 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.