public function initToolbar() { parent::initToolbar(); if (!Module::isInstalled('agilemultipleseller')) { return; } if ($this->is_seller) { unset($this->toolbar_btn['new']); } }
/** * Override for Prestashop 16 */ private function initToolbar16() { if ($this->display == 'view') { /** @var Order $order */ $order = $this->loadObject(); $customer = $this->context->customer; if (!Validate::isLoadedObject($order)) { Tools::redirectAdmin($this->context->link->getAdminLink('AdminOrders')); } $this->toolbar_title[] = sprintf($this->l('Order %1$s from %2$s %3$s'), $order->reference, $customer->firstname, $customer->lastname); $this->addMetaTitle($this->toolbar_title[count($this->toolbar_title) - 1]); if ($order->hasBeenShipped()) { $type = $this->l('Return products'); } elseif ($order->hasBeenPaid()) { $type = $this->l('Standard refund'); } else { $type = $this->l('Cancel products'); } if (!$order->hasBeenShipped() && !$this->lite_display) { $this->toolbar_btn['new'] = array('short' => 'Create', 'href' => '#', 'desc' => $this->l('Add a product'), 'class' => 'add_product'); } if (Configuration::get('PS_ORDER_RETURN') && !$this->lite_display) { $this->toolbar_btn['standard_refund'] = array('short' => 'Create', 'href' => '', 'desc' => $type, 'class' => 'process-icon-standardRefund'); } if ($order->hasInvoice() && !$this->lite_display) { $this->toolbar_btn['partial_refund'] = array('short' => 'Create', 'href' => '', 'desc' => $this->l('Partial refund'), 'class' => 'process-icon-partialRefund'); } } if (class_exists('DynamicParcelDistribution')) { if (DynamicParcelDistribution::isEnabled('dynamicparceldistribution') && Configuration::get(DynamicParcelDistribution::CONST_PREFIX . 'ALLOW_COURIER_PICKUP')) { $this->toolbar_btn['call_carrier'] = array('short' => 'Create', 'href' => '#', 'desc' => $this->l('Call DPD Carrier'), 'class' => 'process-icon-callCarrier', 'js' => 'showCarrierWindow()'); } } $res = parent::initToolbar(); if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && isset($this->toolbar_btn['new']) && Shop::isFeatureActive()) { unset($this->toolbar_btn['new']); } return $res; }