[Skip to main content](#vessel-content)

#   Can get product name,id,etc...?

##

- **[Krok](/forum/user/49481-krok "View Krok's Profile")**
- [![Krok's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49481-krok "View Krok's Profile") Topic Author
- [ Offline](/forum/user/49481-krok)

Less More

- Posts: 25
- Thank you received: 1
-
-

9 years 7 months ago [\#267104](#267104) by [Krok](/forum/user/49481-krok "View Krok's Profile")  *[Can get product name,id,etc...?](/forum/31-development/889765-can-get-product-name-id-etc#267104 "Hello guys ! I have a question, can i get the product name,id,etc for my customize product component for hikashop i have tested  but this code display &quot;1.000&quot;; Can i have help pls.")* was created by *[Krok](/forum/user/49481-krok "View Krok's Profile")*

Hello guys ! I have a question, can i get the product name,id,etc for my customize product component for hikashop i have tested Code:

$product_id =2; $products = hikashop_get('class.product'); $product=$products-&gt;get(product_id); echo $product-&gt;product_wieght;

but this code display "1.000";
Can i have help pls.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTc2NS1jYW4tZ2V0LXByb2R1Y3QtbmFtZS1pZC1ldGM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26400
- Thank you received: 4079
-
- [](http://obsi.dev)
-

9 years 7 months ago [\#267107](#267107) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Can get product name,id,etc...?](/forum/31-development/889765-can-get-product-name-id-etc#267107 "Hello guys ! I have a question, can i get the product name,id,etc for my customize product component for hikashop i have tested  but this code display &quot;1.000&quot;; Can i have help pls.")*

Hello,

I think you are using "product_weight" and not "product_wieght".
Most of the product information can be used directly ; but for some parts, like the dimensions and the weight, you need to handle also the "unit".
That's why in HikaShop you can find some classes/helper to display or convert it.
What do you want to do exactly ?

[ www.hikashop.com/support/documentation/6...ocumentation.html#db](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#db)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTc2NS1jYW4tZ2V0LXByb2R1Y3QtbmFtZS1pZC1ldGM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Krok](/forum/user/49481-krok "View Krok's Profile")**
- [![Krok's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/49481-krok "View Krok's Profile") Topic Author
- [ Offline](/forum/user/49481-krok)

Less More

- Posts: 25
- Thank you received: 1
-
-

9 years 7 months ago -  9 years 7 months ago [\#267150](#267150) by [Krok](/forum/user/49481-krok "View Krok's Profile")  Replied by *[Krok](/forum/user/49481-krok "View Krok's Profile")* on topic *[Can get product name,id,etc...?](/forum/31-development/889765-can-get-product-name-id-etc#267150 "Hello guys ! I have a question, can i get the product name,id,etc for my customize product component for hikashop i have tested  but this code display &quot;1.000&quot;; Can i have help pls.")*

--English version--

Hello Jerome, i would like create a product customization component that work with hikashop, in first time i would like get all product for display his in my component administrator panel, and add a function in this panel for add "customize" button in selected product, in the third time i would like to display the "customize" buttom in the products selected by the administrator. I have already the backend system. Thx for you reply. Have a nice day.
(Sorry for my english, i use google traduction because i'm french and i have small difficulty in english )

--Version française--
Bonjour Jerome, je voudrais créer un composant de customization de produit qui marche avec hikashop, dans un premier temps je voudrais récupérer tout les produits et les afficher dans la page administrateur de mon composant, dans un second temps je voudrai pourvoir ajouter un bouton de customization sur des produits choisis par l'admin (ce qui explique pourquoi je dois recup les produits). et modifier le prix en fonction de la customization apporté.Merci pour votre réponse aussi rapide.

Last edit: 9 years 7 months ago by [Krok](/forum/user/49481-krok "View Krok's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTc2NS1jYW4tZ2V0LXByb2R1Y3QtbmFtZS1pZC1ldGM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 7 months ago [\#267152](#267152) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Can get product name,id,etc...?](/forum/31-development/889765-can-get-product-name-id-etc#267152 "Hello guys ! I have a question, can i get the product name,id,etc for my customize product component for hikashop i have tested  but this code display &quot;1.000&quot;; Can i have help pls.")*

Hi,

Well, the code: Code:

$product_id =2; $products = hikashop_get('class.product'); $product=$products-&gt;get(product_id); echo $product-&gt;product_weight;

is fine. It's normal that it displays 1.000 if you have entered 1 for the weight of your product since the weight is stored as a decimal with three digits in the database.
If it's not want you want then you'll have to convert the value to something else.
For example: Code:

echo round($product-&gt;product_weight);

will actually display 1.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg4OTc2NS1jYW4tZ2V0LXByb2R1Y3QtbmFtZS1pZC1ldGM/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.045 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
