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

#   Using the product and cart API

##

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

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 11 months ago -  11 years 11 months ago [\#179127](#179127) by [venomDev](/forum/user/34941-venomdev "View venomDev's Profile")  *[Using the product and cart API](/forum/31-development/872932-using-the-product-and-cart-api#179127 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3  Hi,  I'm new to using Hikashop and I'm developing a module for Joomla that needs to create either a product or a product variant that is created by the customer from my module. I'm currently using the Starter version for developing but the person I'm developing for will be using the Business version.  From the developer API document pages I can see how to use all the triggers but I'm not sure how I would go about creating a product and adding it to the cart. The customer may want to build more than 1 item in my module before checkout so I will need to add these items without leaving the current page.  The product will be build by sections so I will be creating a product code from a combination of the parts. These parts can exist in the product table if that helps but they must never appear as single items in any views or receipts.  An example product would be creating a bike where you can choose different frames, seats, handle bars and wheels and the end product for checkout would only list 'custom bike' with a total price of the components and build costs.  Is there a detailed API documentation about how to handle this or maybe some examples that create a product and add it to the cart?  Thanks for your help.")* was created by *[venomDev](/forum/user/34941-venomdev "View venomDev's Profile")*

-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3

Hi,

I'm new to using Hikashop and I'm developing a module for Joomla that needs to create either a product or a product variant that is created by the customer from my module. I'm currently using the Starter version for developing but the person I'm developing for will be using the Business version.

From the developer API document pages I can see how to use all the triggers but I'm not sure how I would go about creating a product and adding it to the cart. The customer may want to build more than 1 item in my module before checkout so I will need to add these items without leaving the current page.

The product will be build by sections so I will be creating a product code from a combination of the parts. These parts can exist in the product table if that helps but they must never appear as single items in any views or receipts.

An example product would be creating a bike where you can choose different frames, seats, handle bars and wheels and the end product for checkout would only list 'custom bike' with a total price of the components and build costs.

Is there a detailed API documentation about how to handle this or maybe some examples that create a product and add it to the cart?

Thanks for your help.

Last edit: 11 years 11 months ago by [venomDev](/forum/user/34941-venomdev "View venomDev's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MjkzMi11c2luZy10aGUtcHJvZHVjdC1hbmQtY2FydC1hcGk/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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 11 months ago [\#179143](#179143) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Using the product and cart API](/forum/31-development/872932-using-the-product-and-cart-api#179143 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3  Hi,  I'm new to using Hikashop and I'm developing a module for Joomla that needs to create either a product or a product variant that is created by the customer from my module. I'm currently using the Starter version for developing but the person I'm developing for will be using the Business version.  From the developer API document pages I can see how to use all the triggers but I'm not sure how I would go about creating a product and adding it to the cart. The customer may want to build more than 1 item in my module before checkout so I will need to add these items without leaving the current page.  The product will be build by sections so I will be creating a product code from a combination of the parts. These parts can exist in the product table if that helps but they must never appear as single items in any views or receipts.  An example product would be creating a bike where you can choose different frames, seats, handle bars and wheels and the end product for checkout would only list 'custom bike' with a total price of the components and build costs.  Is there a detailed API documentation about how to handle this or maybe some examples that create a product and add it to the cart?  Thanks for your help.")*

Hi,

The triggers are events, it is a way to integrate with HikaShop but triggers are not the way to add content in HikaShop.
To create content in HikaShop you have to use the HikaShop classes and call the "save" function, giving them the object data that you want to store in the database.

It is something that I talk about with "ruslan_zasukhin" in this thread ; but more for orders than products (even if the process is the same).
[ www.hikashop.com/forum/integrations/8716...ch-soap-service.html](http://www.hikashop.com/forum/integrations/871694-virtuemate-to-hikashop-switch-soap-service.html)

Regards,

---

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

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

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

Less More

- Posts: 3
- Thank you received: 0
-
-

11 years 11 months ago [\#179359](#179359) by [venomDev](/forum/user/34941-venomdev "View venomDev's Profile")  Replied by *[venomDev](/forum/user/34941-venomdev "View venomDev's Profile")* on topic *[Using the product and cart API](/forum/31-development/872932-using-the-product-and-cart-api#179359 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3  Hi,  I'm new to using Hikashop and I'm developing a module for Joomla that needs to create either a product or a product variant that is created by the customer from my module. I'm currently using the Starter version for developing but the person I'm developing for will be using the Business version.  From the developer API document pages I can see how to use all the triggers but I'm not sure how I would go about creating a product and adding it to the cart. The customer may want to build more than 1 item in my module before checkout so I will need to add these items without leaving the current page.  The product will be build by sections so I will be creating a product code from a combination of the parts. These parts can exist in the product table if that helps but they must never appear as single items in any views or receipts.  An example product would be creating a bike where you can choose different frames, seats, handle bars and wheels and the end product for checkout would only list 'custom bike' with a total price of the components and build costs.  Is there a detailed API documentation about how to handle this or maybe some examples that create a product and add it to the cart?  Thanks for your help.")*

Hi,

I've been looking through the classes php files and have a better idea about products and categories now. I've added the parts as products under a brand category. I'm not sure I'm using these in the most efficient way but what I'm currently doing is using
Code:

$brands = $category-&gt;getList('manufacturer', 0, false);

Then scan the array for the brand I am looking for. I then use
Code:

// $id is set from the previous scan $tree = $product-&gt;getTreeList($id, 3); foreach($tree[1] as $tr){ $product-&gt;getProducts($tr-&gt;product_id); }

To find all the individual parts that will be used to create the item. From here I will build the item using my Joomla module and later save it back as a product variant (I haven't written this code yet).

Do these classes have API documentation available somewhere?

If I know the manufacturer's name is it possible to have HikaShop search for a string in the category table to return 1 record with the category_id that I need?

Atm it seems necessary to know all the Ids which I need to manually scan for.

Thanks for your help.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMxLWRldmVsb3BtZW50Lzg3MjkzMi11c2luZy10aGUtcHJvZHVjdC1hbmQtY2FydC1hcGk/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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 11 months ago [\#179377](#179377) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Using the product and cart API](/forum/31-development/872932-using-the-product-and-cart-api#179377 "-- HikaShop version -- : 2.3.4 -- Joomla version -- : 3  Hi,  I'm new to using Hikashop and I'm developing a module for Joomla that needs to create either a product or a product variant that is created by the customer from my module. I'm currently using the Starter version for developing but the person I'm developing for will be using the Business version.  From the developer API document pages I can see how to use all the triggers but I'm not sure how I would go about creating a product and adding it to the cart. The customer may want to build more than 1 item in my module before checkout so I will need to add these items without leaving the current page.  The product will be build by sections so I will be creating a product code from a combination of the parts. These parts can exist in the product table if that helps but they must never appear as single items in any views or receipts.  An example product would be creating a bike where you can choose different frames, seats, handle bars and wheels and the end product for checkout would only list 'custom bike' with a total price of the components and build costs.  Is there a detailed API documentation about how to handle this or maybe some examples that create a product and add it to the cart?  Thanks for your help.")*

Hi,

1. We don't have a documentation for all the functions of the HikaShop classes.

2. We don't have a function to search for a string in the category table. You can do that with a MySQL query.

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

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

[](#top)
