Message on checkout when country selected
Hi There,
We require a message to appear for UK clients on the One Page Checkout when a particular country(s) is selected For example: Code:
{if $c.country_code eq "UK"} I've been able to identify the templates where I can get the message to appear but not the variable for country or country code for the IF STATEMENT. X-Cart Version: 4.7.5 Can anyone assist? Thanks! |
Re: Message on checkout when country selected
Hi,
Which template are you using your code? ITVV |
Re: Message on checkout when country selected
Quote:
Thanks for the quick reply :) We are using xtreme_gear, however test edits are showing from editing the files in /skin/common_files/modules/One_Page_Checkout/ |
Re: Message on checkout when country selected
Hi Shaz,
Couple of points here: - 1/ United Kingdom is referenced as GB not UK 2/ No data available for $c.country_code??? Try this to give you a pointer: - PLEASE NOTE I used Ideal Responsive as the skin because I do not have xtreme_gear Open Code:
skin/common_files/modules/One_Page_Checkout/opc_main.tpl FIND: - Code:
<h1>{$lng.lbl_checkout}</h1> ADD THE FOLLOWING CODE ABOVE THE LINE ABOVE: - Code:
<h1 style="background-color:powderblue;">SHAZ START Hope that helps? Kind regards ITVV |
Re: Message on checkout when country selected
Since this is for the OPC if you add it to the template file only it will trigger the message show/not on page load only. It will not work when country is selected from the dropdown or address book (depends on the template though). OPC has a lot of js code to refresh different parts of the page on request.
The country dropdown triggers onChange event to properly display states field - this is where you want to add your message too to either pop or show directly on page. I think the file to modify is skin/common_files/js/change_states.js You also have to modify skin/common_files/modules/One_Page_Checkout/ajax.checkout.js to show/hide the message if address is selected from the address book |
Re: Message on checkout when country selected
Thanks ITVV
Yes, adding the below code to skin/common_files/modules/One_Page_Checkout/opc_main.tpl and /skin/xtreme_gear/modules/One_Page_Checkout/profile/address_info.tpl gets it to display, however Steve is correct... only if the country is loaded by default with the cart, or a page refresh. {if $userinfo.b_country eq "GB"} <h3 style="color:red;">MESSAGE HERE</h3> {/if} I was an x-cart 4 dev in a past life now so geting into the ajex/js is now a bit beyond me these days I'm afraid! |
Re: Message on checkout when country selected
Your GB Message put somewhere...
Code:
<div id="GB_Message" style="display:none"> Code:
#GB_Message { color: red; font-size: 20px; } Code:
<script> |
Re: Message on checkout when country selected
Thanks also xcartmods.so.uk !
Final code added to opc_main.tpl to target the UK and Ireland to work around their new VAT rule of it not applying to orders over 135 pounds. Quote:
Appreciate the assistance |
All times are GMT -8. The time now is 05:44 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.