I have a code to get a selected custom option values on cart page.But suppose cart item has custom options which are not required.So in this case if customer add this product to the cart but without selecting any custom options.

So now I want to know that on cart page,whether customer select any custom option or not.

I am getting an selected option using code :


But when customer does not select any option that time I am getting blank array like :

  [48] => 

Please help me.

  • are you need any msg or log?
    – Abdul
    Commented Jan 12, 2016 at 7:22
  • I am putting this in If condition.
    – Poyan
    Commented Jan 12, 2016 at 8:45
  • Try this : $option = $item->>getOptionByCode('info_buyRequest');
    – Abdul
    Commented Jan 12, 2016 at 9:13

1 Answer 1


I found a solution by using this:


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.