JavaScript How to display product unit of measurement on frontend (website) in Magento? product display unit,display unit product buy,retail product display

I want to display products unit of measurement at the frontend. For that I have created weight_unit attribute in admin panel and I am adding it to products like gram, kilogram, liter, etc. But I can't show it at frontend. I use following code to display at frontend:

<?php echo $_product->getAttributeText('weight_unit'); ?> 

Still I am not getting proper show of product unit. Please can anyone suggest me how to show it? Is there any other methods to represent the product unit?

Answer:1

You can use translation method to achieve this. You can find out that in following link.

https://magento.stackexchange.com/questions/6924/custom-attribute-ending

In this post, translation method and translation CSV files are used to achieve this. You can write your unit of measurement in CSV file and use attribute code in translation method.

Answer:2

I have a function that returns JSON objects using hnews.getById(id). I then push each story returned in the promise to an array. I'm having trouble figuring out how I'd then get the complete array. Do ...

I have a function that returns JSON objects using hnews.getById(id). I then push each story returned in the promise to an array. I'm having trouble figuring out how I'd then get the complete array. Do ...

I am trying to understand why my SVG icon is not rendered correctly. The icon is a little smallest that my SVG element event if the viewBox property was used the same like width\height. Thanks for ...

I am trying to understand why my SVG icon is not rendered correctly. The icon is a little smallest that my SVG element event if the viewBox property was used the same like width\height. Thanks for ...

  1. max-width isn't working
  2. css width isn't working
  3. max-width isn't a valid css value

I'am trying to sign into Skype via the use of its SDK but I keep hitting the following error, "Error: NoFQDN". After searching this on the net I can't find any possible solution or even find out what ...

I'am trying to sign into Skype via the use of its SDK but I keep hitting the following error, "Error: NoFQDN". After searching this on the net I can't find any possible solution or even find out what ...

  1. skype entry point not found
  2. skype entry point not found error
  3. skype entry point not found ffmpeg.dll
  4. skype entry point
  5. skype entry point not found avcodec_decode_audio4
  6. skype entry point not found windows 7
  7. skype entry point not found iphlpapi.dll
  8. skype.exe entry point not found
  9. skype.exe entry point not found windows 10
  10. skype procedure entry point
  11. skype.exe entry point not found fix
  12. skype.exe entry point not found windows xp
  13. skype procedure entry point not found
  14. skype.exe entry point not found iphlpapi.dll
  15. skype no entry point
  16. skype the procedure entry point avcodec_decode_audio4
  17. skype for business entry point not found
  18. skype.exe the procedure entry point ntdll.dll
  19. lỗi skype entry point not found

I have researched this issue and have found solutions using php but not angular. One of the requirements for saving the data on my page requires that two seperate angular objects have the same Id. ...

I have researched this issue and have found solutions using php but not angular. One of the requirements for saving the data on my page requires that two seperate angular objects have the same Id. ...

  1. angularjs change active tab