added hoodie preorder items to merch (#4486)
All checks were successful
continuous-integration/drone/push Build is passing

Reviewed-on: #4486
Co-authored-by: Tobias Diekershoff <tobiasd@fsfe.org>
Co-committed-by: Tobias Diekershoff <tobiasd@fsfe.org>
This commit is contained in:
tobiasd 2024-10-09 08:56:46 +00:00 committed by anaghz
parent 7ed6974c2e
commit 207ce0e0b3
17 changed files with 176 additions and 21 deletions

View File

@ -97,15 +97,20 @@ my $items = XML::LibXML->load_xml(location => $items_file);
my $count = 0;
my $amount = 0;
my $pickup = 0;
foreach my $item ( $query->param ) {
my $value = $query->param($item);
if ( not $item =~ /^_/ and $value ) {
# Remove size from item info so price is found properly
my $origitem = $item;
$item =~ s/_.*//;
my $price = $items->findvalue("/itemset/item[\@id=\"$item\"]/\@price");
$count += 1;
$amount += $value * $price;
if ( !$pickup ) {
$pickup = "hoodie-fourfreedoms" eq substr($origitem,0,length("hoodie-fourfreedoms"));
}
}
}
@ -117,6 +122,10 @@ if ( $country_code eq 'DE' ) {
} else {
$shipping = 8;
}
# if one item was for pick up only, then shipping cost are 0
if ( $pickup ) {
$shipping = 0;
}
$amount += $shipping;
@ -218,6 +227,18 @@ HTML
}
}
if ( $pickup ) {
$body .= <<"HTML";
Self pick-up (Shipping): 0<br>
<strong>Total amount: $amount</strong>
</pre>
<p>
Best regards,
</p>
</body>
</html>
HTML
} else {
$body .= <<"HTML";
Shipping to $country_name: $shipping<br>
<strong>Total amount: $amount</strong>
@ -228,6 +249,7 @@ Shipping to $country_name: € $shipping<br>
</body>
</html>
HTML
}
# -----------------------------------------------------------------------------
# Generate invoice
@ -239,7 +261,11 @@ my @odtfill = qw();
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/cgi-bin/odtfill";
# template file
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/templates/invoice.odt";
if ( !$pickup ) {
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/templates/invoice.odt";
} else {
push @odtfill, $ENV{"DOCUMENT_ROOT"} . "/templates/invoicepu.odt";
}
# output file
push @odtfill, "/tmp/invoice.odt";
@ -262,8 +288,10 @@ foreach my $item ( $query->param ) {
push @odtfill, "Amount=" . sprintf "%.2f", $value * $price;
}
}
push @odtfill, "Country=" . $country_name; # 2nd Country placeholder
push @odtfill, "Shipping=" . sprintf "%.2f", $shipping;
if ( !$pickup ) {
push @odtfill, "Country=" . $country_name; # 2nd Country placeholder
push @odtfill, "Shipping=" . sprintf "%.2f", $shipping;
}
push @odtfill, "Total=" . $amount_f;
push @odtfill, "Net=" . $net;
push @odtfill, "Vat=" . $vat;

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<infoset>
<version>1</version>
<info id="hoodie-fourfreedoms-38c3-black">
<name>Hoodie (Pick-Up at 38c3), black</name>
<description>
<p>
The new FSFE hoodies are produced only for those who will order them and will be self picked up only.
As the are self picked-up, there are no shipping fee for orders that include one or more hoodies.
You can combine them with other items from this shop for the same pick up location.
</p>
<p>
<strong>This item is for self-pick up at the FSFE booth at 38c3 only.</strong>
</p>
<p>
On the front the FSFE logo will be printed on the upper left side.
</p>
</description>
</info>
</infoset>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<infoset>
<version>1</version>
<info id="hoodie-fourfreedoms-38c3-blue">
<name>Hoodie (Pick-Up at 38c3), blue</name>
<description>
<p>Waiting is over... The new hoodies are here!</p>
<p>
The new FSFE hoodies are produced only for those who will order them and will be self picked up only.
As the are self picked-up, there are no shipping fee for orders that include one or more hoodies.
You can combine them with other items from this shop for the same pick up location.
</p>
<p>
<strong>This item is for self-pick up at the FSFE booth at 38c3 only.</strong>
</p>
<p>
On the front the FSFE logo will be printed on the upper left side.
</p>
</description>
</info>
</infoset>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<infoset>
<version>1</version>
<info id="hoodie-fourfreedoms-fosdem-black">
<name>Hoodie (Pick-Up at FOSDEM 2025), black</name>
<description>
<p>
The new FSFE hoodies are produced only for those who will order them and will be self picked up only.
As the are self picked-up, there are no shipping fee for orders that include one or more hoodies.
You can combine them with other items from this shop for the same pick up location.
</p>
<p>
<strong>This item is for self-pick up at the FSFE booth at FOSDEM only.</strong>
</p>
<p>
On the front the FSFE logo will be printed on the upper left side.
</p>
</description>
</info>
</infoset>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<infoset>
<version>1</version>
<info id="hoodie-fourfreedoms-fosdem-blue">
<name>Hoodie (Pick-Up at FOSDEM 2025), blue</name>
<description>
<p>
The new FSFE hoodies are produced only for those who will order them and will be self picked up only.
As the are self picked-up, there are no shipping fee for orders that include one or more hoodies.
You can combine them with other items from this shop for the same pick up location.
</p>
<p>
<strong>This item is for self-pick up at the FSFE booth at FOSDEM 2025 only.</strong>
</p>
<p>
On the front the FSFE logo will be printed on the upper left side.
</p>
</description>
</info>
</infoset>

