News:

Looking for documentation? Take a look on our wiki

Main Menu

Turn off error report: "missing value for" in shoping cart

Started by Pejo, December 20, 2013, 00:21:45 AM

Previous topic - Next topic

Pejo

Hi,

Joomla 2.5.17
VirtueMart 2.0.26

I know why this (lets call it error, but I know it isn't, it is some kind of report) is showing, because after registration, customer didn't enter all needed data, such as, Name, address, Country, etc.

So what is the problem? Problem is that a lot of customers after registration doesn't know that they have register under joomla, and that they have to enter their other data for VirtueMart check out.
Problem is when customer is entering cart. After entering cart, you got message such as:

Missing Value for first name
Missing Value for second name
Missing Value for Address 1
Missing Value for city
Missing Value for Country
Please, confirm that you agree with our Terms of conditions


This error/notification is OK after customer/buyer press "confirm order", because if buyer did not insert his address, he need to insert it first, so after pressing "confirm order" this error must be shown, but I don't wont it to be show immediately entering cart.

Is there way to hide this entering cart?
Thanks.

AH

THis is probably because you have a default country set in the country_id field

If you remove the default value I think you will be ok
Regards
A

Joomla 3.10.11
php 8.0

rizecorp

Is there any alternate solution for the above missing value issue with joomla 2.0.26.
That issue will not repeat once you filled those fields by clicking on the "Add/Edit billing address information" and save.

Thanks in advance.

rizecorp

Hi All,

Joomla 2.5.16
VirtueMart 2.0.26

  Here we are using joomla registration and not virtuemart registration as some users are not necessarily shoopers. After registration and logged in from the front end to purchase the product and click on the "add to cart" button & click on the "show cart" then we have an issue like below screenshot:
 

 
 
  We have configured "Canada" and "United States" as the default countries for all the users.
  Please let me know the solution to avoid the issue.
 
Thanks
Rizecorp

[attachment cleanup by admin]

AH

Regards
A

Joomla 3.10.11
php 8.0

rizecorp

Hi Hutson,

  Thank you for the reply.

I have upgraded the virtuemart to the latest version 2.0.26a and tested by registering the new user and tried to checkout. Still issue is not solved. Please let me know if any alternate solution.

Thanks
Rizecorp

AH

components\com_virtuemart\helpers\cart.php

When a default country is set in the userfield virtuemart_country_id

On entry to the Checkout

The process behaves as though the BT address has been completed


Try commenting out the code as per below :-


$addresstype = $type.'address';
$userFieldsBT = $userFieldsModel->getUserFieldsFor('cart',$type);
$this->$addresstype = $userFieldsModel->getUserFieldsFilled(
$userFieldsBT
,$data
,$preFix
);
//vmdebug('prepareAddressDataInCart',$this->$addresstype);
// if(empty($this->$type)){
// $tmp =&$this->$type ;
// $tmp = array();
// foreach($address['fields'] as $k =>$field){
// //vmdebug('prepareAddressDataInCart',$k,$field);
// if($k=='virtuemart_country_id'){
// if(isset($address['fields'][$k]['virtuemart_country_id']) and !isset($tmp['virtuemart_country_id'])){
// $tmp['virtuemart_country_id'] = $address['fields'][$k]['virtuemart_country_id'];
// }
// } else if($k=='virtuemart_state_id') {
// if(isset($address['fields'][$k]['virtuemart_state_id']) and !isset($tmp['virtuemart_state_id'])){
// $tmp['virtuemart_state_id'] = $address['fields'][$k]['virtuemart_state_id'];
// }
// } else if (!empty($address['fields'][$k]['value'])){
// if(!isset($tmp[$k])){
// $tmp[$k] = $address['fields'][$k]['value'];
// }
//
// }
// }
//$this->$type = $tmp;
// }
if(!empty($this->ST) && $type!=='ST'){
$data = (object)$this->ST;
if($new){
$data = null;
}
$userFieldsST = $userFieldsModel->getUserFieldsFor('cart','ST');
$this->STaddress = $userFieldsModel->getUserFieldsFilled(
$userFieldsST
,$data
,$preFix
);
}

}

Regards
A

Joomla 3.10.11
php 8.0

