Shipment Method Shopper group conflict in checkout page?

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

Shipment Method Shopper group conflict in checkout page?

Postby atrus80 » Thu Jun 05, 2014 10:52 am

Hi Stan,

Noted the following issue with latest VM2 versions and OPC, cannot tell where the problem is :)

1. Go to http://www.quality-tuning.eu
2. Log in as a wholesale user (Credentials: xondriki/xondriki)
3. Add a product in cart and go to checkout. For example add a variant of the following product: http://www.quality-tuning.eu/acura-cl-ya1-96-00-k-sport-coilover-suspension
4. You will see two shipment methods:

a) FREE Shipping with TNT Economy - Delivery Time: 5 Business Days - This is wrong, this method is not assigned to wholesale shopper group but to anonymous-EU (VM2 default) and eu-retail shopper groups.
b) TNT Economy - Delivery Time: 5 Business Days (4-5 kg) (Discount/Fee: 35,00 €) - This is correct

I'm not sure if VM2.6.x is the reason or any latest version of OPC, but i can remember that there was no issue before (i.e. shipment method a) was not appearing for wholesale customers)

Would appreciate your advice!

Rgrds,
Chris
atrus80
 
Posts: 85
Joined: Mon Feb 06, 2012 6:22 pm

Re: Shipment Method Shopper group conflict in checkout page?

Postby admin » Thu Jun 05, 2014 1:00 pm

hello chris, i just checked my demo on vm2.6.6 and i do see the same problem - the shopper groups work only on SOME methods - not all. i am going to investigate this deeper, it seems like a VM issue.

best regards,
sta
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Shipment Method Shopper group conflict in checkout page?

Postby admin » Thu Jun 05, 2014 1:09 pm

hello chris, i disabled opc and i see that the same behavior occurs on pure VM code. pls post this issue on VM forums, so it gets solved asap, i am going to find the cause as well.
best regards,
stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Shipment Method Shopper group conflict in checkout page?

Postby admin » Thu Jun 05, 2014 3:37 pm

hello chris, Virtuemart team for now had decided that the logged in user cannot be ONLY in the wholesale group and he always gets the default group as well. To reverse this logic to previous VM versions you may want to update your core code until further explanation of the goal is given:

locate:
\administrator\components\com_virtuemart\models\shoppergroup.php


Updated function with
Code: Select all
$keepDefault = false;


Replace the function with this code:
Code: Select all
function appendShopperGroups(&$shopperGroups,$user,$onlyPublished = FALSE,$vendorId=1,$keepDefault = false){

      $this->mergeSessionSgrps($shopperGroups);
      
      $keepDefault = false;
      if(count($shopperGroups)<1 or $keepDefault){

         $_defaultShopperGroup = $this->getDefault($user->guest,$onlyPublished,$vendorId);
         
         if(!in_array($_defaultShopperGroup->virtuemart_shoppergroup_id,$shopperGroups)){
            $shopperGroups[] = $_defaultShopperGroup->virtuemart_shoppergroup_id;
         }
      }
      
      $this->removeSessionSgrps($shopperGroups);

   }


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

Re: Shipment Method Shopper group conflict in checkout page?

Postby atrus80 » Fri Jun 06, 2014 11:53 am

Thanks Stan,

Weird change indeed from VM2 team!

Well, i added the $keepDefault = false; in the appendShopperGroups function but i get the same problem, can u pls reconfirm?

Rgrds,
Chris
atrus80
 
Posts: 85
Joined: Mon Feb 06, 2012 6:22 pm

Re: Shipment Method Shopper group conflict in checkout page?

Postby admin » Fri Jun 06, 2014 12:26 pm

hello chris, not in my case. you must logout, close the browser, and try again. this stuff is saved in session, so you must get rid of the session.

in the max case, you may need to delete browser's cookies, but i believe that for new-comers to your site this will not repeat. (as the session will no longer include the default group)

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

Re: Shipment Method Shopper group conflict in checkout page?

Postby admin » Fri Jun 06, 2014 7:17 pm

hello, to be exact, i had released an opc update 2.0.248 where this issue is addressed.

the problem was caused by merging session with an unlogged user and thus the logged in user shared previous user's (anymous) shopper group. In your case that was the shopper group per joomla language. i had added code to opc to clear shopper group configuration upon a sucessfull login.

THE CORE CODE PATCH ABOVE IS NO LONGER NEEDED FOR THIS FUNCTIONALITY TO WORK WITH OPC.

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


Return to One Page Checkout for Virtuemart 2