問題描述
我在 magento 模態頁面的會話中設置了數組變量,想在另一個頁面(如 getuserdata.php)中檢索但不進入另一個頁面.我設置變量并進入一頁然后完全檢索.
I set array variable in session in magento modal page and want to retrieve in another page like getuserdata.php but not get in another page. I set variable and get in one page then in completely retrieve.
我的代碼就像..
//第一頁代碼.
//另一個頁面代碼.
任何人都可以幫助我解決那個問題..
Anyone can help me for that stuff problem..
推薦答案
如果我們在 Magento 中創建會話,那么我們只能在 Magento 文件中使用該會話,例如在 magento/app 文件夾中.如果您想在您創建的外部文件中使用該會話,那么您必須首先在另一個 Magento 默認文件中獲取該會話,然后調用 jquery ajax 函數并通過它傳遞會話變量以將其獲取到外部文件中.您還可以在不使用會話的情況下通過 ajax 傳遞變量.
If we create a session in Magento, then we can only use that session in Magento files like in the magento/app folder. If you want to use that session in external files create by you then you must first get the session in another Magento default file and then call a jquery ajax function and pass session variable through it to get it in an external file. You also pass the variable through ajax without the use of the session.
像這樣設置會話數據.
并像這樣獲取數據.
這篇關于在另一個頁面中獲取 magento 會話變量的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!