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

#   Getting Product Details of Variant

##

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

Less More

- Posts: 10
- Thank you received: 0
-
-

11 years 9 months ago -  11 years 9 months ago [\#185456](#185456) by [philipp](/forum/user/35353-philipp "View philipp's Profile")  *[Getting Product Details of Variant](/forum/26-product-category-display/874047-getting-product-details-of-variant#185456 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : latest -- Browser(s) name and version -- : ff latest  Hello Everybody,  I am about to create a tiny cart module. Its working quiete well so far, but there are some things that I cannot figure out…  I am loading the Products on the Cart as described here (  www.hikashop.com/support/support/documen...umentation.html#code ):  That returns the Products from the cart, and the parent product (the products I am dealing with are variants), what is cool so far, but I would like to retrieve the COMPLETE name of the product, which should include the variant names.  For Example:  I have a Main Product, with two charackteristics: size and color. That product has the name »canUcodeIt«. Now, in the cart, there is one of its variants and I would like to display the name like this:  canUcodeIt-XL-RED  BUT even If can get »canUcodeIt« from the parent product, how can I get the details of the variant?  How can I get the Price? It is not included in the Data Object…  Thanks in Ahead!")* was created by *[philipp](/forum/user/35353-philipp "View philipp's Profile")*

-- HikaShop version -- : latest
-- Joomla version -- : latest
-- PHP version -- : latest
-- Browser(s) name and version -- : ff latest

Hello Everybody,

I am about to create a tiny cart module. Its working quiete well so far, but there are some things that I cannot figure out…

I am loading the Products on the Cart as described here ([ www.hikashop.com/support/support/documen...umentation.html#code](http://www.hikashop.com/support/support/documentation/62-hikashop-developer-documentation.html#code)):
Code:

//If you want to get a list of the products in the cart, you can use the code : $cartClass = hikashop_get('class.cart'); $productsArray = $cartClass-&gt;get(); /* Note that if the current cart has no products, the cart will be deleted. So you would have to re-init it after that call with the line: */ $cartClass-&gt;initCart();

That returns the Products from the cart, and the parent product (the products I am dealing with are variants), what is cool so far, but I would like to retrieve the COMPLETE name of the product, which should include the variant names.

For Example:

I have a Main Product, with two charackteristics: size and color. That product has the name »canUcodeIt«. Now, in the cart, there is one of its variants and I would like to display the name like this:

canUcodeIt-XL-RED

BUT even If can get »canUcodeIt« from the parent product, how can I get the details of the variant?

How can I get the Price? It is not included in the Data Object…

Thanks in Ahead!

Last edit: 11 years 9 months ago by [philipp](/forum/user/35353-philipp "View philipp's Profile").

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

11 years 9 months ago [\#185587](#185587) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Getting Product Details of Variant](/forum/26-product-category-display/874047-getting-product-details-of-variant#185587 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : latest -- Browser(s) name and version -- : ff latest  Hello Everybody,  I am about to create a tiny cart module. Its working quiete well so far, but there are some things that I cannot figure out…  I am loading the Products on the Cart as described here (  www.hikashop.com/support/support/documen...umentation.html#code ):  That returns the Products from the cart, and the parent product (the products I am dealing with are variants), what is cool so far, but I would like to retrieve the COMPLETE name of the product, which should include the variant names.  For Example:  I have a Main Product, with two charackteristics: size and color. That product has the name »canUcodeIt«. Now, in the cart, there is one of its variants and I would like to display the name like this:  canUcodeIt-XL-RED  BUT even If can get »canUcodeIt« from the parent product, how can I get the details of the variant?  How can I get the Price? It is not included in the Data Object…  Thanks in Ahead!")*

Hi,

You should use $cartClass-&gt;loadFullCart(); instead of $cartClass-&gt;get();
This will give you all the details needed.

For the product name, the easiest way is to edit the variants and set a name for each of them.
But if you have a big range of products I understand that the code is the fastest way ![;)](/media/kunena/emoticons/11.png ";)")

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

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

Less More

- Posts: 10
- Thank you received: 0
-
-

11 years 9 months ago [\#185607](#185607) by [philipp](/forum/user/35353-philipp "View philipp's Profile")  Replied by *[philipp](/forum/user/35353-philipp "View philipp's Profile")* on topic *[Getting Product Details of Variant](/forum/26-product-category-display/874047-getting-product-details-of-variant#185607 "-- HikaShop version -- : latest -- Joomla version -- : latest -- PHP version -- : latest -- Browser(s) name and version -- : ff latest  Hello Everybody,  I am about to create a tiny cart module. Its working quiete well so far, but there are some things that I cannot figure out…  I am loading the Products on the Cart as described here (  www.hikashop.com/support/support/documen...umentation.html#code ):  That returns the Products from the cart, and the parent product (the products I am dealing with are variants), what is cool so far, but I would like to retrieve the COMPLETE name of the product, which should include the variant names.  For Example:  I have a Main Product, with two charackteristics: size and color. That product has the name »canUcodeIt«. Now, in the cart, there is one of its variants and I would like to display the name like this:  canUcodeIt-XL-RED  BUT even If can get »canUcodeIt« from the parent product, how can I get the details of the variant?  How can I get the Price? It is not included in the Data Object…  Thanks in Ahead!")*

would be fine if this would have been mentioned in the documentation…

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzQwNDctZ2V0dGluZy1wcm9kdWN0LWRldGFpbHMtb2YtdmFyaWFudD90bXBsPW1hcmtkb3du) 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.169 seconds

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

[](#top)
