Page 1 of 1

PC 5.1.3 no option to select Category

Posted: 24 Jun 2025, 12:05
by Nidzo
Phoca Cart was updated from 5.0 Beta to Stable versions. I did not notice changes because I did not have to add new products but today I noticed that I can select primary category. On another website PC version 5.1.1 works.
Phoca Cart 5.1.3
Joomla 5.3.1
Image

Re: PC 5.1.3 no option to select Category

Posted: 27 Jun 2025, 16:44
by Jan
Hi,

hard to say what can be wrong there, but I would say, this can be related to not updated information about category, e.g. between Beta versions, there was added new feature for categories, category type, see:
administrator/components/com_phocacart/update/sql/mysql/5.0.0.sql

e.g. this missing SQL could do the problem:
UPDATE `#__phocacart_categories` SET `category_type` = 1 WHERE `category_type` = 0;

which means when not updated properly, the category_type stays 0 and is not displayed. Try to set this SQL and let me know.

Jan

Re: PC 5.1.3 no option to select Category

Posted: 27 Jun 2025, 22:26
by Nidzo
I did that but no change. I noticed that when I try to create new category I can't select Category Type. Also category is visible in Preferred Category selection. :idea:
Image
Image
Image
Image

Re: PC 5.1.3 no option to select Category

Posted: 28 Jun 2025, 02:17
by Jan
What about these SQL queries:

Code: Select all

CREATE TABLE IF NOT EXISTS `#__phocacart_content_types` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    `context` varchar(255) NOT NULL,
    `published` tinyint(1) NOT NULL DEFAULT 0,
    `checked_out` int unsigned,
    `checked_out_time` datetime,
    `ordering` int(11) NOT NULL DEFAULT 0,
    `params` text,
    PRIMARY KEY (`id`),
    KEY `idx_context` (`context`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

INSERT INTO `#__phocacart_content_types` (`id`, `title`, `context`, `published`, `ordering`, `params`)
    VALUES (1, 'COM_PHOCACART_CONTENT_TYPE_CATEGORY_DEFAULT', 'category', 1, 1, '{}');
INSERT INTO `#__phocacart_content_types` (`id`, `title`, `context`, `published`, `ordering`, `params`)
    VALUES (2, 'COM_PHOCACART_CONTENT_TYPE_RELATED_DEFAULT', 'product_related', 1, 1, '{}');

ALTER TABLE `#__phocacart_categories` ADD COLUMN `category_type` int(11) NOT NULL AFTER `owner_id`;
ALTER TABLE `#__phocacart_product_related` ADD COLUMN `related_type` int(11) NOT NULL AFTER `id`;
Do you have such a table in your database and the items set there?

Jan

Re: PC 5.1.3 no option to select Category

Posted: 28 Jun 2025, 10:34
by Nidzo
Thanks Jan! First query was succesfull. Other two returnned duplicate entry. Now I can see categories :twisted:

Code: Select all

CREATE TABLE IF NOT EXISTS `ban_phocacart_content_types` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `title` varchar(255) NOT NULL,
    `context` varchar(255) NOT NULL,
    `published` tinyint(1) NOT NULL DEFAULT 0,
    `checked_out` int unsigned,
    `checked_out_time` datetime,
    `ordering` int(11) NOT NULL DEFAULT 0,
    `params` text,
    PRIMARY KEY (`id`),
    KEY `idx_context` (`context`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE=utf8mb4_unicode_ci;

Re: PC 5.1.3 no option to select Category

Posted: 02 Jul 2025, 15:29
by Jan
OK, great to hear it.