How to use/add JFactory::getSession() on ps_checkout.php

Started by chong, October 16, 2015, 11:33:40 AM

Previous topic - Next topic

chong

How can we use/add JFactory::getSession() on ps_checkout.php file?
I have set a new session variable from the shopping cart and I want to use it on the ps_checkout.php file.

I have added these codes to the file and it doesn't work.
$sessionCart = JFactory::getSession();
$test = $sessionCart->get('taxExemptionNumber');

Thanks in advance.

Joomla version : 2.5.16
Virtuemart version : 2.0.24

GJC Web Design

ps_checkout.php is a VM1.1 file...  r u using the fork VM2 thing that isn't from VM?

try  $cart = $_SESSION['cart'];

then echo out $cart to see if your var is there  - its an array from memory
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

chong

Thanks for the reply,

No Sir, I'm not using fork VM2.
I have no problem getting the session data on the shopping cart, but on the ps_checkout.php file (/administrator/components/com_virtuemart/classes/ps_checkout.php). I want to get the session variable I declared from the shopping cart file (default.php).

My purpose is to change Tax rate to 0 if the shopper has entered Tax Exemption Number on the Billing Information. This Tax Exemption Number is the session variable I mentioned. Any idea how it can be done? Sorry its my first project in joomla.

Thanks in advance.

GJC Web Design

/administrator/components/com_virtuemart/classes/ps_checkout.php is VM1.1!!!!

1. your in the wrong section of the forum -> http://forum.virtuemart.net/index.php?board=66.0

if this is your first project why are you using 4 year old software? Current VM is 3.0.10

2. If you set your session var via the std. Joomla method then you retrieve it that way...

https://www.ostraining.com/blog/how-tos/development/how-to-use-sessions-in-joomla/
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