rizecorp

Hi Hutson,

    Thank you for your reply.

I have commented the code as per your suggestion and it worked out for me.
Many thanks dude..  :D   but the only thing is it is a core hack. every time i upgraded virtuemart to the latest version i have to apply this hack.

Thanks
Rizecorp

AH

You are welcome.

I have passed this on to the VM team and suggested they implement an configuration option that should prevent "auto" address field population prior to address input.

They are considering this for the future, at least you now know where the hack has to be placed.  Sometimes it is not possible to get away from a small hack, just try and make as few as possible.

Regards
A

Joomla 3.10.11
php 8.0

marco

Hi team. Not working for me, always "missing value" messages in not-pre-compilate-fields during cart checkout or user account.

Solution.

To turn off the "missing value" error report, open administration/components/com_virtuemart/models/user.php - locate the function validateUserData and go to the end, and comment as this:

if($i==$required) $return = -1;
   vmdebug('my i '.$i.' my data size '.$required,$return,$data);
   if(!$return){
      VmConfig::loadJLang('com_virtuemart_shoppers', true);
      foreach($missingFields as $fieldname){
      // vmInfo(JText::sprintf('COM_VIRTUEMART_MISSING_VALUE_FOR_FIELD',$fieldname) );
      vmdebug('');
   }
}
return $return;


I noticed this is the difference in the model from the previous vm version. You can even delete all the if(){} or just comment the line as me, and the "missing value" will be away, as in the past virtuemart version.

I !!PRAY!! the virtuemart team to review this ending part of function! This aler is not usefull, because even without you will be anyway redirect to fill the registration form, and if you forget some fields, there will be a javascript function to alert you for the requested fields.

But if you have joomla registration or you are using some social login, this "missing value" alert in the cart and in the user account are very bed for e.commerce users.

Many customers of the virtuemartrewardspoints.com website told me for that, they left the cart.
So I was forced to modify the model! Hope to be usefull for someone!!!

ottro

Hi I had the same problem. Thank you very much for your contribution. I used the solution that has been proposed Marco:

Solution.

To turn off the "missing value" error report, open administration/components/com_virtuemart/models/user.php - locate the function validateUserData and go to the end, and comment as this:

if($i==$required) $return = -1;
   vmdebug('my i '.$i.' my data size '.$required,$return,$data);
   if(!$return){
      VmConfig::loadJLang('com_virtuemart_shoppers', true);
      foreach($missingFields as $fieldname){
      // vmInfo(JText::sprintf('COM_VIRTUEMART_MISSING_VALUE_FOR_FIELD',$fieldname) );
      vmdebug('');
   }
}
return $return;


I also think this ad is the user does nothing, as you will need to fill in all fields in order to make the purchase. Would be nice if in the next updates Virtuemart team could remove this notice.

Thanks for your great work.

myplace2100

I am having the same problem as i am getting those missing values errors in cart page and billing address input page after i upgraded to VM 2.6.0a from low VM 2 version. Solution suggested by Marco is not working in cases when user don't enter some required fields in billing address page, they don't see errors for this.

But solution suggested by Hutson  seems working, but how much fruitful it is in all circumstances ?? Please help any expert guy.
joomla & wordpress extension developer

AH

I think my solution works in all cases!

It overcomes the issue with a default country being populated in the country filed

This causes the checkout to suggest that you have missed entering fields, even before you have has a chance to enter them.

All required fields are tested as normal
Regards
A

Joomla 3.10.11
php 8.0

myplace2100

#13
thanks, i will test it by debugging. But when this will be corrected in upcoming VM version?

Also another issue is if i left state field not selected in billing address page i get error - "Missing value for COM_VIRTUEMART_SHOPPER_FORM_STATE" Why it's showing language constant instead of value?? plz help my VM 2.6.0a.
joomla & wordpress extension developer

AH

Devs have said that this is a feature as it allows the price of orders to be pre-calculated without a full address when you enter the checkout

Great for all those shops where country is the only determinate of shipping price and shipping to one country only

Not much use for anyone not requiring such a function and no ability to switch it off -

They may introduce a parameter in VM3 but I am not sure about that.

Check your language files
Regards
A

Joomla 3.10.11
php 8.0