function getProducts() { global $toC_Json, $osC_Language; $osC_Tax = new osC_Tax_Admin(); $osC_Currencies = new osC_Currencies_Admin(); $osC_Order = new osC_Order($_REQUEST['orders_id']); $records = array(); foreach ($osC_Order->getProducts() as $product) { $product_info = $product['quantity'] . ' x ' . $product['name']; if (isset($product['variants']) && is_array($product['variants']) && sizeof($product['variants']) > 0) { foreach ($product['variants'] as $variants) { $product_info .= '<br /><nobr> <i>' . $variants['groups_name'] . ': ' . $variants['values_name'] . '</i></nobr>'; } } if ($product['type'] == PRODUCT_TYPE_GIFT_CERTIFICATE) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('senders_name') . ': ' . $product['senders_name'] . '</i></nobr>'; if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('senders_email') . ': ' . $product['senders_email'] . '</i></nobr>'; } $product_info .= '<br /><nobr> <i>' . $osC_Language->get('recipients_name') . ': ' . $product['recipients_name'] . '</i></nobr>'; if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('recipients_email') . ': ' . $product['recipients_email'] . '</i></nobr>'; } $product_info .= '<br /><nobr> <i>' . $osC_Language->get('messages') . ': ' . $product['messages'] . '</i></nobr>'; } $records[] = array('products' => $product_info, 'return_quantity' => $product['return_quantity'] > 0 ? $product['return_quantity'] : '', 'model' => $product['model'], 'tax' => $osC_Tax->displayTaxRateValue($product['tax']), 'price_net' => $osC_Currencies->format($product['final_price'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'price_gross' => $osC_Currencies->displayPriceWithTaxRate($product['final_price'], $product['tax'], 1, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'total_net' => $osC_Currencies->format($product['final_price'] * $product['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'total_gross' => $osC_Currencies->displayPriceWithTaxRate($product['final_price'], $product['tax'], $product['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue())); } foreach ($osC_Order->getTotals() as $totals) { $records[] = array('products' => '', 'model' => '', 'tax' => '', 'price_net' => '', 'price_gross' => $totals['title'], 'total_net' => '', 'total_gross' => $totals['text']); } $response = array(EXT_JSON_READER_ROOT => $records); echo $toC_Json->encode($response); }
function listOrdersEditProducts() { global $toC_Json, $osC_Database, $osC_Language, $osC_ShoppingCart, $osC_Currencies, $osC_Weight, $osC_Tax; $osC_Tax = new osC_Tax_Admin(); $osC_Weight = new osC_Weight(); $osC_Currencies = new osC_Currencies(); $osC_Order = new osC_Order($_REQUEST['orders_id']); $records = array(); foreach ($osC_Order->getProducts() as $products_id_string => $product) { $product_info = $product['name']; if (isset($product['variants']) && is_array($product['variants']) && sizeof($product['variants']) > 0) { foreach ($product['variants'] as $variants) { $product_info .= '<br /><nobr> <i>' . $variants['groups_name'] . ': ' . $variants['values_name'] . '</i></nobr>'; } } if (isset($product['customizations']) && !empty($product['customizations'])) { $product_info .= '<p>'; foreach ($product['customizations'] as $key => $customization) { $product_info .= '<div style="float: left">' . $customization['qty'] . ' x ' . '</div>'; $product_info .= '<div style="margin-left: 25px">'; foreach ($customization['fields'] as $orders_products_customizations_values_id => $field) { if ($field['customization_type'] == CUSTOMIZATION_FIELD_TYPE_INPUT_TEXT) { $product_info .= $field['customization_fields_name'] . ': ' . $field['customization_value'] . '<br />'; } else { $product_info .= $field['customization_fields_name'] . ': <a href="' . osc_href_link_admin(FILENAME_JSON, 'module=orders&action=download_customization_file&file=' . $field['customization_value'] . '&cache_file=' . $field['cache_filename']) . '">' . $field['customization_value'] . '</a>' . '<br />'; } } $product_info .= '</div>'; } $product_info .= '</p>'; } if ($product['type'] == PRODUCT_TYPE_GIFT_CERTIFICATE) { $product_info .= ' (' . $product['gift_certificates_code'] . ')'; $product_info .= '<br /><nobr> <i>' . $osC_Language->get('senders_name') . ': ' . $product['senders_name'] . '</i></nobr>'; if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('senders_email') . ': ' . $product['senders_email'] . '</i></nobr>'; } $product_info .= '<br /><nobr> <i>' . $osC_Language->get('recipients_name') . ': ' . $product['recipients_name'] . '</i></nobr>'; if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('recipients_email') . ': ' . $product['recipients_email'] . '</i></nobr>'; } $product_info .= '<br /><nobr> <i>' . $osC_Language->get('messages') . ': ' . $product['messages'] . '</i></nobr>'; } $osC_Product = new osC_Product($product['id'], $osC_Order->getCustomer('customers_id')); $records[] = array('orders_products_id' => $product['orders_products_id'], 'products_id' => $product['id'], 'products_type' => $product['type'], 'products' => $product_info, 'quantity' => $product['quantity'] > 0 ? $product['quantity'] : '', 'qty_in_stock' => $osC_Product->getQuantity($products_id_string), 'sku' => $product['sku'], 'tax' => $osC_Tax->displayTaxRateValue($product['tax']), 'price_net' => round($product['final_price'] * $osC_Order->getCurrencyValue(), 2), 'price_gross' => $osC_Currencies->displayPriceWithTaxRate($product['final_price'], $product['tax'], 1, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'total_net' => $osC_Currencies->format($product['final_price'] * $product['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'total_gross' => $osC_Currencies->displayPriceWithTaxRate($product['final_price'], $product['tax'], $product['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'action' => array('class' => 'icon-delete-record', 'qtip' => '')); } $order_totals = '<table cellspacing="5" cellpadding="5" width="300" border="0">'; foreach ($osC_Order->getTotals() as $totals) { $order_totals .= '<tr><td align="right">' . $totals['title'] . ' </td><td width="60">' . $totals['text'] . '</td></tr>'; } $order_totals .= '</table>'; $response = array(EXT_JSON_READER_ROOT => $records, 'totals' => $order_totals, 'shipping_method' => $osC_Order->getDeliverMethod()); echo $toC_Json->encode($response); }
echo $osC_Language->get('table_heading_total_gross'); ?> </th> </tr> </thead> <tbody> <?php foreach ($osC_Order->getProducts() as $product) { echo ' <tr>' . "\n" . ' <td valign="top" align="right">' . $product['quantity'] . ' x</td>' . "\n" . ' <td valign="top">' . $product['name']; if (isset($product['attributes']) && sizeof($product['attributes']) > 0) { foreach ($product['attributes'] as $attribute) { echo '<br /><nobr> ' . $attribute['option'] . ': ' . $attribute['value'] . '</nobr>'; } } echo ' </td>' . "\n" . ' <td valign="top">' . $product['model'] . '</td>' . "\n"; echo ' <td align="right" valign="top">' . $osC_Tax->displayTaxRateValue($product['tax']) . '</td>' . "\n" . ' <td align="right" valign="top"><b>' . $osC_Currencies->format($product['price'], true, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()) . '</b></td>' . "\n" . ' <td align="right" valign="top"><b>' . $osC_Currencies->displayPriceWithTaxRate($product['price'], $product['tax'], 1, true, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()) . '</b></td>' . "\n" . ' <td align="right" valign="top"><b>' . $osC_Currencies->format($product['price'] * $product['quantity'], true, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()) . '</b></td>' . "\n" . ' <td align="right" valign="top"><b>' . $osC_Currencies->displayPriceWithTaxRate($product['price'], $product['tax'], $product['quantity'], true, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()) . '</b></td>' . "\n"; echo ' </tr>' . "\n"; } ?> </tbody> </table> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <?php foreach ($osC_Order->getTotals() as $total) { echo ' <tr>' . "\n" . ' <td align="right">' . $total['title'] . '</td>' . "\n" . ' <td align="right">' . $total['text'] . '</td>' . "\n" . ' </tr>' . "\n"; } ?> </table></td> </tr> </table>
function listOrdersEditProducts() { global $toC_Json, $osC_Database, $osC_Language, $osC_ShoppingCart, $osC_Currencies, $osC_Weight, $osC_Tax; $osC_Tax = new osC_Tax_Admin(); $osC_Weight = new osC_Weight(); $osC_Currencies = new osC_Currencies(); $osC_Order = new osC_Order($_REQUEST['orders_id']); $records = array(); foreach ($osC_Order->getProducts() as $products_id_string => $product) { $product_info = $product['name']; if (isset($product['variants']) && is_array($product['variants']) && sizeof($product['variants']) > 0) { foreach ($product['variants'] as $variants) { $product_info .= '<br /><nobr> <i>' . $variants['groups_name'] . ': ' . $variants['values_name'] . '</i></nobr>'; } } if ($product['type'] == PRODUCT_TYPE_GIFT_CERTIFICATE) { $product_info .= ' (' . $product['gift_certificates_code'] . ')'; $product_info .= '<br /><nobr> <i>' . $osC_Language->get('senders_name') . ': ' . $product['senders_name'] . '</i></nobr>'; if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('senders_email') . ': ' . $product['senders_email'] . '</i></nobr>'; } $product_info .= '<br /><nobr> <i>' . $osC_Language->get('recipients_name') . ': ' . $product['recipients_name'] . '</i></nobr>'; if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) { $product_info .= '<br /><nobr> <i>' . $osC_Language->get('recipients_email') . ': ' . $product['recipients_email'] . '</i></nobr>'; } $product_info .= '<br /><nobr> <i>' . $osC_Language->get('messages') . ': ' . $product['messages'] . '</i></nobr>'; } $osC_Product = new osC_Product($product['id'], $osC_Order->getCustomer('customers_id')); $records[] = array('orders_products_id' => $product['orders_products_id'], 'products_id' => $product['id'], 'products_type' => $product['type'], 'products' => $product_info, 'quantity' => $product['quantity'] > 0 ? $product['quantity'] : '', 'qty_in_stock' => $osC_Product->getQuantity($products_id_string), 'sku' => $product['sku'], 'tax' => $osC_Tax->displayTaxRateValue($product['tax']), 'price_net' => round($product['final_price'] * $osC_Order->getCurrencyValue(), 2), 'price_gross' => $osC_Currencies->displayPriceWithTaxRate($product['final_price'], $product['tax'], 1, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'total_net' => $osC_Currencies->format($product['final_price'] * $product['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'total_gross' => $osC_Currencies->displayPriceWithTaxRate($product['final_price'], $product['tax'], $product['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()), 'action' => array('class' => 'icon-delete-record', 'qtip' => '')); } $order_totals = '<table cellspacing="5" cellpadding="5" width="300" border="0">'; foreach ($osC_Order->getTotals() as $totals) { $order_totals .= '<tr><td align="right">' . $totals['title'] . ' </td><td width="60">' . $totals['text'] . '</td></tr>'; } $order_totals .= '</table>'; $response = array(EXT_JSON_READER_ROOT => $records, 'totals' => $order_totals, 'shipping_method' => $osC_Order->getDeliverMethod()); echo $toC_Json->encode($response); }
<?php echo $products['name']; if (isset($products['attributes']) && is_array($products['attributes']) && sizeof($products['attributes']) > 0) { foreach ($products['attributes'] as $attributes) { echo '<br /><nobr> <i>' . $attributes['option'] . ': ' . $attributes['value'] . '</i></nobr>'; } } ?> </td> <td valign="top"><?php echo $products['model']; ?> </td> <td valign="top" align="right"><?php echo $osC_Tax->displayTaxRateValue($products['tax']); ?> </td> <td valign="top" align="right"><?php echo $osC_Currencies->format($products['price'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()); ?> </td> <td valign="top" align="right"><?php echo $osC_Currencies->displayPriceWithTaxRate($products['price'], $products['tax'], 1, true, $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()); ?> </td> <td valign="top" align="right"><?php echo $osC_Currencies->format($products['price'] * $products['quantity'], $osC_Order->getCurrency(), $osC_Order->getCurrencyValue()); ?> </td> <td valign="top" align="right"><?php