Attributes Error

Open to all! Ask other shopowners for help.
Post Reply
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Attributes Error

Post by tessthepup »

Hi Guys,

I have never really needed to use the attributes system before but now find I need to.

I am using version CE Phoenix v1.0.8.20 and the when trying to use attributes I get this error in the error log.
[10-Sep-2024 13:38:10 Europe/London] PHP Warning: DB: [1054] Unknown column 'pa.sort_order' in 'order clause' from <SELECT po.products_options_name, pov.products_options_values_name,
pa.options_id, pa.options_values_id, pa.price_prefix, pa.options_values_price,
pad.products_attributes_filename, pad.products_attributes_maxdays, pad.products_attributes_maxcount
FROM products_options po
INNER JOIN products_attributes pa ON po.products_options_id = pa.options_id
LEFT JOIN products_options_values pov ON pa.options_values_id = pov.products_options_values_id AND po.language_id = pov.language_id
LEFT JOIN products_attributes_download pad ON pa.products_attributes_id = pad.products_attributes_id
WHERE po.language_id = 1 AND pa.products_id = 10602
ORDER BY pa.sort_order, po.sort_order, po.products_options_name, pov.sort_order, pov.products_options_values_name> in /home/****/public_html/includes/system/versioned/1.0.8.1/database_core.php on line 44
Just wondering if anyone else has come across this?

Thanks

Mark


Join The Code Co-op to get access to your library in the Code Co-op Forum
Dan Cole
Senior Contributor
Posts: 499
Joined: Fri Oct 25, 2019 2:14 pm
Phoenix Version: 1.0.8.21
Has thanked: 67 times
Been thanked: 61 times

Re: Attributes Error

Post by Dan Cole »

Looks like you're missing a column (pa.sort_order) in your (products_attributes) table based on the error message. Maybe you missed an SQL update or something. BTW, I don't see a products_attributes table in my database but I have one called products_options. Are you using an add on of some sort?

Dan
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: Attributes Error

Post by tessthepup »

Dan Cole wrote: Tue Sep 10, 2024 1:03 pm Looks like you're missing a column (pa.sort_order) in your (products_attributes) table based on the error message. Maybe you missed an SQL update or something. BTW, I don't see a products_attributes table in my database but I have one called products_options. Are you using an add on of some sort?

Dan
Hi Dan, thanks for the reply. I did install Rainers 'AJAX Attribute Manager' addon but could not get it to work.

Maybe I have missed something in the removal of it.

I have however added the sort_order field to the products_attributes table and it seems to have cured the error.
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Attributes Error

Post by burt »

Sort Order on options was introduced in 1.0.7.10 I believe, about 5 years ago.
I'm surprised that 1.0.8.20 complains about it missing...

products_options.sort_order int(3)
&
products_options_values.sort_order int(3)

products_attributes table does not have sort_order;

Code: Select all

CREATE TABLE products_attributes (
  products_attributes_id int NOT NULL auto_increment,
  products_id int NOT NULL,
  options_id int NOT NULL,
  options_values_id int NOT NULL,
  options_values_price decimal(15,4) NOT NULL,
  price_prefix char(1) NOT NULL,
  PRIMARY KEY (products_attributes_id),
  KEY idx_products_attributes_products_id (products_id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
I am not here to build for you.
I am here to build with you. Let's help each other.
User avatar
tessthepup
Certified Developer
Posts: 383
Joined: Mon Mar 01, 2021 5:55 pm
Phoenix Version:
Has thanked: 47 times
Been thanked: 62 times

Re: Attributes Error

Post by tessthepup »

burt wrote: Tue Sep 10, 2024 1:59 pm Sort Order on options was introduced in 1.0.7.10 I believe, about 5 years ago.
I'm surprised that 1.0.8.20 complains about it missing...

products_options.sort_order int(3)
&
products_options_values.sort_order int(3)

products_attributes table does not have sort_order;

Code: Select all

CREATE TABLE products_attributes (
  products_attributes_id int NOT NULL auto_increment,
  products_id int NOT NULL,
  options_id int NOT NULL,
  options_values_id int NOT NULL,
  options_values_price decimal(15,4) NOT NULL,
  price_prefix char(1) NOT NULL,
  PRIMARY KEY (products_attributes_id),
  KEY idx_products_attributes_products_id (products_id)
) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
Thanks Gary, I am more suprised I have not needed any attributes lol


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply