VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: CindyW on February 29, 2020, 23:23:41 PM

Title: Shoppers list is missing
Post by: CindyW on February 29, 2020, 23:23:41 PM
When I click on "Orders and Shoppers" v 3.6.10, there are no shoppers listed and this is the error message I get:

1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '==0 ) GROUP BY ju.id ORDER BY ju.id DESC LIMIT 0, 30' at line 10

How can I fix this?
Title: Re: Shoppers list is missing
Post by: jjk on March 01, 2020, 00:10:39 AM
I happened to get the same error message yesterday after deleting a user (vendor) and added a new one.
You can try to change line 1634 in ...\administrator\components\com_virtuemart\models\user.php from
$whereAnd[] = ' vmu.user_is_vendor==0  ';
to
$whereAnd[] = ' vmu.user_is_vendor=0  ';

Make a backup first in case something goes wrong in your case.

The change should be included in the next VM release.
Title: Re: Shoppers list is missing
Post by: CindyW on March 01, 2020, 00:49:09 AM
Where is ...\administrator\components\com_virtuemart\models\user.php ?
Title: Re: Shoppers list is missing
Post by: Jörgen on March 01, 2020, 01:40:58 AM
This is the URL for the file from Your Joomla root directory on Your website. If You do not understand this You are better of getting help from someone who is familiar with Your website or is used to managing a PHP based website.

If You have for example CPANEL on your website You can edit the file, but if You haven´t done such things before, You should hire someone to help You out with this.

Jörgen @ Kreativ Fotografi
Title: Re: Shoppers list is missing
Post by: CindyW on March 01, 2020, 18:49:20 PM
This is lines 1630 through 1642      

1630                $whereAnd = array();
1631               if(VmConfig::get('multixcart',0)!='none' and $vendorId>1){
1632           $joinedTables .= ' LEFT JOIN #__virtuemart_vendor_users AS vu ON ju.id = vu.virtuemart_user_id';
1633                  $whereAnd[] = ' vu.virtuemart_vendor_user_id = '.$vendorId.' ';
1634            }
1635
1636              if(VmConfig::get('multixcart',0)!='none' and vmAccess::manager('managevendors')){
1637
1638            if ($this->searchTable=='vendors') {
1639            $whereAnd[] = ' vmu.virtuemart_vendor_id > 1 or (vmu.user_is_vendor>0 and vmu.virtuemart_vendor_id != "1")  ';
1640      } else if ($this->searchTable=='shoppers') {
1641            $whereAnd[] = ' vmu.user_is_vendor==0  ';
1642      }

Are you talking about line 1641?

Title: Re: Shoppers list is missing
Post by: Jörgen on March 01, 2020, 21:26:37 PM
I would guess so, search for the pattern and see if it exists in more places. Otherwise this should be it.

Jörgen @ Kreativ Fotografi
Title: Re: Shoppers list is missing
Post by: GJC Web Design on March 01, 2020, 22:05:27 PM
Yes -- its just a typo

should be

$whereAnd[] = ' vmu.user_is_vendor=0  ';