add external data to a order

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
4 years 20 hours ago #326289

Hello,

Is it possible to add external data to a Hikashop product? We are creating a sort of image editor. When a user buys a product in hikashop he/she can create a custom design in our editor.
But after creating this design, it needs to be attached to the order somehow.

What would be the best way to do this, can we include the editor in the hikashow product, in a Iframe for example? Or maybe can the editor do a post request to the hikashop component to sent the data? Or via the Database?
Is there anything made for a usercase like this, or would we have to modify Hikashop?

Regards,
Michiel

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
4 years 14 hours ago #326291

Hi,

Whether you include the editor in the product details page or not, I think what you want is to create your own type of custom field as a plugin implementing the "fields API".
You can see an example of that in the folder plugins/hikashop/datepickerfield/
this plugin adds the "advanced date picker" type to the custom fields system.
So in a similar manner, the merchants using your plugin could create a new custom field of the table "item" and of your type (for example "design editor").
Then, your plugin would output the design editor as a custom item field on the product page, and if you have an input field with the correct "name" it would be saved together with the product when you add it to the cart and you will also be able to handle the "show" of the data saved in the custom field if you want to arrange it.
Of course, you could also have a deported editor (on another page for example with just a button displayed on the product details page to access the editor) and then have the add to cart button directly in your editor. Then, when pressed, you would save the data in a table of your editor in the database, and add the product to the cart with the id of the data in your table in a custom item field and then you could similarly control the "show" of the custom field to arrange it.
The only drawback in doing it like this is that the merchant using your design editor needs to have HikaShop Business to be able to create a custom item field but the big advantage is that you don't need to handle all the places where to attach the "show" of your data in the order. You can just implement the fields API.

Please Log in or Create an account to join the conversation.

Time to create page: 0.052 seconds
Powered by Kunena Forum