#1006 Issue with Country dropdown

Posted in ‘Technical Support / Bugs’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

J2Commerce

Version
J2Commerce v6

Latest post by Adam Melcher on Friday, 04 September 2026 21:12 UTC

Anne Marie Notarthomas

Hi Adam and Olivia,

I just updated a site from j2Store 4 to J2Commerce 6.6.1.  While trying to test an order, the dropdown for country and state at checkout wouldn't work -- The country was blank and the state would only show -select-.

Working with claude, it pointed to what it thinks is a bug.  I made the change and it works, so letting you know - this is what I followed:

Confirmed exactly as suspected — baseUrl is the current page's SEF URL, not the plain routing entry point, which is what causes the double-? when the AJAX code appends its own parameters onto it.

The fix — change this one line:

Find this line in the file:

  php
var baseUrl = '<?php echo Route::_('index.php'); ?>';

Change it to use Uri::base() instead of Route::_('index.php'):

  php
var baseUrl = '<?php echo Uri::base(); ?>index.php';

Uri::base() returns the site's root URL (e.g., https://ittyandbitty.com/), and appending index.php gives you a stable, always-correct entry point regardless of SEF settings or which page you're currently on — avoiding the routing quirk that was substituting the current page's URL instead.

Where to make this edit:
This is the core component's own view template — not a template override — so it lives at:

 
/public_html/components/com_j2commerce/tmpl/checkout/default.php

(path may vary slightly if your install uses a src/ MVC structure instead of tmpl/ — but based on the code we already have, this is almost certainly it, matching the file you pasted).

To edit it:

  1. Open that file via cPanel File Manager (Edit) or FTP.
  2. Search for var baseUrl = '<?php echo Route::_(.
  3. Replace exactly that one line as shown above.
  4. Save, clear Joomla cache, reload the checkout page.

One note: Uri::base() needs to already be imported at the top of the file for this to work without a fatal error — check the use statements near the top (where you see use Joomla\CMS\Uri\Uri; — actually, looking back at your earlier paste, it's already imported! use Joomla\CMS\Router\Route; and use Joomla\CMS\Uri\Uri; are both already there from $storeLogo code higher up. So this edit is safe to make as-is.

Since this is core code that could get overwritten by a future update, definitely worth reporting to J2Commerce

---

This is a Joomla 6.1.3 site.  

I like your checkout page and process so much better than the old one.  Thank you for your work on this and continuing to offer it.  This is a very simple store, but it has been working great for her for years!

Anne 

Adam Melcher

Anne,

Thanks for the assist! Claude got most of it right and we were able to take it the rest of the way. It only affects a specific setup that we never accounted for. It is going to be in the next upcoming release :)

 

Adam

Growing Together

Help us get back to #1 in the Joomla Extension Directory by leaving us a 5-Star review here.

Stay Updated

Subscribe for free and be the first to know about the latest features, updates, and new additions.