Announcement

Collapse
No announcement yet.

Dropdown for salutation field

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

    Dropdown for salutation field

    Hi,

    We have enabled the salutation field for invoice/delivery details on the first checkout page, so we can easily port order data into our CRM.

    I have edited the layout to make the field into a dropdown - there is various posts regarding doing this for userdefined fields.

    However, none of these deal with having the field keep its value if the form is submitted with validation errors, or if you come back to this stage of the checkout - i.e. currently if I select 'Mr' from the dropdown, although the value is posted correctly, the field does not automatically select this value when you hit the page again for any reason.

    Does anyone know if it is possible to do this?

    #2
    I assume that nobody has ever needed to do this, but in case you have, here's the solution from Actinic support. Many thanks for G.W. Green for this.

    ====================================

    Ok, I have had a response from the development team.

    To do this will require a change to the layout and a Perl script change.

    It is not a simple change and it will be up to you to apply the change to subsequent versions of Actinic i.e. it is not covered by support.

    Edit the layout 'Both Address Salutation'

    replace the input tag for the InvoiceSalutation with...

    Code:
    <Actinic:INVOICESALUTATION>
      <select name="INVOICESALUTATION" style="width:50px;">
      <option value=""></option>
      <option value="Mr">Mr</option>
      <option value="Mrs">Mrs</option>
      <option value="Ms">Ms</option>
      </select>
    </Actinic:INVOICESALUTATION>
    likewise, replace the input tag for the DeliverSalutation with...

    Code:
    <Actinic:DELIVERSALUTATION>
      <select name="DELIVERSALUTATION" style="width:50px;">
      <option value=""></option>
      <option value="Mr">Mr</option>
      <option value="Mrs">Mrs</option>
      <option value="Ms">Ms</option>
      </select>
    </Actinic:DELIVERSALUTATION>
    Apply the changes

    Edit the script 'ActinicPXML.pm' in a plain text editor, you will find it in the site folder (it will be called 'Site1' if you have no other sites within the software, if you have multiple sites within the software it will be the one that corresponds to the site) which will normally be in 'Documents\Actinic v10\Sites\<site folder>'.

    Search for the first occurrence of DELIVERRESIDENTIAL, you should see...

    Code:
    DELIVERRESIDENTIAL => sub { $self->DeliverResidentialTagHandler(@_)},
    immediately after this insert the following 2 lines...

    Code:
    INVOICESALUTATION => sub { $self->InvoiceSalutationTagHandler(@_)},
    DELIVERSALUTATION => sub { $self->DeliverSalutationTagHandler(@_)},
    go to the end of the file. the last non blank line (around line 2970) is: -

    1;

    immediately before this line insert the code below: -

    Code:
    sub InvoiceSalutationTagHandler
    	{
    	my $Self = shift;
    	my ($sTag,  $rsInsideText, $ParameterHash, $sId, $sFullTag) = @_;
    	
    	if (ref $rsInsideText)
    		{
    		$$rsInsideText =~ s/<option\s+(value="$::g_BillContact{'SALUTATION'}")/<option selected $1/is;
    		}
    	return '';
    	}
    
    sub DeliverSalutationTagHandler
    	{
    	my $Self = shift;
    	my ($sTag,  $rsInsideText, $ParameterHash, $sId, $sFullTag) = @_;
    	
    	if (ref $rsInsideText)
    		{
    		$$rsInsideText =~ s/<option\s+(value="$::g_ShipContact{'SALUTATION'}")/<option selected $1/is;
    		}
    	return '';
    	}
    Save and exit then update the web site.

    The value of the salutation should then persist.

    Comment


      #3
      Thanks for letting us know.

      Comment


        #4
        Could do with moving to the KB I think.

        Comment


          #5
          Agreed.....if only we were worthy........

          Comment

          Working...
          X