Announcement

Collapse
No announcement yet.

Displaying Shipping Options with Radio Buttons

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

    Displaying Shipping Options with Radio Buttons

    I would like to display the shipping options in a table if possible or at least, with radio button selection as you can with an attribute. Can anyone shed any light on how to this? Any help much appreciated.

    Jethro
    Jethro

    TridentUK.com, the yacht and dinghy shop on the web

    #2
    It looks like this one is hard coded into ShippngTemplate.pl in the Site1\ShipControl folder - lines 429 - 467. It could be changed but would require a bit of Perl skill.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      Edit ShippingTemplate.pl in the Site1\ShipControl folder (back it up first)

      Replace
      Code:
      		#
      		# Start the SELECT tag
      		#
      		$sSelectHTML = "<SELECT ID='lstClass' NAME='ShippingClass'>\n";
      		foreach $phashShipping (@::s_arrSortedShippingHashes)	# for each shipping option
      			{
      			#
      			# Handle the label by appending the cost if we're displaying prices
      			#
      			$sClassLabel = $$phashShipping{ShippingLabel};
      			if ($::s_Ship_bDisplayPrices)									# displaying prices?
      				{
      				my (@PriceResponse) =
      					ActinicOrder::FormatPrice($$phashShipping{Cost},
      						$::TRUE,
      						\%::s_Ship_PriceFormatBlob);
      
      				$sClassLabel .= sprintf($sPriceLabelFormat, $PriceResponse[2]);	# add the price to the label
      				}
      			#
      			# Set the SELECTED attribute
      			#
      			$sClassID = $$phashShipping{ShippingClass};
      
      			my $sSelected =
      				($sClassID eq $::s_hashShipData{'ShippingClass'}) ?	# if this one is the current selection
      				'SELECTED ':														# make it the selected value else
      				'';																	# just another value
      			#
      			# Format as an OPTION tag
      			#
      			$sSelectHTML .= sprintf("<OPTION %s Value='%s'>%s\n",
      				$sSelected, $sClassID, $sClassLabel);
      			}
      		#
      		# End the SELECT tag
      		#
      		$sSelectHTML .= "</SELECT>\n";
      		}
      with
      Code:
      		#
      		# Start the RADIO list
      		#
      		$sSelectHTML = '';
      		foreach $phashShipping (@::s_arrSortedShippingHashes)	# for each shipping option
      			{
      			#
      			# Handle the label by appending the cost if we're displaying prices
      			#
      			$sClassLabel = $$phashShipping{ShippingLabel};
      			if ($::s_Ship_bDisplayPrices)									# displaying prices?
      				{
      				my (@PriceResponse) =
      					ActinicOrder::FormatPrice($$phashShipping{Cost},
      						$::TRUE,
      						\%::s_Ship_PriceFormatBlob);
      
      				$sClassLabel .= sprintf($sPriceLabelFormat, $PriceResponse[2]);	# add the price to the label
      				}
      			#
      			# Set the CHECKED attribute
      			#
      			$sClassID = $$phashShipping{ShippingClass};
      
      			my $sSelected =
      				($sClassID eq $::s_hashShipData{'ShippingClass'}) ?	# if this one is the current selection
      				'checked ':						# make it the selected value else
      				'';							# just another value
      			#
      			# Format as an RADIO tag
      			#
      			$sSelectHTML .= sprintf("<input type='radio' %s NAME='ShippingClass' Value='%s'>%s\n",
      				$sSelected, $sClassID, $sClassLabel);
      			}
      		}
      If you want each choice on a separate line then change
      Code:
      			$sSelectHTML .= sprintf("<input type='radio' %s NAME='ShippingClass' Value='%s'>%s\n",
      to be
      Code:
      			$sSelectHTML .= sprintf("<input type='radio' %s NAME='ShippingClass' Value='%s'>%s<br>\n",
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Thanks for your reply, I will give it a go.

        Jethro
        Jethro

        TridentUK.com, the yacht and dinghy shop on the web

        Comment


          #5
          Edit ShippingTemplate.pl in the Site1\ShipControl folder...
          Thanks, I've tried this and it's just what I wanted - except for one small glitch.

          Although the window is plenty wide enough it's wrapping the shipping type descriptions onto two lines.

          (see attachment)

          I've had a look at the templates, and the .pl file and I can't see where it's setting the width.

          Any ideas how to stop this? It's not like there's a shortage of space there!
          Attached Files
          John

          Comment


            #6
            That will be the html, not the perl doing the sizes, if you firebug the live code it will show you the relevant coding for that part, I'd expect a 2 column table by the looks of it, set your preferred width on the <td>.

            Comment


              #7
              Yes, but the problem is, where's the html code in actinic?

              oh wait, think I just found it in a really obvious place...
              John

              Comment


                #8
                I would expect this is in a table towards the bottom of Act_Order01.html

                Comment


                  #9
                  Yes, that would be where I would expect to find it... but it was in the Act_ShippingSelectTemplate.html template...

                  Problem solved!

                  Thanks.
                  John

                  Comment


                    #10
                    Is there a similar fix for the country dropdown on the first page?
                    John

                    Comment


                      #11
                      v2016?

                      Hi Norman

                      Have you any advice please on applying this to version 2016?

                      Thanks

                      Jonathan
                      Jonathan Chappell
                      Website Designer
                      SellerDeck Website Designer
                      Actinic to SellerDeck upgrades
                      Graphicz Limited - www.graphicz.co.uk

                      Comment

                      Working...
                      X