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

#   creating additional files in the ordering process

##

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

Less More

- Posts: 16
- Thank you received: 0
-
-

14 years 1 month ago [\#73430](#73430) by [mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")  *[creating additional files in the ordering process](/forum/4-how-to/73430-creating-additional-files-in-the-ordering-process#73430 "Hey,  I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.  First Problem: We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product. We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations. My question is: Is it possible to intigrate the code into the ordering process of HikaShop?  Second Problem: If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.  It would be great if anyone can help us solving our problems. Thank you,  Moritz.")* was created by *[mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")*

Hey,

I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.

First Problem:
We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product.
We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations.
My question is: Is it possible to intigrate the code into the ordering process of HikaShop?

Second Problem:
If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.

It would be great if anyone can help us solving our problems.
Thank you,

Moritz.

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

14 years 1 month ago [\#73488](#73488) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: creating additional files in the ordering process](/forum/4-how-to/73430-creating-additional-files-in-the-ordering-process#73488 "Hey,  I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.  First Problem: We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product. We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations. My question is: Is it possible to intigrate the code into the ordering process of HikaShop?  Second Problem: If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.  It would be great if anyone can help us solving our problems. Thank you,  Moritz.")*

Hi,

You can override a lot of things in HikaShop and you can do much more thanks plugins.
For example, there is a trigger called "onBeforeDownloadFile" which took three parameters : &amp;$filename, &amp;$do, &amp;$file.
First is the filename of what the customer wants to download (could be a relative path, a url or a string which begins with an @).
Second is a boolean value. If false, the download process would be canceled.
The last one is an object, the object is mainly the result of a database request on the table "file".
In the latest version of HikaShop (2.0, still in beta for the moment), you would have access to more data, like the "order_id".

So you would be able to create an HikaShop plugin which would contains this function (this trigger) and thanks to it, you could dynamically change the filename of the file that HikaShop would send to the user.

Thanks to the order_id and the product_id, you would be able to retrieve all you needs (Using orderClass::loadFullOrder for example).

Best regards,

---

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

The following user(s) said Thank You: [mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")

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

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

Less More

- Posts: 16
- Thank you received: 0
-
-

14 years 1 month ago [\#73534](#73534) by [mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")  Replied by *[mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")* on topic *[Re: creating additional files in the ordering process](/forum/4-how-to/73430-creating-additional-files-in-the-ordering-process#73534 "Hey,  I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.  First Problem: We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product. We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations. My question is: Is it possible to intigrate the code into the ordering process of HikaShop?  Second Problem: If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.  It would be great if anyone can help us solving our problems. Thank you,  Moritz.")*

Thank you for your reply.

I think these triggers seem to be exactly what i was looking for!

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

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

Less More

- Posts: 16
- Thank you received: 0
-
-

14 years 3 weeks ago [\#74305](#74305) by [mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")  Replied by *[mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")* on topic *[Re: creating additional files in the ordering process](/forum/4-how-to/73430-creating-additional-files-in-the-ordering-process#74305 "Hey,  I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.  First Problem: We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product. We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations. My question is: Is it possible to intigrate the code into the ordering process of HikaShop?  Second Problem: If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.  It would be great if anyone can help us solving our problems. Thank you,  Moritz.")*

Hi,

i am currently playing around with the triggers. I created a small plugin for displaying some informations about the order. For that i use the onAfterOrderCreate() function and everything is running good so far.
But i have one small problem: When i try to read the value for my "order_product_options" and display it i only got some crazy coded text ![;)](/media/kunena/emoticons/24.png ";)")
Is there a way to get the selected options for an ordered product within a string or an array?
Currently i use

$selected_options = $my_product-&gt;order_product_options;

which returns the text from the database. I am looking for a function to get the values the customer selected without having to encode it from the database text.

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

14 years 3 weeks ago [\#74309](#74309) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: creating additional files in the ordering process](/forum/4-how-to/73430-creating-additional-files-in-the-ordering-process#74309 "Hey,  I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.  First Problem: We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product. We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations. My question is: Is it possible to intigrate the code into the ordering process of HikaShop?  Second Problem: If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.  It would be great if anyone can help us solving our problems. Thank you,  Moritz.")*

Hi,

order_product_options is a serialized field.
You have to load it like this: Code:

if(is_string($selected_options)) { $selected_options = unserialize($selected_options); }

Regards,

---

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

The following user(s) said Thank You: [mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")

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

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

Less More

- Posts: 16
- Thank you received: 0
-
-

14 years 3 weeks ago [\#74338](#74338) by [mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")  Replied by *[mobe84](/forum/user/10689-mobe84 "View mobe84's Profile")* on topic *[Re: creating additional files in the ordering process](/forum/4-how-to/73430-creating-additional-files-in-the-ordering-process#74338 "Hey,  I am very new to HikaShop and it seems to be a great Extension. But i have several questions about it and i hope someone can help.  First Problem: We have a website (local for the moment) and we want to create some additional files when a customer has ordered a product. We already have php code for creating a PDF via the tcpdf class and also there is some code for an xml file with order informations. My question is: Is it possible to intigrate the code into the ordering process of HikaShop?  Second Problem: If the first problem is solved, is it possible to read the variables from the product options? Because we need them as variables for the PDF and xml files. For example: Our product has an option for the color and we want to use that in our xml file.  It would be great if anyone can help us solving our problems. Thank you,  Moritz.")*

works perfect! thank you again ![:)](/media/kunena/emoticons/3.png ":)")

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

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