Jump to content

Conditional message if statement/ pop-up on Country select?


ukbaz

Recommended Posts

Hi Am trying to work out a means of displaying a conditional message to a customer that will work when a customers selects a certain county in the one page checkout - I.e Customer selects Austarlia as country and the cart displays 'This country selection may lead to extra shipping delays'.

 

Anyone done this or know how to?

Link to comment
Share on other sites

tried adding this in address.tpl as test undrer country drop-down:

 

{if $country->id_country == '24'} {l s='This order may be transferred to our Australian distributor} {else}{/if}

 

page blanked :-( what am I missing here?

Link to comment
Share on other sites

  • 1 year later...

Paste following code in /your-theme/order-opc-new-account.tpl or corresponding page if you don't use OPC :)

 

<p class="required select">
<label for="id_country">{l s='Country'} <sup>*</sup></label>
<select name="id_country" id="id_country" onchange="showhide(this)">
<option value="">-</option>
{foreach from=$countries item=v}
<option value="{$v.id_country}" {if (isset($guestInformations) AND $guestInformations.id_country == $v.id_country) OR (!isset($guestInformations) && $sl_country == $v.id_country)} selected="selected"{/if}>{$v.name|escape:'htmlall':'UTF-8'}</option>
{/foreach}
</select>
<!-- Added Pass to distributor code -->
<div align="center">
<div class="answer21 answers" style="width:auto;height:30px;display:none">
<div id="value21a"><strong><font color="#df242b" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Thank you for your order. This will be passed to our local distributor in the United States - Thermoworks Inc for them to process.</font></strong></div>
</div>
</div>
<div align="center">
<div class="answer24 answers" style="width:auto;height:30px;display:none">
<div id="value24a"><strong><font color="#df242b" face="Helvetica, Geneva, Arial, SunSans-Regular, sans-serif">Thank you for your order. This will be passed to our local distributor in Australia - Ross Brown Sales for them to process.</font></strong></div>
</div>
</div>

<script type="text/javascript">
{literal}
function showhide(id) {
var mySel = $(id).val()
$('.answers').hide()
$('.answer'+mySel).show()
}
{/literal}
</script>
<!-- END Added Pass to distributor code -->
</p>

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...