View File

@ -59,6 +59,50 @@
<image small="data/pictures/tshirt-nocloud-petrol-front-small.jpg" large="data/pictures/tshirt-nocloud-petrol-front-large.jpg"/>
<image small="data/pictures/tshirt-nocloud-petrol-back-small.jpg" large="data/pictures/tshirt-nocloud-petrol-back-large.jpg"/>
</item>
<item type="hoodie" id="hoodie-fourfreedoms-38c3-blue" price="60.00" date="2024-10-08">
<available size="XS" a="49" b="68"/>
<available size="S" a="52" b="70"/>
<available size="M" a="55.5" b="72"/>
<available size="L" a="59" b="74"/>
<available size="XL" a="62.5" b="76"/>
<available size="XXL" a="66" b="78"/>
<available size="3XL" a="70" b="79"/>
<available size="4XL" a="74" b="80"/>
<image small="data/pictures/hoodie-fourfreedoms-38c3-blue-back-small.png" large="data/pictures/hoodie-fourfreedoms-38c3-blue-back-large.png"/>
</item>
<item type="hoodie" id="hoodie-fourfreedoms-38c3-black" price="60.00" date="2024-10-08">
<available size="XS" a="49" b="68"/>
<available size="S" a="52" b="70"/>
<available size="M" a="55.5" b="72"/>
<available size="L" a="59" b="74"/>
<available size="XL" a="62.5" b="76"/>
<available size="XXL" a="66" b="78"/>
<available size="3XL" a="70" b="79"/>
<available size="4XL" a="74" b="80"/>
<image small="data/pictures/hoodie-fourfreedoms-38c3-black-back-small.png" large="data/pictures/hoodie-fourfreedoms-38c3-black-back-large.png"/>
</item>
<item type="hoodie" id="hoodie-fourfreedoms-fosdem-blue" price="60.00" date="2024-10-08">
<available size="XS" a="49" b="68"/>
<available size="S" a="52" b="70"/>
<available size="M" a="55.5" b="72"/>
<available size="L" a="59" b="74"/>
<available size="XL" a="62.5" b="76"/>
<available size="XXL" a="66" b="78"/>
<available size="3XL" a="70" b="79"/>
<available size="4XL" a="74" b="80"/>
<image small="data/pictures/hoodie-fourfreedoms-38c3-blue-back-small.png" large="data/pictures/hoodie-fourfreedoms-38c3-blue-back-large.png"/>
</item>
<item type="hoodie" id="hoodie-fourfreedoms-fosdem-black" price="60.00" date="2024-10-08">
<available size="XS" a="49" b="68"/>
<available size="S" a="52" b="70"/>
<available size="M" a="55.5" b="72"/>
<available size="L" a="59" b="74"/>
<available size="XL" a="62.5" b="76"/>
<available size="XXL" a="66" b="78"/>
<available size="3XL" a="70" b="79"/>
<available size="4XL" a="74" b="80"/>
<image small="data/pictures/hoodie-fourfreedoms-38c3-black-back-small.png" large="data/pictures/hoodie-fourfreedoms-38c3-black-back-large.png"/>
</item>
<item type="socks" id="socks-ilovefs" price="15.00" date="2024-01-12">
<image small="data/pictures/socks-ilovefs-small.jpg" large="data/pictures/socks-ilovefs-large.jpg"/>
<available size="#"/>

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

View File

@ -18,7 +18,7 @@
<ul>
<li><a href="#tshirt">T-Shirts</a></li>
<li><a href="#slimfit">Slimfit T-Shirts</a></li>
<!-- li><a href="#hooded">Kapuzenshirts</a></li -->
<li><a href="#hooded">Kapuzenshirts</a></li>
<li><a href="#socks">Socken</a></li>
<!-- li><a href="#baby-clothes">Babykleidung</a></li -->
<li><a href="#other">Andere Artikel</a></li>
@ -49,9 +49,9 @@
<dynamic-content type="slimfit"/>
<!-- h2 id="hooded">Kapuzenshirts</h2>
<h2 id="hooded">Kapuzenshirts</h2>
<dynamic-content type="hooded"/ -->
<dynamic-content type="hoodie"/>
<h2 id="socks">Socken</h2>
@ -79,6 +79,7 @@
<ul>
<li>Versand innerhalb Deutschlands: €5.00</li>
<li>Weltweiter Versand: €8.00</li>
<li>Pick Up: €0.00</li>
</ul>
<h2>Ihre Daten</h2>

