Esempio n. 1
0
 static function getOrderLinesHtml($basket)
 {
     // TODO make heading labels configurable
     $website = basket_plus::getBasketVar(WEBSITE);
     $website_url = "http://" . $website;
     //		$max_thumb_size = 60;
     // WORKAROUND: the inline images (created by function prepareHtml) in the mail aren't displayed correctly. Size '1' makes them invisible in the table.
     $max_thumb_size = 1;
     $body_details = "\t\t\t\t\t<table width=&quot;100%&quot;>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>          \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style=&quot;text-align:left;&quot;>" . t("Photo") . "</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style=&quot;text-align:left;&quot;>" . t("Product") . "</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style=&quot;text-align:right;&quot;>" . t("Quantity") . "</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style=&quot;text-align:right;&quot;>" . t("Price") . "</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>";
     // loop through all basket items
     // create a row for each item with thumbnail, product description, quantity and cost
     foreach ($basket->contents as $basket_item) {
         $item = $basket_item->getItem();
         $prod = ORM::factory("bp_product", $basket_item->product);
         // get real item cost
         $prod_cost = $basket_item->product_cost;
         $body_details .= "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=&quot;20%&quot; style=&quot;text-align:left;&quot;>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div id=&quot;basketThumb&quot;>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t" . basket_plus::thumb_img_abs(array("style" => "display:none;"), $max_thumb_size, false, $item, $website_url) . "&nbsp;" . $item->title . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=&quot;55%&quot; style=&quot;text-align:left;&quot;>" . $prod->description . "</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td width=&quot;10%&quot; style=&quot;text-align:right;&quot;>" . $basket_item->quantity . "</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td style=&quot;text-align:right;&quot;>" . basket_plus::formatMoneyForWeb($prod_cost) . "</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>";
     }
     // close the table
     $body_details .= "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</table>";
     return $body_details;
 }