echo ucfirst($customer->lastname); ?> </a></td> <td class="nowrap " width="15%" ><a href="<?php echo $customer_view_link; ?> " ><?php echo ucfirst($customer->firstname); ?> </a></td> <td class="nowrap hidden-phone" width="25%" ><?php echo $customer->email; ?> </td> <td class="nowrap " width="6%" ><?php echo JeproshopTools::displayPrice($customer->total_spent); ?> </td> <?php if (JeproshopSettingModelSetting::getValue('enable_b2b_mode')) { ?> <td class="nowrap" width="5" ><?php if (isset($customer->website)) { ?> <a href="<?php echo $customer->website; ?> " ><?php } echo ucfirst($customer->company); if (isset($customer->website)) {
?> }</td> <td class="partial_refund_fields current-edit" style="display:none;"></td> </tr> <?php } $order_total_price = $this->order->total_paid_tax_incl; ?> <tr id="total_order"> <td class="text-right"><strong><?php echo ucfirst(JText::_('COM_JEPROSHOP_TOTAL_LABEL')); ?> </strong></td> <td class="amount text-right"> <strong><?php echo JeproshopTools::displayPrice($order_total_price, $this->currency->currency_id); ?> </strong> </td> <td class="partial_refund_fields current-edit" style="display:none;"></td> </tr> </table> </div> </div> </div> </div> <div style="clear: both; " ></div> <div style="display: none;" class="standard_refund_fields form-horizontal panel"> <div class="form-group"> <?php if ($this->order->hasBeenDelivered() && JeproshopSettingModelSetting::getValue('return_order')) {
?> </th> </tr> <?php foreach ($this->discounts as $discount) { ?> <tr> <td><a href="<?php echo JRoute::_('index.php?option=com_jeproshop&view=discount&task=update&discount_id=' . $discount->discount_id . '&' . JeproshopTools::getDiscountToken() . '=1'); ?> "><?php echo $discount->name; ?> </a></td> <td class="text-center">- <?php echo JeproshopTools::displayPrice($discount->value_real, $this->currency); ?> </td> </tr> <?php } ?> </table> <?php } ?> <div class="alert alert-warning"> <?php echo JText::_('COM_JEPROSHOP_FOR_THIS_PARTICULAR_CUSTOMER_GROUP_PRICES_ARE_DISPLAYED_AS_LABEL') . ' : <b>' . ($this->order->getTaxCalculationMethod() == COM_JEPROSHOP_TAX_EXCLUDED ? JText::_('COM_JEPROSHOP_TAX_EXCLUDED_LABEL') : JText::_('COM_JEPROSHOP_TAX_INCLUDED_LABEL')) . '</b>'; ?> </div>
public static function getTotalCart($cart_id, $use_tax_display = false, $type = JeproshopCartModelCart::BOTH) { $cart = new JeproshopCartModelCart($cart_id); if (!JeproshopTools::isLoadedObject($cart, 'cart_id')) { die(Tools::displayError()); } $with_taxes = $use_tax_display ? $cart->_taxCalculationMethod != COM_JEPROSHOP_TAX_EXCLUDED : true; return JeproshopTools::displayPrice($cart->getOrderTotal($with_taxes, $type), JeproshopCurrencyModelCurrency::getCurrencyInstance((int) $cart->currency_id), false); }
public function renderView($tpl = null) { if ($this->getLayout() !== 'modal') { } if ($this->context == null) { $this->context = JeproshopContext::getContext(); } $db = JFactory::getDBO(); $this->setLayout('view'); $this->loadObject(); if (!JeproshopTools::isLoadedObject($this->customer, 'customer_id')) { return; } $this->context->customer = $this->customer; $customer_stats = $this->customer->getStats(); $query = "SELECT SUM(total_paid_real) FROM " . $db->quoteName('#__jeproshop_orders'); $query .= " WHERE customer_id = " . (int) $this->customer->customer_id . " AND valid = 1"; $db->setQuery($query); $total_customer = $db->loadResult(); if ($total_customer) { $query = "SELECT SQL_CALC_FOUND_ROWS COUNT(*) FROM " . $db->quoteName('#__jeproshop_orders'); $query .= " WHERE valid = 1 AND customer_id != " . (int) $this->customer->customer_id . " GROUP BY "; $query .= "customer_id HAVING SUM(total_paid_real) > " . (int) $total_customer; $db->setQuery($query); $db->loadResult(); $count_better_customers = (int) $db->loadResult('SELECT FOUND_ROWS()') + 1; } else { $count_better_customers = '-'; } $orders = JeproshopOrderModelOrder::getCustomerOrders($this->customer->customer_id, true); $total_orders = count($orders); for ($i = 0; $i < $total_orders; $i++) { $orders[$i]->total_paid_real_not_formated = $orders[$i]->total_paid_real; $orders[$i]->total_paid_real = JeproshopTools::displayPrice($orders[$i]->total_paid_real, new JeproshopCurrencyModelCurrency((int) $orders[$i]->currency_id)); } $messages = JeproshopCustomerThreadModelCustomerThread::getCustomerMessages((int) $this->customer->customer_id); $total_messages = count($messages); for ($i = 0; $i < $total_messages; $i++) { $messages[$i]->message = substr(strip_tags(html_entity_decode($messages[$i]->message, ENT_NOQUOTES, 'UTF-8')), 0, 75); $messages[$i]->date_add = Tools::displayDate($messages[$i]->date_add, null, true); } $groups = $this->customer->getGroups(); $total_groups = count($groups); for ($i = 0; $i < $total_groups; $i++) { $group = new JeproshopGroupModelGroup($groups[$i]); $groups[$i] = array(); $groups[$i]['group_id'] = $group->group_id; $groups[$i]['name'] = $group->name[$this->context->controller->default_form_language]; } $total_ok = 0; $orders_ok = array(); $orders_ko = array(); foreach ($orders as $order) { if (!isset($order->order_state)) { $order->order_state = JText::_('COM_JEPROSHOP_THERE_IS_NO_STATUS_DEFINED_FOR_THIS_ORDER_MESSAGE'); } if ($order->valid) { $orders_ok[] = $order; $total_ok += $order->total_paid_real_not_formated; } else { $orders_ko[] = $order; } } $products = $this->customer->getBoughtProducts(); $carts = JeproshopCartModelCart::getCustomerCarts($this->customer->customer_id); $total_carts = count($carts); for ($i = 0; $i < $total_carts; $i++) { $cart = new JeproshopCartModelCart((int) $carts[$i]->cart_id); $this->context->cart = $cart; $summary = $cart->getSummaryDetails(); $currency = new JeproshopCurrencyModelCurrency((int) $carts[$i]->currency_id); $carrier = new JeproshopCarrierModelCarrier((int) $carts[$i]->carrier_id); $carts[$i]['id_cart'] = sprintf('%06d', $carts[$i]['id_cart']); $carts[$i]['date_add'] = JeproshopValidator::displayDate($carts[$i]->date_add, null, true); $carts[$i]['total_price'] = Tools::displayPrice($summary->total_price, $currency); $carts[$i]->name = $carrier->name; } $query = "SELECT DISTINCT cart_product.product_id, cart.cart_id, cart.shop_id, cart_product.shop_id "; $query .= " AS cart_product_shop_id FROM " . $db->quoteName('#__jeproshop_cart_product') . " AS cart_product"; $query .= " JOIN " . $db->quoteName('#__jeproshop_cart') . " AS cart ON (cart.cart_id = cart_product.cart_id) "; $query .= "JOIN " . $db->quoteName('#__jeproshop_product') . " AS product ON (cart_product.product_id = product."; $query .= "product_id) WHERE cart.customer_id = " . (int) $this->customer->customer_id . " AND cart_product.product_id"; $query .= " NOT IN ( SELECT product_id FROM " . $db->quoteName('#__jeproshop_orders') . " AS ord JOIN "; $query .= $db->quoteName('#__jeproshop_order_detail') . " AS ord_detail ON (ord.order_id = ord_detail.order_id ) WHERE "; $query .= "ord.valid = 1 AND ord.customer_id = " . (int) $this->customer->customer_id . ")"; $db->setQuery($query); $interested = $db->loadObjectList(); $total_interested = count($interested); for ($i = 0; $i < $total_interested; $i++) { $product = new JeproshopProductModelProduct($interested[$i]->product_id, false, $this->context->controller->default_form_language, $interested[$i]->shop_id); if (!Validate::isLoadedObject($product, 'product_id')) { continue; } $interested[$i]->url = $this->context->controller->getProductLink($product->product_id, $product->link_rewrite, JeproshopCategoryModelCategory::getLinkRewrite($product->default_category_id, $this->context->controller->default_form_language), null, null, $interested[$i]->cp_shop_id); $interested[$i]->product_id = (int) $product->product_id; $interested[$i]->name = htmlentities($product->name); } $connections = $this->customer->getLastConnections(); if (!is_array($connections)) { $connections = array(); } $total_connections = count($connections); for ($i = 0; $i < $total_connections; $i++) { $connections[$i]->http_referer = $connections[$i]->http_referer ? preg_replace('/^www./', '', parse_url($connections[$i]->http_referer, PHP_URL_HOST)) : JText::_('COM_JEPROSHOP_DIRECT_LINK_LABEL'); } $referrers = JeproshopReferrerModelReferrer::getReferrers($this->customer->customer_id); $total_referrers = count($referrers); for ($i = 0; $i < $total_referrers; $i++) { $referrers[$i]->date_add = JeproshopTools::displayDate($referrers[$i]->date_add, null, true); } $customerLanguage = new JeproshopLanguageModelLanguage($this->customer->lang_id); $shop = new JeproshopShopModelShop($this->customer->shop_id); //$this->assignRef('customer', $customer); /*'gender' => $gender, /* 'gender_image' => $gender_image, // General information of the customer */ $registration = JeproshopTools::displayDate($this->customer->date_add, null, true); $this->assignRef('registration_date', $registration); $this->assignRef('customer_stats', $customer_stats); $last_visit = JeproshopTools::displayDate($customer_stats->last_visit, null, true); $this->assignRef('last_visit', $last_visit); $this->assignRef('count_better_customers', $count_better_customers); $shop_feature_active = JeproshopShopModelShop::isFeaturePublished(); $this->assignRef('shop_is_feature_active', $shop_feature_active); $this->assignRef('shop_name', $shop->shop_name); $customerBirthday = JeproshopTools::displayDate($this->customer->birthday); $this->assignRef('customer_birthday', $customerBirthday); $last_update = JeproshopTools::displayDate($this->customer->date_upd, null, true); $this->assignRef('last_update', $last_update); $customerExists = JeproshopCustomerModelCustomer::customerExists($this->customer->email); $this->assignRef('customer_exists', $customerExists); $this->assignRef('lang_id', $this->customer->lang_id); $this->assignRef('customerLanguage', $customerLanguage); // Add a Private note $customerNote = JeproshopTools::htmlentitiesUTF8($this->customer->note); $this->assignRef('customer_note', $customerNote); // Messages $this->assignRef('messages', $messages); // Groups $this->assignRef('groups', $groups); // Orders $this->assignRef('orders', $orders); $this->assignRef('orders_ok', $orders_ok); $this->assignRef('orders_ko', $orders_ko); $total_ok = JeproshopTools::displayPrice($total_ok, $this->context->currency->currency_id); $this->assignRef('total_ok', $total_ok); // Products $this->assignRef('products', $products); // Addresses $addresses = $this->customer->getAddresses($this->context->controller->default_form_language); $this->assignRef('addresses', $addresses); // Discounts $discounts = JeproshopCartRuleModelCartRule::getCustomerCartRules($this->context->controller->default_form_language, $this->customer->customer_id, false, false); $this->assignRef('discounts', $discounts); // Carts $this->assignRef('carts', $carts); // Interested $this->assignRef('interested_products', $interested); // Connections $this->assignRef('connections', $connections); // Referrers $this->assignRef('referrers', $referrers); if ($this->getLayout() != 'modal') { $this->addToolBar(); $this->sideBar = JHtmlSidebar::render(); } parent::display($tpl); }
/** * Display WT price with currency * * @param $price * @param $currency * @internal param array $params * @internal param \DEPRECATED $object $smarty * @return Ambiguous <string, mixed, Ambiguous <number, string>> */ public static function displayWtPriceWithCurrency($price, &$currency) { return JeproshopTools::displayPrice($price, $currency, false); }
public function renderView($tpl = NULL) { if (!isset($this->context) || $this->context == null) { $this->context = JeproshopContext::getContext(); } $app = JFactory::getApplication(); $order = new JeproshopOrderModelOrder($app->input->get('order_id')); if (!JeproshopTools::isLoadedObject($order, 'order_id')) { JError::raiseError(500, JText::_('COM_JEPROSHOP_THE_ORDER_CANNOT_BE_FOUND_WITHIN_YOUR_DATA_BASE_MESSAGE')); } $customer = new JeproshopCustomerModelCustomer($order->customer_id); $carrier = new JeproshopCarrierModelCarrier($order->carrier_id); $products = $this->getProducts($order); $currency = new JeproshopCurrencyModelCurrency((int) $order->currency_id); // Carrier module call $carrier_module_call = null; if ($carrier->is_module) { /*$module = Module::getInstanceByName($carrier->external_module_name); if (method_exists($module, 'displayInfoByCart')) $carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $order->id_cart); */ } // Retrieve addresses information $addressInvoice = new JeproshopAddressModelAddress($order->address_invoice_id, $this->context->language->lang_id); if (JeproshopTools::isLoadedObject($addressInvoice, 'address_id') && $addressInvoice->state_id) { $invoiceState = new JeproshopStateModelState((int) $addressInvoice->state_id); } if ($order->address_invoice_id == $order->address_delivery_id) { $addressDelivery = $addressInvoice; if (isset($invoiceState)) { $deliveryState = $invoiceState; } } else { $addressDelivery = new JeproshopAddressModelAddress($order->address_delivery_id, $this->context->language->lang_id); if (JeproshopTools::isLoadedObject($addressDelivery, 'address_id') && $addressDelivery->state_id) { $deliveryState = new JeproshopStateModelState((int) $addressDelivery->state_id); } } $title = JText::_('COM_JEPROSHOP_ORDER_LABEL') . ' '; //todo learn how to display //$toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->order_id, $order->reference, $customer->firstname, $customer->lastname); if (JeproshopShopModelShop::isFeaturePublished()) { $shop = new JeproshopShopModelShop((int) $order->shop_id); //$this->toolbar_title .= ' - '.sprintf($this->l('Shop: %s'), $shop->name); } JToolBarHelper::title($title); // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; $order_details = $order->getOrderDetailList(); foreach ($order_details as $order_detail) { $product = new JeproshopProductModelProduct($order_detail->product_id); if (JeproshopSettingModelSetting::getValue('advanced_stock_management') && $product->advanced_stock_management) { $warehouses = JeproshopWarehouseModelWarehouse::getWarehousesByProductId($order_detail->product_id, $order_detail->product_attribute_id); foreach ($warehouses as $warehouse) { if (!isset($warehouse_list[$warehouse->warehouse_id])) { $warehouse_list[$warehouse->warehouse_id] = $warehouse; } } } } $payment_methods = array(); /*foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) $payment_methods[] = $module->displayName; }*/ // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_status = $order->getCurrentOrderStatus(); if (JeproshopSettingModelSetting::getValue('stock_management') && (!JeproshopTools::isLoadedObject($current_order_status, 'order_id') || $current_order_status->delivery != 1 && $current_order_status->shipped != 1)) { $display_out_of_stock_warning = true; } // products current stock (from stock_available) foreach ($products as &$product) { $product->current_stock = JeproshopStockAvailableModelStockAvailable::getQuantityAvailableByProduct($product->product_id, $product->product_attribute_id, $product->shop_id); $resume = JeproshopOrderSlipModelOrderSlip::getProductSlipResume($product->order_detail_id); $product->quantity_refundable = $product->product_quantity - $resume->product_quantity; $product->amount_refundable = $product->total_price_tax_incl - $resume->amount_tax_incl; $product->amount_refund = JeproshopTools::displayPrice($resume->amount_tax_incl, $currency); $product->refund_history = JeproshopOrderSlipModelOrderSlip::getProductSlipDetail($product->order_detail_id); $product->return_history = JeproshopOrderReturnModelOrderReturn::getProductReturnDetail($product->order_detail_id); // if the current stock requires a warning if ($product->current_stock == 0 && $display_out_of_stock_warning) { JError::raiseWarning(500, JText::_('COM_JEPROSHOP_THIS_PRODUCT_IS_OUT_OF_STOCK_LABEL') . ' : ' . $product->product_name); } if ($product->warehouse_id != 0) { $warehouse = new JeproshopWarehouseModelWarehouse((int) $product->warehouse_id); $product->warehouse_name = $warehouse->name; } else { $product->warehouse_name = '--'; } } //$gender = new Gender((int)$customer->id_gender, $this->context->language->id); $history = $order->getHistory($this->context->language->lang_id); foreach ($history as &$order_state) { $order_state->text_color = JeproshopTools::getBrightness($order_state->color) < 128 ? 'white' : 'black'; } $this->setLayout('view'); $this->assignRef('order', $order); $cart = new JeproshopCartModelCart($order->cart_id); $this->assignRef('cart', $cart); $this->assignRef('customer', $customer); $customer_addresses = $customer->getAddresses($this->context->language->lang_id); $this->assignRef('customer_addresses', $customer_addresses); $this->assignRef('delivery_address', $addressDelivery); $this->assignRef('deliveryState', isset($deliveryState) ? $deliveryState : null); $this->assignRef('invoice_address', $addressInvoice); $this->assignRef('invoiceState', isset($invoiceState) ? $invoiceState : null); $customerStats = $customer->getStats(); $this->assignRef('customerStats', $customerStats); $this->assignRef('products', $products); $discounts = $order->getCartRules(); $this->assignRef('discounts', $discounts); $orderTotalPaid = $order->getOrdersTotalPaid(); $this->assignRef('orders_total_paid_tax_incl', $orderTotalPaid); // Get the sum of total_paid_tax_incl of the order with similar reference $totalPaid = $order->getTotalPaid(); $this->assignRef('total_paid', $totalPaid); $returns = JeproshopOrderReturnModelOrderReturn::getOrdersReturn($order->customer_id, $order->order_id); $this->assignRef('returns', $returns); $customerThreads = JeproshopCustomerThreadModelCustomerThread::getCustomerMessages($order->customer_id); $this->assignRef('customer_thread_message', $customerThreads); $orderMessages = JeproshopOrderMessageModelOrderMessage::getOrderMessages($order->lang_id); $this->assignRef('order_messages', $orderMessages); $messages = JeproshopMessageModelMessage::getMessagesByOrderId($order->order_id, true); $this->assignRef('messages', $messages); $carrier = new JeproshopCarrierModelCarrier($order->carrier_id); $this->assignRef('carrier', $carrier); $this->assignRef('history', $history); $statues = JeproshopOrderStatusModelOrderStatus::getOrderStatus($this->context->language->lang_id); $this->assignRef('order_statues', $statues); $this->assignRef('warehouse_list', $warehouse_list); $sources = JeproshopConnectionSourceModelConnectionSource::getOrderSources($order->order_id); $this->assignRef('sources', $sources); $orderStatus = $order->getCurrentOrderStatus(); $this->assignRef('current_status', $orderStatus); $this->assignRef('currency', new JeproshopCurrencyModelCurrency($order->currency_id)); $currencies = JeproshopCurrencyModelCurrency::getCurrenciesByShopId($order->shop_id); $this->assignRef('currencies', $currencies); $previousOrder = $order->getPreviousOrderId(); $this->assignRef('previousOrder', $previousOrder); $nextOrder = $order->getNextOrderId(); $this->assignRef('nextOrder', $nextOrder); //$this->assignRef('current_index', self::$currentIndex); $this->assignRef('carrier_module_call', $carrier_module_call); $this->assignRef('iso_code_lang', $this->context->language->iso_code); $this->assignRef('lang_id', $this->context->language->lang_id); $can_edit = true; $this->assignRef('can_edit', $can_edit); //($this->tabAccess['edit'] == 1)); $this->assignRef('current_id_lang', $this->context->language->lang_id); $invoiceCollection = $order->getInvoicesCollection(); $this->assignRef('invoices_collection', $invoiceCollection); $unPaid = $order->getNotPaidInvoicesCollection(); $this->assignRef('not_paid_invoices_collection', $unPaid); $this->assignRef('payment_methods', $payment_methods); $invoiceAllowed = JeproshopSettingModelSetting::getValue('invoice_allowed'); $this->assignRef('invoice_management_active', $invoiceAllowed); $display_warehouse = (int) JeproshopSettingModelSetting::getValue('advanced_stock_management'); $this->assignRef('display_warehouse', $display_warehouse); $stockManagement = JeproshopSettingModelSetting::getValue('stock_management'); $this->assignRef('stock_management', $stockManagement); /*$this->assignRef('HOOK_CONTENT_ORDER', Hook::exec('displayAdminOrderContentOrder', array( 'order' => $order, 'products' => $products, 'customer' => $customer) ), $this->assignRef('HOOK_CONTENT_SHIP' => Hook::exec('displayAdminOrderContentShip', array( 'order' => $order, 'products' => $products, 'customer' => $customer) ), $this->assignRef('HOOK_TAB_ORDER' => Hook::exec('displayAdminOrderTabOrder', array( 'order' => $order, 'products' => $products, 'customer' => $customer) $this->assignRef('HOOK_TAB_SHIP' => Hook::exec('displayAdminOrderTabShip', array( $this->assignRef('order' => $order, $this->assignRef('products' => $products, $this->assignRef('customer' => $customer) */ $this->addToolBar(); $this->sideBar = JHtmlSideBar::render(); parent::display($tpl); }
<span> <?php if ($document->getRestPaid() > 0) { echo '(' . JeproshopTools::displayPrice($document->getRestPaid(), $this->currency->currency_id) . ' ' . JText::_('COM_JEPROSHOP_NOT_PAID_LABEL') . ')'; } else { if ($document->getRestPaid() < 0) { echo '(' . JeproshopTools::displayPrice(-$document->getRestPaid(), $currency->currecy_id) . ' ' . JText::_('COM_JEPROSHOP_OVER_PAID_LABEL') . ')'; } } ?> </span> <?php } } } elseif (get_class($document) == 'JeproshopOrderSlipModelOrderSlip') { echo JeproshopTools::displayPrice($document->amount, $this->currency->currencyid); } ?> </td> <td class="text-right document_action"> <?php if (get_class($document) == 'JeproshopOrderInvoiceModelOrderInvoice') { if (!isset($document->is_delivery)) { if ($document->getRestPaid()) { ?> <a href="#formAddPaymentPanel" class="js-set-payment btn btn-default anchor" data-amount="<?php echo $document->getRestPaid(); ?> " data-invoice-id="<?php
private function displaySpecificPriceModificationForm($default_currency, $shops, $currencies, $countries, $groups) { $content = ''; if (!$this->product) { return null; } $specificPrices = JeproshopSpecificPriceModelSpecificPrice::getSpecificPricesByProductId((int) $this->product->product_id); $specificPricePriorities = JeproshopSpecificPriceModelSpecificPrice::getPriority((int) $this->product->product_id); $app = JFactory::getApplication(); $taxRate = $this->product->getTaxesRate(JeproshopAddressModelAddress::initialize()); $tmp = array(); foreach ($shops as $shop) { $tmp[$shop->shop_id] = $shop; } $shops = $tmp; $tmp = array(); foreach ($currencies as $currency) { $tmp[$currency->currency_id] = $currency; } $currencies = $tmp; $tmp = array(); foreach ($countries as $country) { $tmp[$country->country_id] = $country; } $countries = $tmp; $tmp = array(); foreach ($groups as $group) { $tmp[$group->group_id] = $group; } $groups = $tmp; $content .= '<table class="table table-striped" ><thead><tr><th>' . JText::_('COM_JEPROSHOP_RULES_LABEL'); $content .= '</th><th>' . JText::_('COM_JEPROSHOP_COMBINATION_LABEL') . '</th>'; $multi_shop = JeproshopShopModelShop::isFeaturePublished(); if ($multi_shop) { $content .= '<th>' . JText::_('COM_JEPROSHOP_SHOP_LABEL') . '</th>'; } $content .= '<th>' . JText::_('COM_JEPROSHOP_CURRENCY_LABEL') . '</th><th>'; $content .= JText::_('COM_JEPROSHOP_COUNTRY_LABEL') . '</th><th>' . JText::_('COM_JEPROSHOP_GROUP_LABEL'); $content .= '</th><th>' . JText::_('COM_JEPROSHOP_CUSTOMER_LABEL') . '</th><th>'; $content .= JText::_('COM_JEPROSHOP_FIXED_PRICE_LABEL') . '</th><th>' . JText::_('COM_JEPROSHOP_IMPACT_LABEL'); $content .= '</th><th>' . JText::_('COM_JEPROSHOP_PERIOD_LABEL') . '</th><th>' . JText::_('COM_JEPROSHOP_FROM_LABEL'); $content .= '</th><th>' . JText::_('COM_JEPROSHOP_ACTIONS_LABEL') . '</th></tr></thead><tbody>'; if (!is_array($specificPrices) || !count($specificPrices)) { $content .= '<tr><td class="text-center" colspan="13" ><i class="icon-warning-sign"></i> '; $content .= JText::_('COM_JEPROSHOP_NO_SPECIFIC_PRICES_MESSAGE') . '</td></tr>'; } else { $i = 0; foreach ($specificPrices as $specificPrice) { $currentSpecificCurrency = $currencies[$specificPrice->currency_id ? $specificPrice->currency_id : $default_currency->currency_id]; if ($specificPrice->reduction_type == 'percentage') { $impact = '- ' . $specificPrice->reduction * 100 . ' %'; } elseif ($specificPrice->reduction > 0) { $impact = '- ' . JeproshopTools::displayPrice(Tools::ps_round($specificPrice->reduction, 2), $currentSpecificCurrency); } else { $impact = '--'; } if ($specificPrice->from == '0000-00-00 00:00:00' && $specificPrice->to == '0000-00-00 00:00:00') { $period = JText::_('COM_JEPROSHOP_UNLIMITED_LABEL'); } else { $period = JText::_('COM_JEPROSHOP_FROM_LABEL') . ' ' . ($specificPrice->from != '0000-00-00 00:00:00' ? $specificPrice['from'] : '0000-00-00 00:00:00') . '<br />' . $this->l('To') . ' ' . ($specificPrice['to'] != '0000-00-00 00:00:00' ? $specificPrice['to'] : '0000-00-00 00:00:00'); } if ($specificPrice->product_attribute_id) { $combination = new JeproshopCombinationModelCombination((int) $specificPrice->product_attribute_id); $attributes = $combination->getAttributesName((int) $this->context->language->lang_id); $attributes_name = ''; foreach ($attributes as $attribute) { $attributes_name .= $attribute->name . ' - '; } $attributes_name = rtrim($attributes_name, ' - '); } else { $attributes_name = JText::_('COM_JEPROSHOP_ALL_COMBINATIONS_LABEL'); } $rule = new JeproshopSpecificPriceRuleModelSpecificPriceRule((int) $specificPrice->specific_price_rule_id); $rule_name = $rule->specific_price_rule_id ? $rule->name : '--'; if ($specificPrice->customer_id) { $customer = new JeproshopCustomerModelCustomer((int) $specificPrice->customer_id); if (JeproshopTools::isLoadedObject($customer, 'customer_id')) { $customer_full_name = $customer->firstname . ' ' . $customer->lastname; } unset($customer); } if (!$specificPrice->shop_id || in_array($specificPrice->shop_id, JeoroshopShopModelShop::getContextListShopID())) { $content .= '<tr class="row_' . ($i % 2 ? '0' : '1') . '"><td>' . $rule_name . '</td><td>' . $attributes_name . '</td>'; $can_delete_specific_prices = true; if (JeproshopShopModelShop::isFeaturePublished()) { $sp_shop_id = $specificPrice->shop_id; $can_delete_specific_prices = count($this->context->employee->getAssociatedShops()) > 1 && !$sp_shop_id || $sp_shop_id; $content .= '<td>' . ($sp_shop_id ? $shops[$sp_shop_id]['name'] : JText::_('COM_JEPROSHOP_ALL_SHOPS_LABEL')) . '</td>'; } $price = JeproshopTools::roundPrice($specificPrice->price, 2); $fixed_price = $price == JeproshopTools::roundPrice($this->product->price, 2) || $specificPrice->price == -1 ? '--' : JeproshopTools::displayPrice($price, $current_specific_currency); $content .= '<td>' . ($specificPrice->currency_id ? $currencies[$specificPrice->currency_id]->name : JText::_('COM_JEPROSHOP_ALL_CURRENCIES_LABEL')) . '</td>'; $content .= '<td>' . ($specificPrice->country_id ? $countries[$specificPrice->country_id]->name : JText::_('COM_JEPROSHOP_ALL_COUNTRIES_LABEL')) . '</td>'; $content .= '<td>' . ($specificPrice->group_id ? $groups[$specificPrice->group_id]->name : JText::_('COM_JEPROSHOP_ALL_GROUPS_LABEL')) . '</td>'; $content .= '<td title="' . JText::_('COM_JEPROSHOP_ID_LABEL') . ' ' . $specificPrice->customer_id . '">' . (isset($customer_full_name) ? $customer_full_name : JText::_('COM_JEPROSHOP_ALL_CUSTOMERS_LABEL')) . '</td>'; $content .= '<td>' . $fixed_price . '</td><td>' . $impact . '</td><td>' . $period . '</td><td>' . $specificPrice->from_quantity . '</th>'; $content .= '<td>' . (!$rule->specific_price_rule_id && $can_delete_specific_prices ? '<a class="btn btn-default" name="delete_link" href="' . JRoute::_('index.php?option=com_jeproshop&view=price&product_id=' . (int) $app->input->get('product_id') . '&task=delete_specific_price&specific_price_id=' . (int) $specificPrice->specific_price_id . '&' . JSession::getFormToken() . '=1') . '"><i class="icon-trash"></i></a>' : '') . '</td>'; $content .= '</tr>'; $i++; unset($customer_full_name); } } } $content .= '</tbody></table>'; // Not use id_customer if ($specificPricePriorities[0] == 'customer_id') { unset($specificPricePriorities[0]); } // Reindex array starting from 0 $specificPricePriorities = array_values($specificPricePriorities); $content .= '<div class="panel"><div class="panel-title" >' . JText::_('Priority management') . '</div><div class="panel-content well" ><div class="alert alert-info">'; $content .= JText::_('Sometimes one customer can fit into multiple price rules. Priorities allow you to define which rule applies to the customer.') . '</div>'; $content .= '<div class="input-group" ><select id="jform_specific_price_priority_1" name="price_field[specific_price_priority[]]" class="middle_size" ><option value="shop_id"'; $content .= ($specificPricePriorities[0] == 'shop_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_SHOP_LABEL') . '</option><option value="currency_id"'; $content .= ($specificPricePriorities[0] == 'currency_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_CURRENCY_LABEL') . '</option><option value="country_id"'; $content .= ($specificPricePriorities[0] == 'country_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_COUNTRY_LABEL') . '</option><option value="group_id"'; $content .= ($specificPricePriorities[0] == 'group_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_GROUP_LABEL') . '</option></select> <span class="'; $content .= 'input-group-addon"><i class="icon-chevron-right"></i></span> <select name="price_field[specific_price_priority[]]" class="middle_size" ><option value="shop_id"'; $content .= ($specificPricePriorities[1] == 'shop_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_SHOP_LABEL') . '</option><option value="currency_id"'; $content .= ($specificPricePriorities[1] == 'currency_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_CURRENCY_LABEL') . '</option><option value="country_id"'; $content .= ($specificPricePriorities[1] == 'country_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_COUNTRY_LABEL') . '</option><option value="group_id"'; $content .= ($specificPricePriorities[1] == 'group_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_GROUP_LABEL') . '</option></select> <span class="'; $content .= 'input-group-addon"><i class="icon-chevron-right"></i></span> <select name="price_field[specific_price_priority[]]" class="middle_size" ><option value="shop_id"'; $content .= ($specificPricePriorities[2] == 'shop_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_SHOP_LABEL') . '</option><option value="currency_id"'; $content .= ($specificPricePriorities[2] == 'currency_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_CURRENCY_LABEL') . '</option><option value="country_id"'; $content .= ($specificPricePriorities[2] == 'country_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_COUNTRY_LABEL') . '</option><option value="group_id"'; $content .= ($specificPricePriorities[2] == 'group_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_GROUP_LABEL') . '</option></select><span class="'; $content .= 'input-group-addon"><i class="icon-chevron-right"></i></span> <select name="price_field[specific_price_priority[]]" class="middle_size" ><option value="shop_id"'; $content .= ($specificPricePriorities[3] == 'shop_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_SHOP_LABEL') . '</option><option value="currency_id"'; $content .= ($specificPricePriorities[3] == 'currency_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_CURRENCY_LABEL') . '</option><option value="country_id"'; $content .= ($specificPricePriorities[3] == 'country_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_COUNTRY_LABEL') . '</option><option value="group_id"'; $content .= ($specificPricePriorities[3] == 'group_id' ? ' selected="selected"' : '') . '>' . JText::_('COM_JEPROSHOP_GROUP_LABEL') . '</option></select></div></div></div>'; $content .= '<p class="checkbox"><label for="jform_specific_price_priority_to_all"><input type="checkbox" name="price_field[specific_price_priority_to_all]" id="jform_specific_'; $content .= 'price_priority_to_all" />' . JText::_('Apply to all products') . '</label></p>'; /*<div class="form-group"> <label class="control-label col-lg-3" for="specificPricePriority1">'.$this->l('Priorities').'</label> col-lg-9"> </div> </div> <div class="form-group"> <div class="col-lg-9 col-lg-offset-3"> </div> </div> <div class="panel-footer"> <a href="'.$this->context->link->getAdminLink('AdminProducts').'" class="btn btn-default"><i class="process-icon-cancel"></i> '.$this->l('Cancel').'</a> <button id="product_form_submit_btn" type="submit" name="submitAddproduct" class="btn btn-default pull-right"><i class="process-icon-save"></i> '.$this->l('Save') .'</button> <button id="product_form_submit_btn" type="submit" name="submitAddproductAndStay" class="btn btn-default pull-right"><i class="process-icon-save"></i> '.$this->l('Save and stay') .'</button> </div> </div> '; */ $content .= '<script type="text/javascript">var currencies = new Array(); currencies[0] = new Array(); '; $content .= 'currencies[0]["sign"] = "' . $default_currency->sign . '"; currencies[0]["format"] = ' . $default_currency->format . '; '; foreach ($currencies as $currency) { $content .= ' currencies[' . $currency->currency_id . '] = new Array(); currencies[' . $currency->currency_id . ']["sign"] = "' . $currency->sign . '"; currencies[' . $currency->currency_id . ']["format"] = ' . $currency->format . ';'; } $content .= '</script>'; return $content; }
?> </td> <td class="nowrap" ><?php echo $order->payment; ?> </td> <td ><?php echo $order->order_state; ?> </td> <td class="nowrap center" ><?php echo $order->nb_products; ?> </td> <td class="nowrap center" ><?php echo JeproshopTools::displayPrice($order->total_paid_real, $this->context->currency->currency_id); ?> </td> </tr> <?php } ?> </tbody> </table> <?php } } else { ?> <p class="text-muted text-center"> <?php echo ucfirst($this->customer->firstname) . ' ' . strtoupper($this->customer->lastname) . ' ' . JText::_('COM_JEPROSHOP_HAS_NOT_PLACED_ANY_ORDERS_YET_MESSAGE');
</td> <?php if ($this->use_taxes) { ?> <td colspan="2" class="price" id="total_price_container"> <span id="total_price"><?php echo JeproshopTools::displayPrice($total_price); ?> </span> </td> <?php } else { ?> <td colspan="2" class="price" id="total_price_container"> <span id="total_price"><?php echo JeproshopTools::displayPrice($total_price_without_tax); ?> </span> </td> <?php } ?> </tr> </tfoot> </table> </div> <?php if ($this->show_option_allow_separate_package) { ?> <p> <input type="checkbox" name="allow_separated_package" id="allow_separated_package" <?php
echo $order->new ? '<i class="icon-publish" ></i>' : '<i class="icon-unpublish" ></i>'; ?> </td> <td width="4%" class="nowrap hidden-phone"><?php echo $order->country_name; ?> </td> <td width="5%" class="nowrap hidden-phone"><a href="<?php echo $customer_link; ?> " ><?php echo $order->customer_name; ?> </a></td> <td width="2%" class="nowrap center hidden-phone"><?php echo JeproshopTools::displayPrice($order->total_paid_tax_incl); ?> </td> <td width="5%" class="nowrap center hidden-phone"><?php echo $order->payment; ?> </td> <td width="1%" class="nowrap hidden-phone"><?php echo $order->order_status_name; ?> </td> <td width="1%" class="nowrap center hidden-phone"><?php echo JeproshopTools::displayDate($order->date_add); ?> </td> <td width="1%" class="nowrap center hidden-phone" >
echo JeproshopTools::convertPrice($product->price_tax_exc); } ?> </span> <meta itemprop="priceCurrency" content="<?php echo $this->currency->iso_code; ?> " /> <?php if (isset($product->specific_prices) && $product->specific_prices && isset($product->specific_prices->reduction) && $product->specific_prices->reduction > 0) { ?> <?php /* {hook h="displayProductPriceBlock" product=$product type="old_price"} */ ?> <span class="old-price product-price"><?php echo JeproshopTools::displayPrice($product->price_without_reduction, $this->context->currency); ?> </span> <?php //{hook h="displayProductPriceBlock" id_product=$product->id_product type="old_price"} ?> <?php if ($product->specific_prices->reduction_type == 'percentage') { ?> <span class="price-percent-reduction">-<?php echo $product->specific_prices->reduction * 100 . '%'; ?> <?php } ?> <?php