HEX
Server: Apache/2.4.25 (Debian)
System: Linux server17 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User: web37 (1062)
PHP: 7.4.30
Disabled: show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
Upload Files
File: /var/www/web37/htdocs/telefon-sex/res/emailtemplates/products.csv.template.php
<?php

if (isset($orderData['products']) && is_array($orderData['products'])) {
    // Detect the required format
    $opt = false;
    $vat = $settings['vat_type'] != "none";
    $description = false;
    foreach ($orderData['products'] as $key => $value) {
        if (isset($value["option"]) && $value["option"] != "null" && strlen($value["option"])) {
            $opt = true;
        }
        if (isset($value['description'])) {
            $description = true;
        }
    }
    // Header
    echo $l10n->get("cart_name") . ";"
       . ($description ? $l10n->get("cart_descr") . ";" : "")
       . ($opt ? $l10n->get("product_option") . ";" : "")
       . $l10n->get("cart_qty") . ";"
       . $l10n->get("cart_price") . ";"
       . ($vat ? $l10n->get("cart_vat") .";" : "")
       . $l10n->get("cart_subtot");
    // Contents
    foreach ($orderData['products'] as $key => $value) {
        echo "\n" 
        . strip_tags(str_replace(array("\n", "\r"), "", $value["name"])) . ";" 
        . ($description ? strip_tags(str_replace(array("\n", "\r"), "", $value["description"])) . ";" : "")
        . (($opt && $value["option"] != "null") ? $value["option"] . ( $value["suboption"] != "null" ? " " . $value["suboption"] . ";" : "") : "")
        . $value["quantity"] . ";"
        . ($settings['vat_type'] == "excluded" ? $value["singlePrice"] : $value['singlePricePlusVat']) . ";"
        . ($vat ? $value["vat"] .";" : "")
        . ($settings['vat_type'] == "excluded" ? $value["price"] : $value['pricePlusVat']);
    }
}