1

How to fetch value of no_of_windows ?
I want to display custom field information in cart page? How to do that?

a:12:{s:4:"uenc";s:72:"aHR0cDovLzE5Mi4xNjguNS41OC9NYWdlbnRvMjE3L2luZGV4LnBocC9uZXR0aW5nLmh0bWw,";s:7:"product";s:4:"2115";s:28:"selected_configurable_option";s:0:"";s:15:"related_product";s:0:"";s:15:"super_attribute";a:2:{i:162;s:3:"223";i:93;s:2:"49";}s:13:"no_of_windows";s:1:"2";s:7:"width_1";s:1:"1";s:8:"height_1";s:1:"2";s:7:"width_2";s:1:"1";s:8:"height_2";s:1:"3";s:11:"total_price";s:3:"100";s:3:"qty";s:1:"1";}
2
  • did you try with json_decode()? Jul 6, 2017 at 10:54
  • actually I know this information I am getting from quote_item_option table but I dont know where to try
    – jassi
    Jul 6, 2017 at 10:58

1 Answer 1

1

This is a serialize data you can simple unserialize it

$str = a:12:{s:4:"uenc";s:72:"aHR0cDovLzE5Mi4xNjguNS41OC9NYWdlbnRvMjE3L2luZGV4LnBocC9uZXR0aW5nLmh0bWw,";s:7:"product";s:4:"2115";s:28:"selected_configurable_option";s:0:"";s:15:"related_product";s:0:"";s:15:"super_attribute";a:2:{i:162;s:3:"223";i:93;s:2:"49";}s:13:"no_of_windows";s:1:"2";s:7:"width_1";s:1:"1";s:8:"height_1";s:1:"2";s:7:"width_2";s:1:"1";s:8:"height_2";s:1:"3";s:11:"total_price";s:3:"100";s:3:"qty";s:1:"1";}
$cartOptions = unserialize($str);

You will get result in array and you can display it by

$cartOptions['no_of_windows'];
1
  • ok, how to display label and value of $cartOptions['no_of_windows'] in cart page?
    – jassi
    Jul 6, 2017 at 11:29

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.