Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function userletter($order) {
- $tx="";
- $src = (isset($_SERVER['HTTPS']) ? "https" : "http") . '://' . $_SERVER['HTTP_HOST'] .'/app/img/logo.png';
- $tx.='
- <div style="font-family:Arial;font-size:14px;color:#4a4437; width: 700px; margin: 0px auto;">
- <table style="border:0;border-collapse:collapse;width:100%;">
- <td style="width:50%;"> </td>
- <td>
- <div style="width:730px;font-family:Arial;font-size:14px;color:#4a4437;">
- <table style="width:100%;border:0;border-collapse:collapse;font-family:Arial;font-size:14px;color:#4a4437;">
- <tr>
- <td rowspan="2" style="width:1px;padding:0;">
- <img src="'.$src.'" style="width: 120px;">
- </td>
- <td style="border-bottom:1px solid #000;padding:0;text-align:right;line-height:18px;height:42px;">
- <a style="text-decoration:none;color:#f28700;" href="http://'.$_SERVER['HTTP_HOST'].'/">'.$_SERVER['HTTP_HOST'].'</a>
- </td>
- </tr>
- <tr>
- <td style="text-align:right;">
- <strong style="font-size:20px;">Check '.$_SERVER['HTTP_HOST'].'</strong>
- <div style="height:10px;"></div>
- <strong style="font-size:20px;">'.ORDER_NR.'</strong>: #'.$order->order_id.'
- </td>
- </tr>
- </table>
- <span style="font-size:20px;color:#f28700;">Email '.$order->email.'</p>
- <div style="border-top:2px solid #000;background:#f8f2e8;width:100%;font-family:Arial;font-size:14px;color:#4a4437;">
- <table style="width:100%;border:0;border-collapse:collapse;font-family:Arial;font-size:14px;color:#4a4437;">
- <tr>
- <td style="width:30%;">
-
- </td>
- <td style="">
- <div style="margin:30px 20px 30px 50px;width:365px;">
- Date personale:<br />
- <div style="font-size:16px;color:#f28700;padding: 5px 0px;">' . YOUR_PHONE . ': '.$order->phone.'</div>';
- if (!empty($order->address)) {
- $tx.='<strong>'.$order->name. ' ' . $order->surname .'<br />';
- if (!empty($order->address)) $tx.= $order->address;
- }
- $tx.='</strong>
- </div>
- </td>
- <td style="width:70%;">
-
- </td>
- </tr>
- </table>
- </div>
- <div style="height:30px;"></div>
- <span style="font-size:20px;color:#f28700;">'.ORDER_PRODUCT.'</span><br />
- <div style="height:10px;"></div>
- <table style="width:100%;border:0;border-collapse:collapse;">';
- foreach($order->products as $product) {
- $lastwo = substr($product->product_id, -2);
- if (empty($product->product->img)) $src = '/public/i/no_image_0_0_0.jpg'; else
- $src = newthumbs($product->product->img->img, 'products/' . $lastwo);
- $tx.='<tr>
- <td style="width:120px;padding:15px 15px;border-top:1px solid #000;border-bottom:1px solid #000;vertical-allign:middle;">';
- if (!empty($src)) $tx.='<img src="http://'.$_SERVER['HTTP_HOST'].''.$src.'" width="110">';
- $tx.='</td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;font-size:12px;text-transform:uppercase;width:280px;vertical-allign:middle;">
- '.$product->product->title . ' ';
- $tx.='</td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <p style="font-size:10px;color:#8f8c86;"></p>
- <span style="font-size:19px;line-height:44px;">'.$product->qty.'</span>
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <p style="font-size:10px;color:#8f8c86;"></p>
- <span style="line-height:44px;">'.number_format($product->price,2,'.',' ').' MDL</span>
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <p style="font-size:10px;color:#8f8c86;"></p>
- <span style="line-height:44px;">'.number_format(($product->price * $product->qty),2,'.',' ').' MDL</span>
- </td>
- </tr>';
- }
- $tx.='<tr>
- <td style="width:120px;padding:15px 15px;border-top:1px solid #000;border-bottom:1px solid #000;vertical-allign:middle;">
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;font-size:12px;text-transform:uppercase;width:280px;vertical-allign:middle;">
- '.ORDER_DELIVERY.'
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;"></td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- </td>
- <td style="border-top:1px solid #000;border-bottom:1px solid #000;text-align:center;white-space:nowrap;text-transform:uppercase;">
- <span style="line-height:24px;white-space:nowrap;">'.$order->delivery.' MDL</span>
- </td>
- </tr>';
- $tx.='</table>
- <div style="height:20px;"></div>
- <table style="width:100%;border:0;border-collapse:collapse;">
- <tr>
- <td><div style="width:480px;"></td>
- <td style="text-align:left;padding:padding:10px 10px 10px 0;font-size:11px;">'.ORDER_TOTAL.'</td>
- <td style="text-align:right;padding:10px;font-size:15px;white-space:nowrap;">'.number_format($order->total + $order->delivery, 2,'.',' ').' MDL</td>
- </tr>
- </table>
- </div>
- </td>
- </table>
- </div>';
- return $tx;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement