VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mabeall32 on February 07, 2012, 04:44:22 AM

Title: Attention no standard shopper group set
Post by: mabeall32 on February 07, 2012, 04:44:22 AM
I have installed 2.0.1e and now I get this.  if you are logged in it goes away.  it's only when you are not logged in.
Title: Re: Attention no standard shopper group set
Post by: mabeall32 on February 09, 2012, 03:28:59 AM
$kind value is set to 2 when not logged in; the field "default" is either 0 or 1 so the statement is always false.
administrator/components/com_virtuemart/models/shoppergroup.php
* Get default shoppergroup for anonymous and non anonymous
  * @param unknown_type $kind
  */
function getDefault($kind = 1){
  $kind = $kind + 1;       
  $this->_db->setQuery('SELECT * FROM `#__virtuemart_shoppergroups` WHERE `default` = "'.$kind.'" AND `virtuemart_vendor_id` = "1" ');
 
  if(!$res = $this->_db->loadObject()){
   $app = JFactory::getApplication();
   $app->enqueueMessage('Attention no standard shopper group set '.$this->_db->getErrorMsg());
  } else {
   return $res;
  }
}
Title: Re: Attention no standard shopper group set
Post by: Milbo on February 09, 2012, 12:38:31 PM
Then you do not have the anonymous shoppergroup, which has for default the value 2. Hmm I should readd the check for it in the updater
Title: Re: Attention no standard shopper group set
Post by: enock on February 09, 2012, 22:45:02 PM
I get this problem too

I checked the DB and the -anonymous- group had a virtuemart_shoppergroup_id of 1 - I manually changed it to 2 - still get Attention no standard shopper group set
Title: Re: Attention no standard shopper group set
Post by: Milbo on February 10, 2012, 00:37:32 AM
not the id the value of default
UPDATE `#__virtuemart_shoppergroups` SET `default`=2 WHERE `virtuemart_shoppergroup_id`=1
Title: Re: Attention no standard shopper group set
Post by: jacquedonald on February 11, 2012, 01:34:11 AM
Hello, I followed your instructions and the message goes away but when i attempt to create a new account and checkout with it, i get the message again in the cart
Attention no standard shopper group set
Attention no standard shopper group set
Attention no standard shopper group set
Attention no standard shopper group set
Attention no standard shopper group set
Attention no standard shopper group set
Attention no standard shopper group set

Just like so.
Title: Re: Attention no standard shopper group set
Post by: Milbo on February 11, 2012, 13:26:18 PM
Next version has a fixing tool, which should fix it, when you update.
Title: Re: Attention no standard shopper group set
Post by: jacquedonald on February 11, 2012, 14:12:30 PM
OK thanks for the reply, I downgraded the site back to 1.7 and I am not having the problems with the same version of VM (2.0.1f) - it must be a joomla 2.5 issue i would guess...
Title: Re: Attention no standard shopper group set
Post by: PRO on February 12, 2012, 14:24:19 PM
manually changing this worked forme

[attachment cleanup by admin]
Title: Re: Attention no standard shopper group set
Post by: Milbo on February 12, 2012, 15:21:14 PM
The virtuemart_shoppergroup_id is unimportant. You need only one group with "default" set to 1 and another to 2
Title: Re: Attention no standard shopper group set
Post by: jacquedonald on February 13, 2012, 07:19:13 AM
Yes I did this too in that table and it fixes it but it seems to come back after you make any other shop configuration changes as if some other proc is triggering it back.
I tried this a couple of times and it never stuck. The only way I completely got rid of it was to downgrade to joomla 1.7.
Title: Re: Attention no standard shopper group set
Post by: waldseedesign on February 26, 2012, 10:50:26 AM
Think i had a solution..

administrator/components/com_virtuemart/models/shoppergroup.php

Line 133-134:

