1

I am new in magento.My product has model type and model version.I want to pass model type and version to cart page and checkoutpage. i have stored the model type and version in session. when more than one products add to cart their is a problem all the products shows same model type and model version , so please help.Is session array can slove this probelm? how can i do it? This is my code

Store session

 Mage::getSingleton('core/session')->setMyModelTypeData($myData);
  Mage::getSingleton('core/session')->setMyModelVersionData($myDataver);

Retrive data from session

$myData = Mage::getSingleton('core/session')->getMyModelTypeData();
 $myDataver = Mage::getSingleton('core/session')->getMyModelVersionData();

1 Answer 1

2

You can do like

<?php

$storage = array('a'=>'b');

// store data so we can fetch it in subtotal methods
Mage::getSingleton('core/session')->setRbanhShipping(serialize($storage));

// get data
$rbanhShipping = Mage::getSingleton('core/session')->getRbanhShipping(); 
$rbanhShipping = unserialize($rbanhShipping);

Good Read

how do i save array in magento session?

1
  • when i use serialize() the getRbanhShipping() retrive nothing, it shows error Jan 18, 2013 at 6:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.