Address State Does not Autopopulate after Country Selection with SEF

Started by seyi, April 30, 2012, 19:51:17 PM

Previous topic - Next topic

seyi

I checked SVN before posting.


If I go specifically to this url to edit the billing address:
index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT

In my shop, this is an sef url:
shop/user/editaddresscart?addrtype=BT

The ajax for auto populating the State after selecting a Country fails.  I fixed it by updating /components/com_virtuemart/assets/js/vmsite.js and changing this line

$.getJSON('index.php?option=com_virtuemart&view=state&format=json&virtuemart_country_id=' + byAjax,


to this

if(window.vmSiteurl == undefined) window.vmSiteurl = '';
$.getJSON(window.vmSiteurl+'index.php?option=com_virtuemart&view=state&format=json&virtuemart_country_id=' + byAjax,


It works now.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

PRO

do you have "vmart states and countries" javascript enabled?


seyi

It certainly does require javascript.  When editing or adding an address, if you select United States, the States dropdown is automatically filled with all the states in the US.  If you select Canada, all the provinces are added to the States dropdown... and so on and so on.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

Milbo

It still works for me, so I wonder.

Seyi, which version? and please take a look on our changes to the watinglist, I remember you use it already somehow.
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

seyi

Version 2.0.6.

Do you have sef enabled?  It works fine for me when the url is:
index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT

With sef enabled, when the url is
shop/user/editaddresscart?addrtype=BT

It does not work.
I think the ajax appends the url
shop/user/editaddresscart/index.php.....


Whats the problem with the waiting list?
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

ariplatinum

I also had this problem come up, however it wasn't because of VM SEO option turned on.... Rather it was AceSEF that broke this.

I have since gone back to VMs built in SEO option (should really be renamed SEF in my opinion) and it works again (along with a whole raft of other JS functions like dynamic pricing etc)
Joomla 2.5.4
Virtuemart 2.0.4
Firefox 11

seyi

actually yes, Im not using VM's seo, Im using AceSef.  After a few little tweaks, its working fine.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

ariplatinum

Perhaps suggest these tweaks to the developer or post them here please... For whatever the reason AceSEF broke:
-Auto State population after country select
-Dynamic pricing calculation
-Offline credit card processor link in cart, kept redirecting to front page
-add to cart button

The developer was nice enough to look into it for me for a few days, however I need my site to go live asap so I couldn't wait any longer for them to try to figure out what was going wrong. I suspect it is a bug in their router causing a clash with VM's JS.
Joomla 2.5.4
Virtuemart 2.0.4
Firefox 11

seyi

The only problem I recollect having for adding to cart is when the website is in https.  The javascript ajax did not work, and that was due to vmSiteurl being set to the full url.  For example, I am on this page:
https://www.mysite.com/index.php?option=com_virtuemart....

In the javascript on the page:
vmSiteurl = 'http://www.mysite.com/'; ;

To fix it, I set the vmSiteurl to a relative path in helpers/config.php.  That way do not have to worry about the protocol.

Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate

qwerty123456789

I changed that code but still not working, history and cookies cleaned, also I can't choose title : Mr/Mrs , it simply doesn't work.


seyi

I just realized I used <?php and ?> within the code.  It is not php, but javascript.  If you used those tags in the code, then that would cause problems, take them out.

To debug load it in google chrome, right click on the page, click 'inspect element', click the console tab and try the dropdown.  Any javascript error will show up there and that should give you an indication of what the problem is.
Seyi A
--------------------
Promotion enhancement for Virtuemart:
   - AwoCoupon FREE - http://www.awocoupon.com/starter
   - AwoCoupon Pro - http://awodev.com/products/joomla/awocoupon
   - AwoRewards - http://awodev.com/products/joomla/aworewards
   - AwoAffiliate - http://awodev.com/products/joomla/awoaffiliate