function getDefault($kind = 1){
  $kind = $kind + 1;   

changed to:

function getDefault($kind = 1){
  $kind = $kind = 1;   

"Attention no standard shopper group set" is away
Title: Re: Attention no standard shopper group set
Post by: Thomas Kuschel on February 29, 2012, 16:06:06 PM
Hello, I had the same problem after upgrading 1.1.9 to 2.0.2
I got the Info "Attention no standard shopper group set";
also the Notice: Notice: Trying to get property of non-object in /home/tkuschel/workspaces/cms/joomla/administrator/components/com_virtuemart/views/user/view.html.php on line 232
In the backend, I got only my three Shopper Groups from the 1.1.9 version, but no -anonymous- group there.
First I reordered my table with the following SQL:
UPDATE `jos_virtuemart_shoppergroups` SET `virtuemart_shoppergroup_id` = `virtuemart_shoppergroup_id` +1 WHERE 1 ORDER BY `virtuemart_shoppergroup_id` DESC;

Now all other shopper groups are incremented by 1, then I added an "-anonymous-" group with the values
virtuemart_shoppergroup_id = 1, virtuemart_vendor_id = 1, shopper_group_name = "-anonymous-", and default=2;

INSERT INTO `cms`.`jos_virtuemart_shoppergroups` (`virtuemart_shoppergroup_id` ,`virtuemart_vendor_id` ,`shopper_group_name` ,`shopper_group_desc` ,`custom_price_display` ,`price_display` ,
`default` ,`ordering` ,`shared` ,`published` ,`created_on` ,`created_by` ,`modified_on` ,`modified_by` ,`locked_on` ,`locked_by`)
VALUES ('1', '1', '-anonymous-', 'This is an anonymous group.', '0', NULL , '2', '0', '0', '0', '2012-02-29 14:00:00', '42', '2012-02-29 14:00:00', '42', '0000-00-00 00:00:00', '0');


So I got rid off these messages, any further steps?

The postings before, to change the line 133 in shoppergroup.php would have side effects. The function getDefault() is used to get either the default or the anonymous shopper group.
BUT: there may be done a REWORK inside the shoppergroup.php; There is in line 153 / 159 also a bug??
$defaultSgId = $this->getDefault(0);
$anonymSgId = $this->getDefault(1);

foreach($ids as $id){

//Test if shoppergroup is default
if($id == $defaultId->virtuemart_shoppergroup_id){


The first generated object $defaultSgId is never used in this function / and the test is with an object $defaultId  :-(

Seen in Version VM 2.0.2

Regards
Thomas
Title: Re: Attention no standard shopper group set
Post by: Milbo on February 29, 2012, 16:58:24 PM
Using the update tool again helps most time also. I would try that first.

I also do not understand the "fix" of waldseedesign. It maps afaik wrong.
Title: Re: Attention no standard shopper group set
Post by: nicedoggie on February 29, 2012, 23:55:55 PM
Is there a fix for this? 

If so, what are the steps?
Title: Re: Attention no standard shopper group set
Post by: Milbo on March 01, 2012, 00:27:17 AM
use the updates/correct tables tool in the BE http://dev.virtuemart.net/projects/virtuemart/wiki/Tools
Title: Re: Attention no standard shopper group set
Post by: espatrizio on March 06, 2012, 16:45:57 PM
Hi all,
I've Joomla 2.5 and VirtueMart 2.0.2; I tried modifiing the file administrator/components/com_virtuemart/models/shoppergroup.php like this:

* Get default shoppergroup for anonymous and non anonymous
  * @param unknown_type $kind
  */
function getDefault($kind = 0){

And everithing seems to work; updating the value on the value in the database with the following script
UPDATE joomla.whlq6_virtuemart_shoppergroups SET `default`=2 WHERE `virtuemart_shoppergroup_id`=1;
everithing work since a new user will be registered, so this is not the optimal solution. Updating the shoppergroup.php seems to work also after a new user registration.

I hope to be useful..
Title: Re: Attention no standard shopper group set
Post by: RG on March 07, 2012, 17:31:33 PM
Had the same error with the newest of VC, Joomla, Wampserver.

The fix mentioned above worked instantly.
Tools - (Install tables or if necessary update them)
Title: Re: Attention no standard shopper group set
Post by: peter101 on March 10, 2012, 03:59:06 AM
Update worked for me thanks guys
Title: Re: Attention no standard shopper group set
Post by: beltoforion on April 02, 2012, 02:38:45 AM
hello, I have the same issue, with Joomla 2.5 Virtuemart 2.0.2.
Title: Re: Attention no standard shopper group set
Post by: mbarry on April 28, 2012, 16:41:17 PM
Hi, I have had same issue migrating to Joomla 2.5.4 and Virtuemart 2.0.6

If the migrate Tools run through to completion then it should create two default shopper groups (-anonymous- and -default-) the sql script that is called to do this is "install_required_data.sql" via script.virtuemart.php.
Shopper group -anonymous- has a 'default' value = 2 while -default- has 'default' =1

This all works fine until you want to change the Default shopper group from -default- to something else ie. you created a new shopper group called "Regular" and wanted this to be the default.

On changing the default to Regular, you will now find that Shoppers who are not logged in ie. Anonymous shoppers will now get the error message "Attention no standard shopper group set".

The problem is the function makeDefault($id,$kind = 1) (administrator/components/com_virtuemart/models/shoppergroup.php) as others have pointed to but for another reason.
The code first checks that you haven't tried to make the -anonymous- shopper the default for Registered users; this is correct.

It is the next line that is incorrect as it simply overwrites the 'default' values for all shopper groups with 0; now you no longer have an Anonymous shopper
$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = 0');

The code then goes on to set the new default shopper for registered users as expected.

The suggested fix to the above line is to change it to
$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = "0" WHERE `default` = "1"');
Now it will only reset the current default shopper group and leave the -anonymous- shopper group alone.

Finally, there appears to be another related problem wrt to shopper groups in function remove($ids) (administrator/components/com_virtuemart/models/shoppergroup.php) as pointed out by Thomas

$defaultSgId is never used.  The first test in this function is to prevent the Default shopper group from being deleted. The $defaultId should be changed to $defaultSgId otherwise the code will pass through and may delete it inadvertently should it reach the end of the tests.


I have tested both these suggested fixes by changing default shoppers, attempting to delete the anonymous shopper and attempting to delete the default shopper and appears to work as expected. The Admin page throws up the correct error messages while the shopper never sees the "Attention no standard shopper group set" error message.

I hope this helps, as a newbie to this forum I felt compelled to post what I had found after many long hours trying to migrate web site from Joomla 1.5.14 / Virtuemart 1.1.3. I'm not there yet, but these forums are really the only thing that makes it possible.



Title: Re: Attention no standard shopper group set
Post by: malibu2792 on April 30, 2012, 17:12:55 PM
Has anyone found a solution to this problem? I have been trying to fix this for about 2 hours.

As of right now, I have it where the error message is displaying when a shopper is not logged in. "Attention no standard shopper group set" When a user logs and is registered the message disappears.

I have updated the tables as instructed above.. tried almost everything I can think of.. Replaced the shoppergroup.php ( attached is the one I am currently using) I just want to get the site back to the way it was default.

I have tried installing an older version..

<?php
/**
*
* Data model for shopper group
*
* @package   VirtueMart
* @subpackage ShopperGroup
* @author Markus Öhler
* @author Max Milbers
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: shoppergroup.php 5419 2012-02-10 19:27:53Z Milbo $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

// Load the model framework
jimport( 'joomla.application.component.model');

if(!class_exists('VmModel'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'vmmodel.php');

/**
* Model class for shopper group
*
* @package   VirtueMart
* @subpackage ShopperGroup
* @author Markus Öhler
*/
class VirtueMartModelShopperGroup extends VmModel {

   /**
    * constructs a VmModel
    * setMainTable defines the maintable of the model
    * @author Max Milbers
    */
   function __construct() {
      parent::__construct('virtuemart_shoppergroup_id');
      $this->setMainTable('shoppergroups');
   }

    /**
     * Retrieve the detail record for the current $id if the data has not already been loaded.
     *
     * @author Markus Öhler
     */
    function getShopperGroup() {

       if (empty($this->_data)) {
         $this->_data = $this->getTable('shoppergroups');
         $this->_data->load((int) $this->_id);
         if(!empty($this->_data->price_display)){
            $this->_data->price_display = unserialize($this->_data->price_display);
         } else{
            if(!class_exists('JParameter')) require(JPATH_VM_LIBRARIES.DS.'joomla'.DS.'html'.DS.'parameter.php' );
            $this->_data->price_display = new JParameter('');
         }
      }

      return $this->_data;
   }


    /**
     * Retireve a list of shopper groups from the database.
     *
     * @author Markus Öhler
     * @param string $noLimit True if no record count limit is used, false otherwise
     * @return object List of shopper group objects
     */
    function getShopperGroups($onlyPublished=false, $noLimit = false) {
       $db = JFactory::getDBO();

       $query = 'SELECT * FROM `#__virtuemart_shoppergroups` ORDER BY `virtuemart_vendor_id`,`shopper_group_name` ';

      if ($noLimit) {
         $this->_data = $this->_getList($query);
      }
      else {
         $this->_data = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));
      }

       return $this->_data;
    }

   function store($data){

      $myfields = array('basePrice','variantModification','basePriceVariant',
                                 'basePriceWithTax','basePriceWithTax','discountedPriceWithoutTax',
                                 'salesPriceWithDiscount','salesPrice','priceWithoutTax',
                                 'discountAmount','taxAmount');

      $param ='show_prices='.$data['show_prices']."\n";
      foreach($myfields as $fields){
         $param .= $fields.'='.$data[$fields]."\n";      //attention there must be doublequotes
         $param .= $fields.'Text='.$data[$fields.'Text']."\n";
         $param .= $fields.'Rounding='.$data[$fields.'Rounding']."\n";
      }

      if(!class_exists('JParameter')) require(JPATH_VM_LIBRARIES.DS.'joomla'.DS.'html'.DS.'parameter.php' );
      $jparam = new JParameter($param);
      $data['price_display'] = serialize(new JParameter($param));

      return parent::store($data);
   }

   function makeDefault($id,$kind = 1) {

      //Prevent making anonymous Shoppergroup as default
      $adId = $this->getDefault(1);
      if($adId == $id){
         vmError(JText::sprintf('COM_VIRTUEMART_SHOPPERGROUP_DELETE_CANT_DEFAULT',$name,$id));
         return false;
      }
      $this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = 0');
      if (!$this->_db->query()) return ;
      $this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = "'.$kind.'" WHERE virtuemart_shoppergroup_id='.(int)$id);
      if (!$this->_db->query()) return ;
      return true;
   }

   /**
    *
    * Get default shoppergroup for anonymous and non anonymous
    * @param unknown_type $kind
    */
   function getDefault($kind = 1){

      $kind = $kind + 1;
      $this->_db->setQuery('SELECT * FROM `#__virtuemart_shoppergroups` WHERE `default` = "'.$kind.'" AND `virtuemart_vendor_id` = "1" ');

      if(!$res = $this->_db->loadObject()){
         $app = JFactory::getApplication();
         $app->enqueueMessage('Attention no standard shopper group set '.$this->_db->getErrorMsg());
      } else {
         return $res;
      }

   }

   function remove($ids){

      jimport( 'joomla.utilities.arrayhelper' );
      JArrayHelper::toInteger($ids);

      $table = $this->getTable($this->_maintablename);

      $defaultSgId = $this->getDefault(0);
      $anonymSgId = $this->getDefault(1);

      foreach($ids as $id){

         //Test if shoppergroup is default
         if($id == $defaultId->virtuemart_shoppergroup_id){
            $this->_db->setQuery('SELECT shopper_group_name FROM `#__virtuemart_shoppergroups`  WHERE `virtuemart_shoppergroup_id` = "'.(int)$id.'"');
            $name = $this->_db->loadResult();
            vmError(JText::sprintf('COM_VIRTUEMART_SHOPPERGROUP_DELETE_CANT_DEFAULT',$name,$id));
            continue;
         }

         //Test if shoppergroup is default
         if($id == $anonymSgId->virtuemart_shoppergroup_id){
            $this->_db->setQuery('SELECT shopper_group_name FROM `#__virtuemart_shoppergroups`  WHERE `virtuemart_shoppergroup_id` = "'.(int)$id.'"');
            $name = $this->_db->loadResult();
            vmError(JText::sprintf('COM_VIRTUEMART_SHOPPERGROUP_DELETE_CANT_DEFAULT',$name,$id));
            continue;
         }

         //Test if shoppergroup has members
         $this->_db->setQuery('SELECT * FROM `#__virtuemart_vmuser_shoppergroups`  WHERE `virtuemart_shoppergroup_id` = "'.(int)$id.'"');
         if($this->_db->loadResult()){
            $this->_db->setQuery('SELECT shopper_group_name FROM `#__virtuemart_shoppergroups`  WHERE `virtuemart_shoppergroup_id` = "'.(int)$id.'"');
            $name = $this->_db->loadResult();
            vmError(JText::sprintf('COM_VIRTUEMART_SHOPPERGROUP_DELETE_CANT_WITH_MEMBERS',$name,$id));
            continue;
         }

         if (!$table->delete($id)) {
            vmError(get_class( $this ).'::remove '.$table->getError());
            return false;
          }
      }

      return true;
   }

   /**
    * Retrieves the Shopper Group Info of the SG specified by $id
    *
    * @todo Vendor ID
    * @param int $id
    * @param boolean $default_group
    * @return array
    */
     function getShoppergroupById($id, $default_group = false) {
       $virtuemart_vendor_id = 1;
       $db = JFactory::getDBO();

       $q =  'SELECT `#__virtuemart_shoppergroups`.`virtuemart_shoppergroup_id`, `#__virtuemart_shoppergroups`.`shopper_group_name`, `default` AS default_shopper_group FROM `#__virtuemart_shoppergroups`';

       if (!empty($id) && !$default_group) {
            $q .= ', `#__virtuemart_vmuser_shoppergroups`';
            $q .= ' WHERE `#__virtuemart_vmuser_shoppergroups`.`virtuemart_user_id`="'.(int)$id.'" AND ';
            $q .= '`#__virtuemart_shoppergroups`.`virtuemart_shoppergroup_id`=`#__virtuemart_vmuser_shoppergroups`.`virtuemart_shoppergroup_id`';
       }
       else {
          $q .= ' WHERE `#__virtuemart_shoppergroups`.`virtuemart_vendor_id`="'.(int)$virtuemart_vendor_id.'" AND `default`="2"';
       }

       $db->setQuery($q);
       return $db->loadAssoc();
     }

}
// pure php no closing tag
Title: Re: Attention no standard shopper group set
Post by: mbarry on May 01, 2012, 14:10:12 PM
Hi malibu2792

your posted code still has both bugs in it.

Suggest using the latest version of shoppergroup.php and make the following changes

In Function makeDefault($id,$kind = 1)

$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = "0" WHERE `default` = "1"');

and function remove($ids)

if($id == $defaultSgId->virtuemart_shoppergroup_id)

Once you have made changes you will need to also update Table #__virtuemart_shoppergroups

INSERT INTO `#__virtuemart_shoppergroups` (`virtuemart_shoppergroup_id`, `virtuemart_vendor_id`, `shopper_group_name`, `shopper_group_desc`, `default`, `shared`, `published`) VALUES
(2, 1, '-default-', 'This is the default shopper group.', 1, 1, 1),                   <----- The modified code above will set this to "0" when the default shopper group is changed
(1, 1, '-anonymous-', 'Shopper group for anonymous shoppers', 2, 1, 1);            <----- This is the important entry, the original code would also set this to "0"; there should be no reason to change this, in fact, the code does not allow you to delete the -anonymous- shoppergroup nor make it the default shopper for registered shoppers.

I have attached my version of shoppergroup.php which fixed the problem for me.

Hope this helps.


[attachment cleanup by admin]
Title: Re: Attention no standard shopper group set
Post by: Milbo on May 02, 2012, 16:53:43 PM
Quote from: mbarry on April 28, 2012, 16:41:17 PM
The problem is the function makeDefault($id,$kind = 1) (administrator/components/com_virtuemart/models/shoppergroup.php) as others have pointed to but for another reason.
The code first checks that you haven't tried to make the -anonymous- shopper the default for Registered users; this is correct.

It is the next line that is incorrect as it simply overwrites the 'default' values for all shopper groups with 0; now you no longer have an Anonymous shopper
$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = 0');

Thanks, fixed ! Btw my fix works so

$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = 0 WHERE `default`<"2"');
Title: Re: Attention no standard shopper group set
Post by: burntwear on July 06, 2012, 10:11:28 AM
I found out the hard way about this error after changing anonymous shopper group to default then back (experiment) then I got this error, I was afraid to use the updates/correct tables tool as was suggested here due to some of the other comments here about missing images, I tried modify the shoppergroup.php with no luck (maybe I did something wrong) , I next upgraded to 2.08 possibly some template error or something else but I go a new error "getProductPrices no object given query time" so I downloaded 2.06 and overwritten the 2.08 files back to a fresh start the error gone. I still need to figure out how to get florida taxes not to show untill a user enters their address which is why I was experimenting with the shoppergroup in the first place.
Title: Re: Attention no standard shopper group set
Post by: spyderwebdesign on August 06, 2012, 17:49:04 PM
Quote from: mbarry on May 01, 2012, 14:10:12 PM
Once you have made changes you will need to also update Table #__virtuemart_shoppergroups

INSERT INTO `#__virtuemart_shoppergroups` (`virtuemart_shoppergroup_id`, `virtuemart_vendor_id`, `shopper_group_name`, `shopper_group_desc`, `default`, `shared`, `published`) VALUES
(2, 1, '-default-', 'This is the default shopper group.', 1, 1, 1),                   <----- The modified code above will set this to "0" when the default shopper group is changed
(1, 1, '-anonymous-', 'Shopper group for anonymous shoppers', 2, 1, 1);            <----- This is the important entry, the original code would also set this to "0"; there should be no reason to change this, in fact, the code does not allow you to delete the -anonymous- shoppergroup nor make it the default shopper for registered shoppers.

I am trying to run this fix and I get an sql error.

INSERT INTO `#__virtuemart_shoppergroups` (`virtuemart_shoppergroup_id`, `virtuemart_vendor_id`, `shopper_group_name`, `shopper_group_desc`, `default`, `shared`, `published`) VALUES (2, 1, '-default-', 'This is the default shopper group.', 1, 1, 1),

#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 '' at line 1

Can someone please post the exact sql statement to run?
Title: Re: Attention no standard shopper group set
Post by: spyderwebdesign on August 06, 2012, 18:12:31 PM
Quote from: spyderwebdesign on August 06, 2012, 17:49:04 PM
Quote from: mbarry on May 01, 2012, 14:10:12 PM
Once you have made changes you will need to also update Table #__virtuemart_shoppergroups

INSERT INTO `#__virtuemart_shoppergroups` (`virtuemart_shoppergroup_id`, `virtuemart_vendor_id`, `shopper_group_name`, `shopper_group_desc`, `default`, `shared`, `published`) VALUES
(2, 1, '-default-', 'This is the default shopper group.', 1, 1, 1),                   <----- The modified code above will set this to "0" when the default shopper group is changed
(1, 1, '-anonymous-', 'Shopper group for anonymous shoppers', 2, 1, 1);            <----- This is the important entry, the original code would also set this to "0"; there should be no reason to change this, in fact, the code does not allow you to delete the -anonymous- shoppergroup nor make it the default shopper for registered shoppers.

I am trying to run this fix and I get an sql error.

INSERT INTO `#__virtuemart_shoppergroups` (`virtuemart_shoppergroup_id`, `virtuemart_vendor_id`, `shopper_group_name`, `shopper_group_desc`, `default`, `shared`, `published`) VALUES (2, 1, '-default-', 'This is the default shopper group.', 1, 1, 1),

#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 '' at line 1

Can someone please post the exact sql statement to run?

I figured it out. The very end should have ; and not ,

You also have to set your table name #__virtuemart_shoppergroups to yourprefix_virtuemart_shoppergroups

This still didn't fix the error msg. I even reverted my php file back and then went into the database and changed the default value to 2.
Title: Re: Attention no standard shopper group set
Post by: spyderwebdesign on August 14, 2012, 22:13:51 PM
It's been a week and I still can't get rid of the "Attention no standard shopper group set" error message that shows on every single page of my store. Does anyone have a working solution for 2.0.6?
Title: Re: Attention no standard shopper group set
Post by: Milbo on August 15, 2012, 18:06:36 PM
The easiest solution is to go in the table and ensure that one group and only one has the 1 set in the field default.
Title: Re: Attention no standard shopper group set
Post by: spyderwebdesign on August 15, 2012, 18:16:15 PM
Quote from: Milbo on August 15, 2012, 18:06:36 PM
The easiest solution is to go in the table and ensure that one group and only one has the 1 set in the field default.

Thanks for chiming in Milbo. Unfortunently, I have only one group set to 1 in the default field.

[attachment cleanup by admin]
Title: Re: Attention no standard shopper group set
Post by: burtonent on August 28, 2012, 05:01:19 AM
Just wanted to note that if you already have an anonymous shopper group that's set to 2 in vm 2.0.8 and it still shows std shopper group not set, you can update the tables and often it will add an anonymous shopper with a higher id, in my case, 9.  Go to MySQL under jos_virtuemart_shoppergroups and locate the anonymous shoppergroup withhigher id and change it to 2.  The go back to vm 2 backend and tick the original anonymous shoppergroup you had and click delete.  It will give you an error message that you can't delete a shopergroup with the id 2, but when it does, it will delete it and replace with the one you changed in jos tables.
Title: Re: Attention no standard shopper group set
Post by: tlove21 on October 26, 2012, 15:12:21 PM
In the latest release simply enable anonymous in the shopper groups. If your still getting this.
Title: Re: Attention no standard shopper group set
Post by: stinka on December 01, 2012, 09:33:25 AM
Thank you, Milbo!
The last suggestion you made worked for me.
Title: Re: Attention no standard shopper group set
Post by: lupinlady on January 29, 2014, 09:46:56 AM
Quote from: Milbo on May 02, 2012, 16:53:43 PM
Quote from: mbarry on April 28, 2012, 16:41:17 PM
The problem is the function makeDefault($id,$kind = 1) (administrator/components/com_virtuemart/models/shoppergroup.php) as others have pointed to but for another reason.
The code first checks that you haven't tried to make the -anonymous- shopper the default for Registered users; this is correct.

It is the next line that is incorrect as it simply overwrites the 'default' values for all shopper groups with 0; now you no longer have an Anonymous shopper
$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = 0');

Thanks, fixed ! Btw my fix works so

$this->_db->setQuery('UPDATE  `#__virtuemart_shoppergroups`  SET `default` = 0 WHERE `default`<"2"');


I added the fix here to post#22 & #23. Now I can create an account OK, Login, and update account info. Also after logging in I can select the Dealer Only Store,but when I click a category link I get this message:

500 Internal Server Error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.

Also in the admin area, everything works fine in User Manager but when I go to VirtueMart admin area, then Shopper List, user shows in list but when I click link to view the new user profile I get the same error message. But I can click the users created before this fix with no problem.

This all started when I deleted an unused Shopper Group called -shopper-. Any ideas?
Title: Re: Attention no standard shopper group set
Post by: Michael West on November 20, 2014, 11:38:31 AM
The default shopper group must have an ID of 2. Regardless of the shopper group name.

[attachment cleanup by admin]