Author Topic: "Please fill in an adress first" message when cart is empty  (Read 2928 times)

MelvinDistudios

  • Beginner
  • *
  • Posts: 12
"Please fill in an adress first" message when cart is empty
« on: November 19, 2014, 10:34:42 am »
When a customer heads to the shopping cart without selecting any products he will get the following system message:
"Please fill in an adress first.". We do not support accounts for customers and we do not want to support it either. The idea behind our form is that you can't select shipment, "no shipment" is set for all products.
I think this no shipment method is not selected when no products are in the cart, so it will ask for your address.

Any workarounds for this? Perhaps a function to never ship at all?
Currently on Joomla 3.3.3, VirtueMart 2.9.9.4.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: "Please fill in an adress first" message when cart is empty
« Reply #1 on: November 19, 2014, 12:22:46 pm »
LMAO

This is a new feature that is not so positive for some shops

And for which (at this moment in time) you will need to do a core hack to the following file:

components/com_virtuemart/views/cart/view.html.php

It also applies to payment as well but you might not have this triggered:-

You can just comment out all these message triggers




Code: [Select]
// Quorvia removed this message prompt on entering a cart if we have shipping that requires a full address

// if ($found_shipment_method == 0 AND empty($this->cart->BT)) {
// $redirectMsg = vmText::_('COM_VIRTUEMART_CART_ENTER_ADDRESS_FIRST');
// if (VmConfig::get('oncheckout_opc', 1)) {
// vmInfo($redirectMsg);
// } else {
// $mainframe = JFactory::getApplication();
// $mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT'), $redirectMsg);
// }
// }


and this one

Code: [Select]
// Quorvia removed this awful message prompt on entering a cart as BT will be empty and if cart is empty the message gets fired

// if ($this->found_payment_method == 0 AND empty($this->cart->BT)) {
// $redirectMsg = vmText::_('COM_VIRTUEMART_CART_ENTER_ADDRESS_FIRST');
// if (VmConfig::get('oncheckout_opc', 1)) {
// vmInfo($redirectMsg);
// } else {
// $mainframe = JFactory::getApplication();
// $mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT'), $redirectMsg);
// }
// }


Or you could also do a test for empty cart to surpress the message

Code: [Select]
Quorvia surpress message prompt on entering a cart as BT will be empty and if cart is empty the message gets fired
if ($this->cart->cartProductsData) {
if ($this->found_payment_method == 0 AND empty($this->cart->BT)) {
$redirectMsg = vmText::_('COM_VIRTUEMART_CART_ENTER_ADDRESS_FIRST');
if (VmConfig::get('oncheckout_opc', 1)) {
vmInfo($redirectMsg);
} else {
$mainframe = JFactory::getApplication();
$mainframe->redirect(JRoute::_('index.php?option=com_virtuemart&view=user&task=editaddresscart&addrtype=BT'), $redirectMsg);
}
}
}

You will of course need to re-apply this after every update!
Regards
A

Joomla 3.9.26
php 7.4

MelvinDistudios

  • Beginner
  • *
  • Posts: 12
Re: "Please fill in an adress first" message when cart is empty
« Reply #2 on: November 19, 2014, 14:32:52 pm »
Errr. these lines aren't located in that file at all.

MelvinDistudios

  • Beginner
  • *
  • Posts: 12
Re: "Please fill in an adress first" message when cart is empty
« Reply #3 on: November 20, 2014, 11:04:58 am »
Nevermind. I tried searching for the comments on top. Was a bit sleepy yesterday. Got it, fixed my problem.
Cheers.

AH

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3450
  • VirtueMart Version: 3.8.9
Re: "Please fill in an adress first" message when cart is empty
« Reply #4 on: November 21, 2014, 18:39:46 pm »
Try looking at VM3 they are in there!
Regards
A

Joomla 3.9.26
php 7.4