News:

Looking for documentation? Take a look on our wiki

Main Menu

How to display a message after app->redirect

Started by cleoni, January 27, 2015, 11:07:20 AM

Previous topic - Next topic

cleoni

Hello,
I am using VM 2.6 and I am stuck in this problem:

When at the Cart, after coupon code validation, the validating routine returns null string in case coupon code is OK, and a message if coupon was not valid.

The problem that I have now is that this message is not displayed to the user.

At a certain point execution flows at components/com_virtuemart/controllers/cart.php line 231 where I have the validation message in variable $msg

then runs this code

if ($cart->getInCheckOut()) {
$app = JFactory::getApplication();
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart&task=checkout', FALSE),$msg);
} else {
$app->redirect(JRoute::_('index.php?option=com_virtuemart&view=cart', FALSE),$msg);
}


I can see here the $app->redirect sends somehow the $msg variable to the cart page, but my question is: how do I read it (session, $POST/$GET, shared vars..)?

I am using a buyed template which is somehow overriding the original code so, it must be buggy in the sense that messages caught from the coupon validator are not actually displayed (most likely ANY messages are just ignored and never printed)

Any ideas?
--Cris

GJC Web Design

do any standard messages show in your template?  i.e. is <jdoc:include type="message" /> there ?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

cleoni

As long as I can see from a recursive search on the entire site, in my template this

jdoc:include

is used just for defining module positions.

Inserting the code

<jdoc:include type="message" />

no message pops up.

You see, it's still unclear to me after this $arr->redirect where this $msg variable is stored or used.
--Cris

GJC Web Design

<jdoc:include type="message" /> is for showing system messages in all Joomla

$app->redirect(LINK,MSG)  is a standard joomla method to display messages in the std. Joomla messaging

nothing more needs to be done

you still haven't answered-> do any standard messages (from VM or any where - try the contact page) show in your template?
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation