# Call a weblink as action

**URL:** <https://forum.sambapos.com/t/call-a-weblink-as-action/5281>\
**Category:** V4 Question\
**Created:** [May 4, 2015, 7:10am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281 "2015-05-04T07:10:46Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 4, 2015, 7:10am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/1 "2015-05-04T07:10:47Z")

</div>

I have made a wifi ticket system in Python/Django (I wish I had the skills to make it in C#). In this system I can import wifi codes as csv files. When I call a link, a ticket is printed and the printed codes are removed from the database.

So when I call:  
[http://localhost:8000/ticket/1](http://localhost:8000/ticket/1) a ticket valid for an hour is printed  
[http://localhost:8000/ticket/2](http://localhost:8000/ticket/2) a ticket valid for a day is printed

Is it possible to call these links directly from Sambapos, after a ticket is sold? Or should I make a .bat file, and call these links from the .bat with a program like Wget?

In case anybody is interested browsing the Django code, just let me know, it is on Github.

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [May 4, 2015, 12:31pm UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/2 "2015-05-04T12:31:26Z")

</div>

You can use URL Printer for that. You can review this tutorial for details.

[http://sambapos.org/wiki/doku.php/en/custom\_package\_delivery\_system\_part\_3](http://sambapos.org/wiki/doku.php/en/custom_package_delivery_system_part_3)

---

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 4, 2015, 1:09pm UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/3 "2015-05-04T13:09:33Z")

</div>

@emre thanks for the update.

I use version 4.1.82 Is it correct that there is no URL printer type?

I can only see “settings printer” and “save to file printer”

(sorry didn’t mention the Sambapos version)

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [May 4, 2015, 2:10pm UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/4 "2015-05-04T14:10:17Z")

</div>

Within SambaPOS, on the Main Menu screen, click Samba Market. Then install the URL Printer module (free). Restart SambaPOS for it to take effect, then look at your Printers section again - you will see the URL printer there.

 ![](https://forum.sambapos.com/uploads/default/original/3X/5/9/59fdc85a1b5cf4e1f8830adc7c641e7b8a9e4142.png) 

![](https://forum.sambapos.com/uploads/default/original/3X/1/b/1bf8912b91361578668d691364146a2c10dd1d8f.png)

---

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 4, 2015, 4:15pm UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/5 "2015-05-04T16:15:58Z")

</div>

@emre @QMcKay Thank you for your answers!

I will install and test, and post here how it works.

---

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 5, 2015, 8:23am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/6 "2015-05-05T08:23:17Z")

</div>

I have installed the url printer, and everything seems to work perfectly. The only problem till now is that I try to use the product tag as variable. I have these values for the url printer:

[http://localhost:8000/ticket/@number@](http://localhost:8000/ticket/@number@)

Token char: @

In my printer template I tried this:  
number={ITEM TAG}

This gives me this url: [http://localhost:8000/ticket/](http://localhost:8000/ticket/){ITEM TAG}

Other tags get get translated though. For example:  
number = {DATE} gives me an url with the current date

Is it possible to get the Item tag, or a custom tag into the url?

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [May 5, 2015, 8:33am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/7 "2015-05-05T08:33:43Z")

</div>

Well from your question I thought you needed ticket numbers. This feature works ticket wide not per order. With V5’s JScript support you’ll have more options for such issues.

---

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 5, 2015, 8:48am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/8 "2015-05-05T08:48:12Z")

</div>

@emre it is not a big problem I only have to define an url printer for every wifi ticket type we sell (we have 10 different types)

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [May 5, 2015, 8:50am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/9 "2015-05-05T08:50:55Z")

</div>

If such tickets contains only one of these order types you can tag ticket with added order’s tag and use that tag.

Or…

You need to use regular {ORDERS} tag and [ORDERS:X] to access order specific values. You can use order states to filter non-wifi orders. Reviewing this tutorial might give more ideas.

> [@Printing Tutorial in Detail](http://forum.sambapos.com/t/printing-tutorial-in-detail/994):
>
> Hello. In this tutorial I’ll show you how printing works and how to configure it for most common cases. #How it works? In this section I’ll show you how SambaPOS printing system works. ##Printers These are the printers that are used on your system. To configure your printer start by adding a printer here. For this example I’ll add a Bar Printer Enter a name for your printer and select your printer from drop down list. If it is a network printer you can also type it’s n…

---

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 5, 2015, 11:34am UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/10 "2015-05-05T11:34:24Z")

</div>

I already started to add a rule for every ticket type, and I could not figure it out with the order tags. The work was a bit tedious, but now everything is settled everything works beautifully (thanks to the great feature of the url printer!)

---

<div class="post-metadata">

**Author:** ![het\_oosten](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/h/ec9cab/32.png) [@het\_oosten](https://forum.sambapos.com/u/het_oosten)\
**Post date:** [May 6, 2015, 2:41pm UTC](https://forum.sambapos.com/t/call-a-weblink-as-action/5281/11 "2015-05-06T14:41:57Z")

</div>

I now installed the Django app, using CherryPy server as a Windows service. In case somebody wants to check the code please have a look here:

> **[rob-vandam/django-hotspottickets](https://github.com/rob-vandam/django-hotspottickets)**
>
> Contribute to rob-vandam/django-hotspottickets development by creating an account on GitHub.

I use Pfsense (a Freebsd router distro) as router and captive portal. In Pfsense I can create vouchers (wifi codes) and export these as .csv

Thanks to the excellent feature from Sambapos (urlprinter) I can print tickets directly from our pos. We have 10 different ticket types, from 2 hours to one year. Because I have too little knowledge of the printer template system I created 10 different url printers. I am sure this can be done easier (see the reply of @emre above).

I use action “order added to ticket”, so when the ticket is clicked it is directly printed out.
