View Single Post
  #2  
Old 07-20-2017, 05:46 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Argument 1 passed to must be an instance of ...\..\, string given

As the error states you are passing string while the function expects an object

PHP Code:
$preorder_details = \XLite\Core\Database::getRepo('XLite\Module\Webkulsoftware\PreorderSales\Model\Preorders')->getPreOrder('',$product_id); 


This should works

PHP Code:
$cnd = new \XLite\Core\CommonCell;

$preorder_details = \XLite\Core\Database::getRepo('XLite\Module\Webkulsoftware\PreorderSales\Model\Preorders')->getPreOrder($cnd,$product_id); 
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote