## Summary
Setting any product's **Product Type** to **Group Products** breaks that product completely — both the admin article edit form and the frontend product page fatal with:
``` Error: Call to undefined method J2Commerce\Component\J2commerce\Administrator\Helper\CartHelper::getCurrentCartId() ```
This isn't an edge case — it's on the main render path every group product goes through, in both the admin form and every frontend skin.
## Environment
- Joomla 6.1.3, J2Commerce 6.6.1 - **Group Products 6.0.5** (`plg_j2commerce_app_groupproducts`, id 1055), installed today (2026-09-11), enabled, Template Type = UIkit - Old Group Products 4.0.3 (`j2store` variant) present but disabled — not a factor
## Steps to reproduce
1. Edit any article that's a J2Commerce product with Product Type = Simple (or any non-group type).
2. J2Commerce tab → **Change Product Type** → **Group Products** → **Confirm Change**.
3. The J2Commerce tab immediately shows a generic **"Error loading J2Commerce product form."** notice and the panel renders empty. The product type change itself *did* persist to the database (`#__j2commerce_products.product_type = 'groupproducts'`).
4. Visit the product on the frontend (`index.php?option=com_j2commerce&view=product&id=id`) — full Joomla error page, HTTP 500.
Reproduced against article/product id 84/16 ("All 4 Pre-Printed Grid Practice Panels") on a sandbox category built for this test.
## Root cause (traced via a CLI reproduction outside the generic try/catch that normally hides this)
`ProductHelper::getFullProduct()` → `applyBehaviorEnhancements()` → `Groupproducts::onAfterGetProduct()` (`administrator/components/com_j2commerce/src/Model/Behavior/ Groupproducts.php:301`) calls:
```php $cartId = CartHelper::getInstance()-getCurrentCartId(); ```
`CartHelper` (`administrator/components/com_j2commerce/src/Helper/ CartHelper.php`) has **no `getCurrentCartId()` method at all** — not a typo-able near-miss, the method simply isn't defined anywhere in the installed J2Commerce 6.6.1 core. `grep -r getCurrentCartId` across the whole codebase turns up **8 call sites, all inside the Group Products app**, none inside a definition:
- `administrator/components/com_j2commerce/src/Model/Behavior/Groupproducts.php` (lines 301, 443) - `plugins/j2commerce/app_groupproducts/source/admin/Model/Behavior/Groupproducts.php` (lines 301, 443 — build source copy) - `plugins/j2commerce/app_groupproducts/source/site/templates/{uikit,bootstrap5}/view_groups.php` - `plugins/j2commerce/app_uikit/tmpl/{uikit,tag_uikit}/view_groups.php` - `plugins/j2commerce/app_bootstrap5/tmpl/{bootstrap5,tag_bootstrap5}/view_groups.php`
So it's not just the admin form and one frontend skin — it's every group-product render path in every installed J2Commerce skin (UIkit and Bootstrap 5), admin and site.
## Likely fix
`CartHelper` does have a method that resolves/creates the shopper's current cart — `getCart(int $cartId = 0, bool $needCreateCart = true, string $cartType = 'cart'): ?object` (doc-tagged `@since 6.0.6`), which returns a cart row including `j2commerce_cart_id`. That strongly suggests Group Products 6.0.5 was built against an earlier/different J2Commerce core API where `CartHelper` exposed a `getCurrentCartId()` convenience method directly, and that method was renamed or folded into `getCart()` at some point before 6.6.1 without every Group Products call site being updated to match. The fix is presumably either:
- restore a thin `getCurrentCartId(): int` convenience method on `CartHelper` that wraps `getCart()-j2commerce_cart_id ?? 0`, or - update all 8 Group Products call sites to `CartHelper::getInstance()-getCart()-j2commerce_cart_id ?? 0`.
## Impact
Group Products 6.0.5 cannot be used at all against this J2Commerce 6.6.1 install — every group product 500s on both the edit screen and the storefront the moment it's created. Since this is the app's entire purpose, this is release-blocking, not a minor bug.
## Note on error visibility
Worth a mention while you're in there: the admin article-edit field (`plg_content_j2commerce`'s `J2commerceField::getInput()`) catches every `\Throwable` and always shows the same generic "Error loading J2Commerce product form." message, and logs via `Factory::getApplication()-getLogger()-error()` — which, at least in this environment, doesn't appear to write to any file under `administrator/logs/` (no logger registered for that category by default). Finding this bug required reproducing the render outside the try/catch via a CLI script. A logged category with a file logger registered by default (or at minimum surfacing the exception message when Joomla's Debug System is on) would have made this a five-minute diagnosis instead of an hour.