Jump to content

Get product price on cart without currencie format from $vars['products']


Recommended Posts

Hello,

 

I trying access the product total price from $vars['products'] without currencie format,but the variables with the raw value is protected and I can't access your value.

 

I try to fetch from array

 

$vars['products']['pricing']['baseprice']

 

but this variable contain currencie codes, and the

 

$vars['products']['pricing']['baseprice']['price']

 

is protected

 

There is another option to fetch the product price from the cart product array without the currencie codes?

 

Regards

Link to comment
Share on other sites

I would have thought that as they're using the price formatter, you could do something like this...

 

$baseprice = $vars['products']['pricing']['baseprice'];
$basevalue = $baseprice->toNumeric();

or maybe just using one line..

 

$baseprice = $vars['products']['pricing']['baseprice']->toNumeric();

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated