| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Message on checkout when country selected | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
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:
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!
__________________
Shaz X-Cart Developer Sydney - Australia |
|||||||
#2
|
|||||||
|
|||||||
Re: Message on checkout when country selected
Hi,
Which template are you using your code? ITVV
__________________
X-Cart Pro 4.7.12 Active and working great with reBOOT-reDUX X-Cart Pro 4.6.6 Retired after 6 years of first class service X-Cart Pro 4.1.7 Retired after 9 years of first class service Apache: 2.4.25 PHP: 7.4.5 MariaDB: 10.1.44 Arch: x86_64 |
|||||||
#3
|
|||||||
|
|||||||
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/
__________________
Shaz X-Cart Developer Sydney - Australia |
|||||||
#4
|
|||||||
|
|||||||
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:
FIND: - Code:
ADD THE FOLLOWING CODE ABOVE THE LINE ABOVE: - Code:
Hope that helps? Kind regards ITVV
__________________
X-Cart Pro 4.7.12 Active and working great with reBOOT-reDUX X-Cart Pro 4.6.6 Retired after 6 years of first class service X-Cart Pro 4.1.7 Retired after 9 years of first class service Apache: 2.4.25 PHP: 7.4.5 MariaDB: 10.1.44 Arch: x86_64 |
|||||||
|
#5
|
|||||||||
|
|||||||||
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
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#6
|
|||||||
|
|||||||
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!
__________________
Shaz X-Cart Developer Sydney - Australia |
|||||||
|
#7
|
|||||||
|
|||||||
Re: Message on checkout when country selected
Your GB Message put somewhere...
Code:
Code:
Code:
__________________
xcartmods.co.uk |
|||||||
|
#8
|
|||||||
|
|||||||
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
__________________
Shaz X-Cart Developer Sydney - Australia |
|||||||
|
|||
X-Cart forums © 2001-2020
|