View File

@ -18,7 +18,7 @@
<ul>
<li><a href="#tshirt">T-shirts</a></li>
<li><a href="#slimfit">Slimfit T-Shirts</a></li>
<!-- li><a href="#hooded">Hooded Shirts</a></li -->
<li><a href="#hooded">Hoodies</a></li>
<li><a href="#socks">Socks</a></li>
<!-- li><a href="#baby-clothes">Baby Clothes</a></li -->
<li><a href="#other">Other Items</a></li>
@ -48,9 +48,9 @@
<dynamic-content type="slimfit"/>
<!-- h2 id="hooded">Hooded Shirts</h2>
<h2 id="hooded">Hoodies</h2>
<dynamic-content type="hooded"/ -->
<dynamic-content type="hoodie"/>
<h2 id="socks">Socks</h2>
@ -78,6 +78,7 @@
<ul>
<li>Shipping within Germany: €5.00</li>
<li>Shipping worldwide: €8.00</li>
<li>Pick-Up Items: €0.00</li>
</ul>
<h2>Your Data</h2>

View File

@ -18,7 +18,7 @@
<ul>
<li><a href="#tshirt">Camisetas</a></li>
<li><a href="#slimfit">Camiseta slim fit</a></li>
<!-- li><a href="#hooded">Camisetas con capucha</a></li -->
<li><a href="#hooded">Camisetas con capucha</a></li>
<li><a href="#socks">Calcetines</a></li>
<!-- li><a href="#baby-clothes">Ropa de bebé</a></li -->
<li><a href="#other">Otros artículos</a></li>
@ -48,9 +48,9 @@
<dynamic-content type="slimfit"/>
<!-- h2 id="hooded">Camisetas con capucha</h2>
<h2 id="hooded">Camisetas con capucha</h2>
<dynamic-content type="hooded"/ -->
<dynamic-content type="hoodie"/>
<h2 id="socks">Calcetines</h2>

View File

@ -18,7 +18,7 @@
<ul>
<li><a href="#tshirt">T-shirts</a></li>
<li><a href="#slimfit">T-shirt cintré</a></li>
<!-- li><a href="#hooded">Sweat-shirts à capuche</a></li -->
<li><a href="#hooded">Sweat-shirts à capuche</a></li>
<li><a href="#socks">Chaussettes</a></li>
<!-- li><a href="#baby-clothes">Vêtements pour bébé</a></li -->
<li><a href="#other">Autres articles</a></li>
@ -48,9 +48,9 @@
<dynamic-content type="slimfit"/>
<!-- h2 id="hooded">Sweat-shirts à capuche</h2>
<h2 id="hooded">Sweat-shirts à capuche</h2>
<dynamic-content type="hooded"/ -->
<dynamic-content type="hoodie"/>
<h2 id="socks">Chaussettes</h2>

View File

@ -18,7 +18,7 @@
<ul>
<li><a href="#tshirt">Magliette</a></li>
<li><a href="#slimfit">Magliette slimfit</a></li>
<!-- li><a href="#hooded">Felpe con cappuccio</a></li -->
<li><a href="#hooded">Felpe con cappuccio</a></li>
<li><a href="#socks">Calzini</a></li>
<!-- li><a href="#baby-clothes">Vestiti per bambini</a></li -->
<li><a href="#other">Altri prodotti</a></li>
@ -48,9 +48,9 @@
<dynamic-content type="slimfit"/>
<!-- h2 id="hooded">Felpe con cappuccio</h2>
<h2 id="hooded">Felpe con cappuccio</h2>
<dynamic-content type="hooded"/ -->
<dynamic-content type="hoodie"/>
<h2 id="socks">Calzini</h2>

View File

@ -18,7 +18,7 @@
<ul>
<li><a href="#tshirt">T-Shirts</a></li>
<li><a href="#slimfit">Nauwsluitende T-shirts</a></li>
<!-- li><a href="#hooded">Shirts met kap (hoodies)</a></li -->
<li><a href="#hooded">Shirts met kap (hoodies)</a></li>
<li><a href="#socks">Sokken</a></li>
<!-- li><a href="#baby-clothes">Babykleding</a></li -->
<li><a href="#other">Andere artikelen</a></li>
@ -50,9 +50,9 @@
<dynamic-content type="slimfit"/>
<!-- h2 id="hooded">Shirts met kap (hoodies)</h2>
<h2 id="hooded">Shirts met kap (hoodies)</h2>
<dynamic-content type="hooded"/ -->
<dynamic-content type="hoodie"/>
<h2 id="socks">Sokken</h2>

Binary file not shown.