X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   One Page Checkout - Javascript address vars (https://forum.x-cart.com/showthread.php?t=75905)

herber@wirehub.nl 01-10-2018 03:13 AM

One Page Checkout - Javascript address vars
 
Hi!

I'm currently working on a mod for our customers to choose a Pickup Point for their parcels.
However, I'd like to pass the zipcode that the customer has filled in on his address, to the call that opens the Pickup Point Chooser-Window.

So what I'm looking for, is a javascript variable that contains the zipcode of the customer.
Is there such a variable?

Location:
cart.php?mode=checkout

So the customer has already filled in his/her address and can now choose a payment method + shipping method. An extra button has been implemented, that will open a window that will let the customer choose a Pickup location for whatever parcel service he/she chooses.


Is there such a Javascript variable on the checkout page?

cherie 01-10-2018 02:36 PM

Re: One Page Checkout - Javascript address vars
 
I'm not seeing one. You may have to create your own like:
Code:

<script>
var ppZip = '{$userinfo.s_zipcode}';
</script>


herber@wirehub.nl 01-11-2018 02:49 AM

Re: One Page Checkout - Javascript address vars
 
Quote:

Originally Posted by cherie
I'm not seeing one. You may have to create your own like:
Code:

<script>
var ppZip = '{$userinfo.s_zipcode}';
</script>


Thank you!
That is exactly what I'm looking for, placing $userinfo.s_zipcode in a JS variable has solved my problem.
Now I can pass this variable to the Pickup Point Chooser-popup window & customers will immediately see the Pickup Points near them.


All times are GMT -8. The time now is 02:21 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.