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:
phpvar baseUrl = '<?php echo Route::_('index.php'); ?>';
Change it to use Uri::base() instead of Route::_('index.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:
- Open that file via cPanel File Manager (Edit) or FTP.
- Search for
var baseUrl = '<?php echo Route::_(. - Replace exactly that one line as shown above.
- 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