News:

Looking for documentation? Take a look on our wiki

Main Menu

Recent posts

#41
Category pagination — cannot return to page 1 when SEF enabled (limitstart lost, session retains last page)

Version: VirtueMart 4.6.8 (11258), Joomla 5.4.6, PHP 8.x, Joomla core SEF enabled (no third-party SEF/router)
Summary:

On a category with more than one page of products, navigating to page 2 and then clicking the "1" (or "Start"/"Prev") pagination link does not return the visitor to page 1. The page reloads still showing page 2.
Steps to reproduce:

Enable Joomla SEF URLs.
Open a category with 2+ pages of products (default limit, e.g. 12 per page).
Click "2" — URL becomes /category/results,13-24, page 2 displays correctly.
Click "1" (or « / ‹).
Observed: browser navigates to the bare category URL /category and page 2 is still shown.
Expected: page 1 is displayed.

Root cause (traced):
Two interacting pieces of core code:

In administrator/components/com_virtuemart/models/product.php (setPaginationLimits), when the visitor is already within the same category/manufacturer, limitStart is read via getUserStateFromRequest() against a per-category session key (com_virtuemart.<view>c<cateid>m<manid>.limitstart). This only overrides the stored session value if limitstart is explicitly present in the request.

In components/com_virtuemart/router.php, the build routine only emits a results,X-Y segment when limitstart > 0. For page 1 (limitstart = 0) no segment is added, so the page-1 pagination link is generated as the bare category URL. Joomla's SEF router additionally strips limitstart=0 as it equals the default.

Result: the page-1 link carries no page position. When it loads, getUserStateFromRequest() finds no limitstart in the request and falls back to the session value, which still holds the offset for page 2 — so the visitor is stuck on page 2.

Note: This only reproduces with an active session already advanced past page 1. A fresh/cookieless request to /category/results,1-12 returns page 1 correctly, which is why it can look intermittent.

Suggested fix direction:
Either (a) have the router emit an explicit results,1-N segment for limitstart = 0 so the page-1 link isn't collapsed to the bare URL, or (b) in the category model, treat a request with no limitstart/start parameter as page 1 rather than inheriting the stored session offset.
#42
VmMediaHandler::$theme_url is never assigned, breaking the "no image" placeholder URL (front and admin)

Environment
  • VirtueMart 4.6.8
  • Joomla 5.4.6
  • PHP 8.1 / 8.5

Summary
The static property VmMediaHandler::$theme_url is declared as null and is never assigned anywhere in the codebase (I checked both the site and administrator sides, including the legacy VmMedia class). Because of that, every "no image" placeholder built from it resolves to a broken URL that is missing the components/com_virtuemart/ segment.

Where it happens
In administrator/components/com_virtuemart/helpers/mediahandler.php:

// line 45
static $theme_url = null;

// line 591, inside setNoImageSet()
$this->file_url_folder = self::$theme_url.'assets/images/vmgeneral/';

// line 736, inside getIcon()
$tC = self::$theme_url.'assets/images/vmgeneral/filetype_'.$this->file_extension.'.png';

// line 751, inside getIcon()
$file_url = self::$theme_url.'assets/images/vmgeneral/'.VmConfig::get('no_image_found');

Since $theme_url is always null, the concatenation collapses to just assets/images/vmgeneral/..., with the components/com_virtuemart/ prefix missing entirely.

Then in displayIt() (same file, around line 785):

if( substr( $this->file_url, 0, 2) == "//"  or substr( $this->file_url, 0, 4) == "http" ) {
} else if($absUrl){
$root = JURI::root(false);
} else {
$root = JURI::root(true).'/';
}
...
$imageArgs['src'] = $root.$file_url;

On a shop installed at the domain root, JURI::root(true) returns an empty string, so $root becomes just /. The final src ends up as:

/assets/images/vmgeneral/noimage_new.gif
instead of the correct:

/components/com_virtuemart/assets/images/vmgeneral/noimage_new.gif
The correct path is confirmed elsewhere in core, for example in administrator/components/com_virtuemart/models/config.php (around line 222), which hardcodes:

$dirs[] = VMPATH_ROOT.'/components/com_virtuemart/assets/images/vmgeneral';
Steps to reproduce
  • Create or open a manufacturer with no logo assigned.
  • Go to Manufacturer > Edit > Images tab.
  • Inspect the placeholder image: src="/assets/images/vmgeneral/noimage_new.gif", which 404s.

The same broken prefix affects any entity that falls back to setNoImageSet() or the getIcon() fallback (vendor, product, category, etc.) whenever no image/file is set, on both front and back end.

Suggested fix
Assign VmMediaHandler::$theme_url to 'components/com_virtuemart/' (the same segment already hardcoded in config.php) at class init, or replace the direct use of self::$theme_url in setNoImageSet() and getIcon() with a call that returns that path directly, since the property is currently dead weight that is only ever read, never written.

Happy to test a patch on a staging VM 4.6.8 / Joomla 5.4.6 install if useful.
#43
Frontend Modules / Re: VirtueMart Search Product ...
Last post by iWim - July 06, 2026, 07:58:22 AM
Open the VM search module.
Under tab Module set the option Search Filter Category to No.
#44
Frontend Modules / VirtueMart Search Product how ...
Last post by Emma Iana - July 05, 2026, 22:20:58 PM
How can I make VirtueMart Search Product search across all products rather than just the category in which the module is embedded?
#45
General Questions / Re: Google Merchant Center Pro...
Last post by p.barg - July 01, 2026, 12:04:15 PM
Hi,

we are using CVSI for the export of Google Feeds.

Best regards,

Petra
#46
General Questions / Re: Issues with add to Cart . ...
Last post by hotrod - June 30, 2026, 23:27:33 PM
I moved on to the J4 site I built 2 years ago..  No Issues..  Now I am going to work on moving to J5
#47
Installation, Migration & Upgrade / Re: Error after VM update
Last post by PRO - June 30, 2026, 21:26:06 PM
have you looked up if there is a duplicate? category_child_id
#48
General Questions / Re: Issues with add to Cart . ...
Last post by PRO - June 30, 2026, 16:37:17 PM
have you tested the default theme?

nobody can look without a url
#49
General Questions / Re: Google Merchant Center Pro...
Last post by PRO - June 30, 2026, 16:35:45 PM
Have you ever tried using schema ?
#50
Thank You... Found this issue also drove me nuts...  ChatGPT made it very simple..  Here is the detailed info...

/public_html/components/com_virtuemart/sublayouts/snippets.php

Replace:

if ($finalstk != 0) {
    $stockog = 'InStock';
}
if ($finalstk == 0) {
    $stockog = 'OutOfStock';
}

with:

$stockog = 'InStock';

That's all you need.