- Almost complete
Do you feel generous today ?
| Album | Product | Quantity | Unit price | Total price |
';
$items=array_keys(json_decode($_POST['item'], true));
$_POST['shipping']=json_decode($_POST['shipping'], true);
$order=json_decode($_POST['item'], true);
$options=json_decode($_POST['option'], true);
$productcount=0;
$unitcount=0;
$pricecount=0;
foreach ($items as $item){
$products=array_keys($order[$item]);
foreach ($products as $product){
if (is_numeric($order[$item][$product])&&intval($order[$item][$product])>0){
echo '| '.htmlspecialchars($item).' | '.htmlspecialchars($product);
if (in_array($product, array_keys($material_support))){
$that=$material_support[$product]['option'];
if (isset($that)&&$that!==''){
echo ' Option: ';
if (isset($options[$item][$product])){
echo htmlspecialchars($options[$item][$product]);
}
else {
echo 'Please select an option for this item, otherwise we will consider you do not mind and chose it randomly in our stock';
}
}
}
echo ' | ';
echo ''.htmlspecialchars($order[$item][$product]);
echo ' | ';
$howmany=intval($order[$item][$product]);
$unitprice=$material_support[$product]['price'];
$totalprice=$unitprice * $howmany;
echo ''.htmlspecialchars($unitprice).' | ';
echo ''.htmlspecialchars($totalprice).' | ';
echo '
';
$unitcount+=$howmany;
$pricecount+=$totalprice;
$productcount+=$order[$item][$product];
}
}
}
echo '| Raw total | ';
echo ''.htmlspecialchars($unitcount).' | ';
echo 'N/A | ';
echo ''.htmlspecialchars($pricecount).' | ';
echo '
';
echo '';
echo '| Shipping | ';
echo ''.htmlspecialchars($_POST['shipping']).' | ';
if (in_array($_POST['shipping'],array_keys($material_shipping))){
$shipping_price=floatval($material_shipping[$_POST['shipping']]);
}
else
{ die(); }
echo ''.htmlspecialchars($unitcount).' | ';
echo ''.htmlspecialchars($shipping_price).' | ';
$totalshipping=$unitcount*$shipping_price;
echo ''.htmlspecialchars($totalshipping).' | ';
echo '
';
echo '| Net total | ';
echo ''.htmlspecialchars($totalshipping+$pricecount).' | ';
echo '
';
echo '';
if (!$ismaterialnameyourprice){
echo 'You may want to support our work and our will to sell cheap by making an optional donation to support the label :
';
} else {
echo 'It is time to choose how much you are willing to pay for this order. See below for information about our "name your price, no minimum" policy.
';
}
echo 'Order total : '.htmlspecialchars($material_currency).' ';
echo htmlspecialchars($totalshipping+$pricecount);
echo '
';
if (!$ismaterialnameyourprice){
echo 'Your tip : '.htmlspecialchars($material_currency).' ';
}
else {
echo 'This is the recommended, reasonable price. You choose what you want to pay : '.htmlspecialchars($material_currency).' ';
}
echo '';
if ($ismaterialnameyourprice) {
echo ''.$materialnameyourpricenotice.'
';
}
echo '
Please note that our orders, no matter if the payment has been processed or the order cancelled, are anonymously but publicly available, for people to know how the label is going. Personnal data will not be displayed, Only anonymous data about orders history are made available for the audience.';
?>