$total = $total + $order->cost;
}
?>
      <tr class="order-status-<?php 
echo $order->status;
?>
">
        <td></td>
        <td></td>
        <td></td>
        <td style="text-align:right;"><b><?php 
echo t("Total");
?>
</b></td>
        <td style="text-align:right;"><b><?php 
echo basket_plus::formatMoneyForWeb($total);
?>
</b></td>
      </tr>     
  </table>
</div>
<div class="scrollable" style="text-align:left;float:left;padding:0;font-size:12px;display:block;"><pre id="order_text"></pre>
</div>

<SCRIPT language="JavaScript">
var doc,printButton,orderText,csrf;
$(window).load(new function(){
  doc=document.show_order;
  printButton=$("#print_button");
  orderText=$("#order_text");
  csrf="?csrf="+doc.csrf.value
Пример #2
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;
 }
    ?>
        <?php 
    /* line with total:  show total incl postage when postage > 0;*/
    ?>
        <tr class="<?php 
    echo text::alternate("gOddRow", "gEvenRow");
    ?>
">
          <td></td>
          <td><b><?php 
    echo t("Total Cost");
    ?>
</b></td>
          <td></td>
          <td style="text-align:right;" id="total"><b><?php 
    echo $basket->pickup ? basket_plus::formatMoneyForWeb($total) : basket_plus::formatMoneyForWeb($total + $postage);
    ?>
</b></td>
          <td></td>
        </tr>
        <?php 
    /* line with pickup choice: show only when postage > 0; when pickup is changed, trigger script (see top) */
    ?>
        <?php 
    if ($postage > 0) {
        ?>
          <?php 
        if (basket_plus::getBasketVar(ALLOW_PICKUP)) {
            ?>
            <tr class="bp-table-noborder">
              <td colspan="5"><input id="pickup" type="checkbox" <?php 
    echo $product->id;
    ?>
" class="<?php 
    echo text::alternate("gOddRow", "gEvenRow");
    ?>
">
        <td id="product-<?php 
    echo $product->id;
    ?>
" class="core-info ">
          <?php 
    echo html::clean($product->name);
    ?>
</td>
        <td><?php 
    echo basket_plus::formatMoneyForWeb($product->cost);
    ?>
</td>
        <td><?php 
    echo html::clean($product->description);
    ?>
</td>
        <td><?php 
    echo html::clean($product->bp_postage_band->name);
    ?>
</td>
        <td class="g-actions"><a href="<?php 
    echo url::site("admin/product_lines/edit_product_form/{$product->id}");
    ?>
"
          open_text="<?php 
    echo text::alternate("gOddRow", "gEvenRow");
    ?>
">
        <td id="product-<?php 
    echo $postage_band->id;
    ?>
" class="core-info "><?php 
    echo html::clean($postage_band->name);
    ?>
</td>
				<td><?php 
    echo basket_plus::formatMoneyForWeb($postage_band->flat_rate);
    ?>
</td>
				<td><?php 
    echo basket_plus::formatMoneyForWeb($postage_band->per_item);
    ?>
</td>
        <td class="core-info "><input id="via_download" type="checkbox" disabled="disabled" 
								<?php 
    if ($postage_band->via_download) {
        ?>
checked="checked"<?php 
    }
    ?>
				/></td>
				<td class="g-actions"><a href="<?php 
    echo url::site("admin/postage_bands/edit_postage_band_form/{$postage_band->id}");
    ?>
"
          open_text="<?php 
      <?php 
}
?>
      <tr id="" class="<?php 
echo text::alternate("gOddRow", "gEvenRow");
?>
">
        <td></td>
        <td></td>
        <td><b><?php 
echo t("Total Cost");
?>
</b></td>
        <td></td>
        <td style="text-align:right;"><b><?php 
echo $basket->pickup ? basket_plus::formatMoneyForWeb($basket->product_cost()) : basket_plus::formatMoneyForWeb($basket->product_cost() + $postage);
?>
</b></td>
      </tr>
    </table>
  </div>
  <table class="bp-table-noborder">
    <tr>
      <td>
				<?php 
if ($basket->street != "") {
    ?>
					<h3><?php 
    echo t("Name and Address");
    ?>
</h3>
Пример #7
0
 static function getProductArray($id)
 {
     $producta = array();
     // check for product override
     $product_override = ORM::factory("bp_product_override")->where('item_id', "=", $id)->find();
     if (!$product_override->loaded()) {
         // no override found so check parents
         // check parents for product override
         $item = ORM::factory("item", $id);
         $parents = $item->parents();
         foreach ($parents as $parent) {
             // check for product override
             $temp_override = ORM::factory("bp_product_override")->where('item_id', "=", $parent->id)->find();
             if ($temp_override->loaded()) {
                 $product_override = $temp_override;
                 //break;
             }
         }
     }
     $products = ORM::factory("bp_product")->find_all();
     foreach ($products as $product) {
         $show = true;
         $cost = $product->cost;
         if ($product_override->loaded()) {
             $show = !$product_override->none;
             $item_product = ORM::factory("bp_item_product")->where('product_override_id', "=", $product_override->id)->where('product_id', "=", $product->id)->find();
             if ($item_product->loaded()) {
                 $cost = $item_product->cost;
                 if (!$show) {
                     $show = $item_product->include;
                 }
             }
         }
         if ($show) {
             $producta[$product->id] = html::clean($product->description) . " (" . basket_plus::formatMoneyForWeb($cost) . ")";
         }
     }
     return $producta;
 }