Skip to content

Commit

Permalink
Fix widgets
Browse files Browse the repository at this point in the history
  • Loading branch information
samerton committed Aug 25, 2023
1 parent 34c1783 commit 8cc2ed3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 21 deletions.
29 changes: 19 additions & 10 deletions upload/modules/Tebex/widgets/FeaturedPackageWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,25 @@ class FeaturedPackageWidget extends WidgetBase {
private Language $_language, $_buycraft_language;

public function __construct(Cache $cache, Smarty $smarty, Language $language, Language $buycraft_language){
$this->_smarty = $smarty;
$this->_language = $language;
$this->_buycraft_language = $buycraft_language;
$this->_cache = $cache;

// Set widget variables
$this->_module = 'Tebex';
$this->_name = 'Featured Package';
$this->_description = 'Display a store package to feature across your website';
$this->_settings = ROOT_PATH . '/modules/Tebex/widgets/admin/featured_package.php';
$widget_query = self::getData('Featured Package');

parent::__construct(self::parsePages($widget_query));

$this->_smarty = $smarty;
$this->_language = $language;
$this->_buycraft_language = $buycraft_language;
$this->_cache = $cache;

// Get order
$order = DB::getInstance()->query('SELECT `order` FROM nl2_widgets WHERE `name` = ?', array('Featured Package'))->first();

// Set widget variables
$this->_module = 'Tebex';
$this->_name = 'Featured Package';
$this->_location = 'right';
$this->_description = 'Display a store package to feature across your website';
$this->_settings = ROOT_PATH . '/modules/Tebex/widgets/admin/featured_package.php';
$this->_order = $order->order;
}

public function initialise(): void {
Expand Down
31 changes: 20 additions & 11 deletions upload/modules/Tebex/widgets/LatestPurchasesWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,26 @@ class LatestPurchasesWidget extends WidgetBase {
private Cache $_cache;
private Language $_language, $_buycraft_language;

public function __construct(Cache $cache, Smarty $smarty, Language $language, Language $buycraft_language){
$this->_smarty = $smarty;
$this->_language = $language;
$this->_buycraft_language = $buycraft_language;
$this->_cache = $cache;

// Set widget variables
$this->_module = 'Tebex';
$this->_name = 'Latest Purchases';
$this->_description = 'Displays a list of your store\'s most recent purchases.';
$this->_settings = ROOT_PATH . '/modules/Tebex/widgets/admin/latest_purchases.php';
public function __construct(Cache $cache, Smarty $smarty, Language $language, Language $buycraft_language) {
$widget_query = self::getData('Latest Purchases');

parent::__construct(self::parsePages($widget_query));

$this->_smarty = $smarty;
$this->_language = $language;
$this->_buycraft_language = $buycraft_language;
$this->_cache = $cache;

// Get order
$order = DB::getInstance()->query('SELECT `order` FROM nl2_widgets WHERE `name` = ?', array('Latest Purchases'))->first();

// Set widget variables
$this->_module = 'Tebex';
$this->_name = 'Latest Purchases';
$this->_location = 'right';
$this->_description = 'Displays a list of your store\'s most recent purchases.';
$this->_settings = ROOT_PATH . '/modules/Tebex/widgets/admin/latest_purchases.php';
$this->_order = $order->order;
}

public function initialise(): void {
Expand Down

0 comments on commit 8cc2ed3

Please sign in to comment.