News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

"Please fill in an adress first" message when cart is empty

Started by MelvinDistudios, November 19, 2014, 10:34:42 AM

Previous topic - Next topic

MelvinDistudios

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

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





// 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


// 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


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.10.11
php 8.0

MelvinDistudios


MelvinDistudios

Nevermind. I tried searching for the comments on top. Was a bit sleepy yesterday. Got it, fixed my problem.
Cheers.

AH

Regards
A

Joomla 3.10.11
php 8.0