NamelessMC

Internet Explorer

Internet Explorer is not supported. Please upgrade to a more modern browser.

Tebex Store Error
Started by LazyChazy

LazyChazy

LazyChazy

Member
Joined
11 May 2021
Last Seen
22 May 2023
Topics
2
Posts
3

Uncaught TypeError

count(): Argument #1 ($value) must be of type Countable|array, string given

(File: /home/boxsmpxy/domains/ravenhide.xyz/public_html/modules/Tebex/pages/store/category.php)

<?php
/*
 *	Made by Samerton
 *  https://github.com/NamelessMC/Nameless/
 *  NamelessMC version 2.0.0-pr6
 *
 *  License: MIT
 *
 *  Store page - category view
 */

// Always define page name
define('PAGE', 'buycraft');

// Get category ID
$category_id = explode('/', $route);
$category_id = $category_id[count($category_id) - 1];

if(!isset($category_id[count($category_id) - 1])){
	require_once(ROOT_PATH . '/404.php');
	die();
}

$category_id = explode('-', $category_id);
if(!is_numeric($category_id[0])){
	require_once(ROOT_PATH . '/404.php');
	die();
}
$category_id = $category_id[0];

// Query category
$category = DB::getInstance()->query('SELECT categories.id AS id, categories.name AS name, categories.parent_category AS parent_category, descriptions.description AS description, descriptions.image AS image FROM nl2_buycraft_categories AS categories LEFT JOIN nl2_buycraft_categories_descriptions AS descriptions ON descriptions.category_id = categories.id WHERE categories.id = ?', array($category_id));

if(!$category->count()){
	require_once(ROOT_PATH . '/404.php');
	die();
}

$category = $category->first();
LazyChazy · over 2 years ago
Horatiu

Horatiu

Member
Joined
01 May 2020
Last Seen
09 Nov 2024
Topics
5
Posts
25

Hi @LazyChazy!

If you use a custom panel template, probably this is not compatible with Tebex addon. Try to use default NamelessMC panel template and see if you receive this error again.

Contact me on email [email protected] - Or join on my Discord!
© 2019-2024 SuperHori.Com - Resources developed with ? and passion in Romania!

Horatiu · over 2 years ago