Jump to content

trying to get total price in blockcart without currency


Recommended Posts

Hi

 

I'm trying to get total price of products in ajax block cart without any currencies, for example if the total price is 100$, i just want to get 100

 

Also i want to get the price of every product in the cart without currencies.

 

I tried using this : {convertPrice price=$productPrice} but it doesn't work here. I changed it to: {convertPrice price=$product.price} but it still shows $ at the end of the price.

 

Any ideas how to do this?

 

Thanks are in orders.

Link to comment
Share on other sites

Yes, i used 'replace' to remove the $ sign from total price, here is what i did: {$total|replace:'$':''}

 

But the product price has another syntax, which is unfamiliar to me, and there is a little about replace syntax in the guide. here is the syntax for individual products:

 

{displayWtPrice p="`$product.total`"}

 

can you give me any clues how to use replace in this please?

 

i would be thankful.

Link to comment
Share on other sites

Hi,

 

I want to make product price without currency. But I didnt. 

 

Smarty replace not working.

 

Example:

 

Product price : 500,00 TL

 

Varible: {convertPrice price=$productPrice|replace:' TL':''}

 

But not change anything.

 

How l can do?

Link to comment
Share on other sites

thank you nemo. as always, solved my problem. :)

 

But now when i add a product to my cart, it will use ajax-cart.js to update the cart and then, the $ sign is back until i refresh the page. i checked the js file, and here is the command that puts the price into the cart: (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation)

 

i wonder if u could give me a tip to make this return the price without the sign. thanks!

Link to comment
Share on other sites

thank you nemo. as always, solved my problem. :)

 

But now when i add a product to my cart, it will use ajax-cart.js to update the cart and then, the $ sign is back until i refresh the page. i checked the js file, and here is the command that puts the price into the cart: (parseFloat(this.price_float) > 0 ? this.priceByLine : freeProductTranslation)

 

i wonder if u could give me a tip to make this return the price without the sign. thanks!

 

P.S: Never mind, i figured it out. i just needed to to replace "this.priceByLine" with "this.priceByLine.replace(/$/gi, "")". easy enough :)

Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...