Osclass Support Forums

General osclass questions => Plugins => Topic started by: DIY & Crafts on July 27, 2022, 10:35:42 PM

Title: Attributes Osclass Plugin SQL Cars
Post by: DIY & Crafts on July 27, 2022, 10:35:42 PM
Hello All i want help please
anyone have sql for
Attributes Osclass Plugin​
Car Make, model, years etc...

Not Car_Attributes 
 
Title: Re: Attributes Osclass Plugin SQL Cars
Post by: mwindey on July 28, 2022, 11:29:24 AM
This sql creates tables but you have to fill conditions yourself or do you want someone else to fill it for you?
Code: [Select]
CREATE TABLE /*TABLE_PREFIX*/t_item_car_vehicle_type_attr (
  pk_i_id INT(2) UNSIGNED NOT NULL,
  fk_c_locale_code CHAR(5) NOT NULL,
  s_name VARCHAR(255),

  PRIMARY KEY (pk_i_id, fk_c_locale_code),
  FOREIGN KEY (fk_c_locale_code) REFERENCES /*TABLE_PREFIX*/t_locale (pk_c_code) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_item_car_make_attr (
  pk_i_id INT(2) UNSIGNED NOT NULL AUTO_INCREMENT,
  s_name VARCHAR(255),

  PRIMARY KEY (pk_i_id)
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_item_car_model_attr (
  pk_i_id INT(2) UNSIGNED NOT NULL AUTO_INCREMENT,
  fk_i_make_id INT(2) UNSIGNED NOT NULL,
  s_name VARCHAR(255),

  PRIMARY KEY (pk_i_id),
  FOREIGN KEY (fk_i_make_id) REFERENCES /*TABLE_PREFIX*/t_item_car_make_attr (pk_i_id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';

CREATE TABLE /*TABLE_PREFIX*/t_item_car_attr (
  fk_i_item_id INT(10) UNSIGNED NOT NULL,
  i_year INT(4) UNSIGNED,
  i_doors INT(1) UNSIGNED,
  i_seats INT(4) UNSIGNED,
  i_mileage INT(10) UNSIGNED,
  i_engine_size INT(10) UNSIGNED,
  fk_i_make_id INT(2) UNSIGNED,
  fk_i_model_id INT(2) UNSIGNED,
  i_num_airbags INT(2) UNSIGNED,
  e_transmission ENUM('MANUAL', 'AUTO'),
  e_fuel ENUM('DIESEL', 'GASOLINE', 'ELECTRIC-HIBRID', 'OTHER'),
  e_seller ENUM('DEALER', 'OWNER'),
  b_warranty BOOLEAN,
  b_new BOOLEAN,
  i_power INT(10) UNSIGNED,
  e_power_unit ENUM('KW', 'CV', 'CH', 'KM', 'HP', 'PS', 'PK', 'CP'),
  i_gears INT(1) UNSIGNED,
  fk_vehicle_type_id INT(10) UNSIGNED,

  INDEX (fk_i_item_id),
  PRIMARY KEY (fk_i_item_id),
  FOREIGN KEY (fk_i_item_id) REFERENCES /*TABLE_PREFIX*/t_item (pk_i_id) ON DELETE CASCADE ON UPDATE CASCADE,
  FOREIGN KEY (fk_i_make_id) REFERENCES /*TABLE_PREFIX*/t_item_car_make_attr (pk_i_id) ON DELETE CASCADE ON UPDATE CASCADE,
  FOREIGN KEY (fk_i_model_id) REFERENCES /*TABLE_PREFIX*/t_item_car_model_attr (pk_i_id) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARACTER SET 'UTF8' COLLATE 'UTF8_GENERAL_CI';
Title: Re: Attributes Osclass Plugin SQL Cars
Post by: MB Themes on August 01, 2022, 12:17:12 PM
I would say I saw such file somewhere here in forums...
Title: Re: Attributes Osclass Plugin SQL Cars
Post by: Tillo Tashmukhamedov on June 01, 2023, 01:22:53 PM
Good afternoon!I'm sorry if the question is not quite for you. And this is not a question of error. But it concerns the car_attributes plugin. Please tell me if it's not difficult. If I want to add a couple more criteria to the filter to search for ads. I create corresponding windows and functions for this. How to make the search carried out taking into account the data of these windows? In which function do I need to add the criteria I have added? Thank you in advance for your help.
Title: Re: Attributes Osclass Plugin SQL Cars
Post by: MB Themes on June 01, 2023, 03:17:32 PM
you must add those fields to form first and then manage them when form is submitted to add proper filters in database layer.
Title: Re: Attributes Osclass Plugin SQL Cars
Post by: Tillo Tashmukhamedov on June 02, 2023, 07:09:56 PM
Thank you for your promptness. I created the forms themselves. I also wrote functions for them. I just can't figure out which function processes the forms and sends the data to the database?
Title: Re: Attributes Osclass Plugin SQL Cars
Post by: MB Themes on June 05, 2023, 10:26:49 AM
These functions are hooked via "posted_item" or "edited_item" hooks.