Why Virtuemart 2.0 shipment method works only for Registered users

Started by vengabg, August 02, 2012, 12:30:53 PM

Previous topic - Next topic

vengabg

Hello,
I use auto shipment method bicouse use only cash on delivery. When registered users buy from shop & checkout, shipment method is working fine.
If user dont use Login & password,  shop answered no shipment method.
I wont every budy to can buying from the online shop.

Can yoy help pls.

John2400

post an image of your shipment set up and just pick one product and post an image of the product information part.

franzpeter

My question to vengabg is:
how should Virtuemart know about the shipping cost if there is no user address. Normally shipping costs are calculated by user address.

John2400

hi franzpeter,

I think what is happening here is that only registered users appear to have a shipping method. It is not the address issue.

The guest buyers appear not to have any shipping appear 'after' they add their address.

so vengabg please post images of set ups so we can see , also I hope you have not ticked "only registered users can purchase good"

franzpeter

@John 2400

I had the same problem as described. But I figured out what the problem was. Did post the solution into: http://forum.virtuemart.net/index.php?topic=106034.0

John2400

hi Fanzpeter,

I think you have - default against a setting somewhere.? Like in products

Interesting - well it works for you.

BanquetTables in the other post  says exactly what I was looking for. 

They should be all blank and it works. That is not a setting I would recommend- they should all be blank-

vengabg_ just post those images - and we will all see what gives.

franzpeter

@ John 2400,

the only 'default' I have is in the migrated jos_virtuemart_order_userinfos (migration from VM 1). If you take a look into the database table jos_virtuemart_shipmentmethods there is one field defined as text field with the field name shipment_params. Default value is defined as NULL. If you configure the shipment method, virtuemart does insert all the configuration values into that text field, separated by a pipe (|). Leaving fields empty while configuring produces something like: |zip_start=""|, but the empty value with "" seems to mess up the shipping plugin. If you enter a 0 for example like |zip_start="0"| it works for default, anonymous and even not defined shoppergroup. The shoppergroup for shipment method is defined in table jos_virtuemart_shipmentmethod_shoppergroups as tinyint(1) with a default of 0. So the problem is not in that table, the problem occurs in the jos_virtuemart_shipmentmethods configuration row if a configuration remains empty. Did try it out on localhost and on web server, both with same result. Sorry, I am no good php code analyzer but it seems, that some part of the php code is not able to work with "" (empty).
That problem does not occur with the payment plugins. There it obviously does not matter to leave configuration fields empty in the payment_params. So there must be a difference in the php code for payment and shipping, while the code for shipping seems to handle the configuration values in a different way.