Fixed Virtuemart -default- shopper group

Please post your issues and questions about One Page Checkout for Virtuemart 2 to this forum.

Fixed Virtuemart -default- shopper group

Postby marcovanhattem@.....com » Fri Aug 30, 2013 9:15 am

Why does it do this?

I don't want the -default- shopper group to be the default.
Attachments
fixed_shopper_group.PNG
fixed_shopper_group.PNG (3.95 KiB) Viewed 23633 times
marcovanhattem@.....com
 
Posts: 20
Joined: Wed Aug 28, 2013 10:04 am

Re: Fixed Virtuemart -default- shopper group

Postby admin » Fri Aug 30, 2013 4:44 pm

Hello, we apologize for this hard fix, but virtuemart's core code relies on a very specific database structure within the default and anoanymous shopper groups, all of the columns (except their name) must have a specific ID and other settings. OPC had fixed this to prevent issues like
- emails do not work
- calculation do not work
- payemnt does not display
and many many other that rely on specific IDs of the -default- and -anonymous- groups

You may want to create another groups and use them in your whole system, but you should not alter the configuration of these two groups especially in matters of their IDs, marked as shared or others. You may rename them to whatever you'd like.

as an example we provide a code from the latest VM version:

Code: Select all
/**
    *
    * Get default shoppergroup for anonymous and non anonymous
    * @param unknown_type $kind
    */
   function getDefault($kind = 1, $onlyPublished = FALSE, $vendorId = 1){

      $kind = $kind + 1;
      $q = 'SELECT * FROM `#__virtuemart_shoppergroups` WHERE `default` = "'.$kind.'" AND (`virtuemart_vendor_id` = "'.$vendorId.'" OR `shared` = "1") ';
      if($onlyPublished){
         $q .= ' AND `published`="1" ';
      }
      $this->_db->setQuery($q);

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

   }

\components\com_virtuemart\models\shoppergroup.php

this code explicitely requires to have a default shopper group have default column value 2, shared to set 1. There are many other reasons why we included this VM fix in OPC and if it causes any issues for you, we will be glad to fix them for you, or update our code to suit you better.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Fixed Virtuemart -default- shopper group

Postby marcovanhattem@.....com » Fri Aug 30, 2013 10:47 pm

Thanks for the reply I adjusted all my products to show up for the default shopper group as well again so should not be an issue anymore. Just came as a surprise.
cheers
Marco
marcovanhattem@.....com
 
Posts: 20
Joined: Wed Aug 28, 2013 10:04 am

Re: Fixed Virtuemart -default- shopper group

Postby simonJae » Tue Sep 09, 2014 2:57 am

Hi Stan

I am getting this error also.. though I felt it was resolved. Also I am seeing the following error when I open OPC:

Code: Select all
Column 'price_display' cannot be null SQL=INSERT INTO `jev8g_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 (2, 1, '-default-', 'This is the default shopper group.', 0, NULL, 1, 0, 1, 1, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0, '0000-00-00 00:00:00', 0)
Fixed Virtuemart -default- shopper group which is required for proper Virtueamrt functionality. Please check the configuration of your shipping, payment, calculation plugins.



I have checked and double checked the configurations


Simon
simonJae
 
Posts: 14
Joined: Thu Sep 04, 2014 2:36 am

Re: Fixed Virtuemart -default- shopper group

Postby admin » Tue Sep 09, 2014 12:35 pm

hello, upon visiting opc backend, it does checks for proper virtuemart installation. some issues like the shopper groups that have improper IDs from VM view may cause problems on your site. Virtuemart requires anonymous shopper group to have an ID of 1 and logged in default users to have an ID of anonymous plus one, i.e. 2. If a shopper group with ID 1 or ID2 are missing, this will result to a broekn VM shop and you may experience lot's of different problems. The query that tried to insert the -default- shopper group was prepared for Virtuemart 2.0.15+ and it seems that in the very latest Virtuemart, the database structure had changed and the query must be updated. Even when the new "BLOB" column type does not support "NULL", it seems that VM is also still using NULL values for this purpose. The problem value here should be an empty string now: '' We will check this with VM team.

Best Regards, Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Fixed Virtuemart -default- shopper group

Postby simonJae » Fri Sep 12, 2014 7:43 am

Hi Stan...
Is it correct that both "anonymous" and Default have a "price_display" (both!!) of " [BLOB - 2 B]

Simon
simonJae
 
Posts: 14
Joined: Thu Sep 04, 2014 2:36 am

Re: Fixed Virtuemart -default- shopper group

Postby simonJae » Fri Sep 12, 2014 7:54 am

Another quick question...

If there is no need to login to purchase... should the 'default' shopper be "Anonymous"
simonJae
 
Posts: 14
Joined: Thu Sep 04, 2014 2:36 am

Re: Fixed Virtuemart -default- shopper group

Postby admin » Sun Sep 14, 2014 6:41 pm

hello, the default and anonymous shopper groups are already discussed on this forum and there is also an explanation why opc checks these. VM2.0.0 to VM2.6.x requried to have a very specific IDs of the anonymous and default shopper groups. i had built an opc version that does not do those checks and sent it to your email. Let us know if this helped it. We will be considering to remove these checks from OPC.

best regards, stan, rupostel.com
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 2

cron