View Single Post
Old 05-07-2021, 05:13 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline

Join Date: Apr 2007
Posts: 14,052

Default Re: How to link out-of-stock or low-stock items to admin end?

You can decorate classes/XLite/View/Product/MailBox.php class and modify

protected function getDefaultProductURLProcessor() { return function (Product $product) { return $this->buildFullURL('product', '', ['product_id' => $product->getId()]); }; }


protected function getProductURL() { $closure = $this->getProductURLProcessor(); return $closure($this->getProduct()); }

to return admin side url for the product. The way this is now it will almost always return the storefront url because the warning is usually called from the storefront due to product getting low stock after order placement.

You can decorate the getProductURL like this

/** * @return string */ protected function getProductURL() { return \XLite\Core\Converter::buildFullURL($target, $action, $params, \XLite::getAdminScript(), fasle, false); }

This is untested
Steve Stoyanov
Web Development
Reply With Quote