PC 5.1.3 no option to select Category

Phoca Cart - complex e-commerce extension
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 471
Joined: 07 Nov 2018, 14:55

PC 5.1.3 no option to select Category

Post 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

Tags:
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48996
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: PC 5.1.3 no option to select Category

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 471
Joined: 07 Nov 2018, 14:55

Re: PC 5.1.3 no option to select Category

Post 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
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48996
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: PC 5.1.3 no option to select Category

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Nidzo
Phoca Professional
Phoca Professional
Posts: 471
Joined: 07 Nov 2018, 14:55

Re: PC 5.1.3 no option to select Category

Post 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;
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48996
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: PC 5.1.3 no option to select Category

Post by Jan »

OK, great to hear it.
If you find Phoca extensions useful, please support the project
Post Reply