[Contribtion] Year/Make/Model for OSC v2.3.x
#81
Posted 25 June 2011 - 11:12 PM
#82
Posted 25 June 2011 - 11:21 PM
#83
Posted 26 June 2011 - 01:11 AM
Any help would be appreciated.
#84
Posted 03 July 2011 - 07:53 AM
Thanks in advance. maybe i am having a tough time because i don't get to work on the site until after 11pm because of dayjob, toddler, preggo wife on bed rest.
All this coding is tougher than i thought.
Kelly Comstock
#85
Posted 03 July 2011 - 07:56 AM
KELCOM, on 03 July 2011 - 07:53 AM, said:
Thanks in advance. maybe i am having a tough time because i don't get to work on the site until after 11pm because of dayjob, toddler, preggo wife on bed rest.
All this coding is tougher than i thought.
Kelly Comstock
Hi Kelly,
To run the sql you need to go into your database through your control panel. You then run the sql statements so they are loaded into the database.
Mark
How to install jQuery Nivo Slider in osCommerce 2.3.3
Join Us On Facebook & Twitter Infobox
#86
Posted 03 July 2011 - 10:52 PM
I think i am catching on. I created a 'products_ymm' table in my sql database, but i am a little unsure what to do after that. How many fields do i make? When i create the table it takes me to a page where it looks like i need to edit fields... (again i am unsure) There are 'lists' that it looks like i am supposed to edit. they say:
Field
Type
Length/ Values
Default
Collation
Attributes
Null
Index
AUTO_INCREMENT
Comments
Am i supposed to modify the 'lists' with the information in step one?
I imagine that the manual installation instructions are "easy" for someone who has been doing this for a while, I have only been doing this for a month or two so its a little like trying to teach myself chinese
#87
Posted 03 July 2011 - 10:53 PM
Kelly
#88 ONLINE
Posted 03 July 2011 - 11:39 PM
If you run the SQL as mark suggested, it will create and populate the tables as needed.
CREATE TABLE `products_ymm` (`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,`products_id` INT NOT NULL ,`products_car_make` VARCHAR( 100 ) NOT NULL ,`products_car_model` VARCHAR( 100 ) NOT NULL ,`products_car_year_bof` INT NOT NULL ,`products_car_year_eof` INT NOT NULL);
INSERT INTO configuration_group (configuration_group_title, configuration_group_description, sort_order, visible) SELECT 'Year Make Model', 'Year Make Model Filter Options', sort_order, '1' FROM configuration_group ORDER BY sort_order DESC LIMIT 1;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added, use_function) VALUES ('YMM data on Product Info page', 'YMM_DISPLAY_DATA_ON_PRODUCT_INFO_PAGE', 'Yes', 'Display YMM data on the Product Info page?', LAST_INSERT_ID(), '1', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('number of Input fields', 'YMM_NUMBER_OF_INPUT_FIELDS', '6', 'Enter the number of how many YMM input fields should be displayed on the Edit Product page.',LAST_INSERT_ID(), '2', NULL, now(), NULL),('Categories box', 'YMM_FILTER_CATEGORIES_BOX', 'Yes', 'Filter Categories box by year, make, model selected?', LAST_INSERT_ID(), '3', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('count products in category', 'YMM_FILTER_COUNT_PRODUCTS_IN_CATEGORY', 'Yes', 'Filter count products in category by year, make, model selected?', LAST_INSERT_ID(), '4', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('categories listing', 'YMM_FILTER_CATEGORIES_LISTING', 'Yes', 'Filter categories listing by year, make, model selected?', LAST_INSERT_ID(), '5', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('product listing module', 'YMM_FILTER_PRODUCT_LISTING', 'Yes', 'Filter product listing module by year, make, model selected?', LAST_INSERT_ID(), '6', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Product Info page', 'YMM_FILTER_PRODUCT_INFO', 'Yes', 'Filter Product Info page (product_info.php) by year, make, model selected?', LAST_INSERT_ID(), '7', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('What\'s New box', 'YMM_FILTER_WHATS_NEW_BOX', 'Yes', 'Filter What\'s New box by year, make, model selected?', LAST_INSERT_ID(), '8', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('New Products module', 'YMM_FILTER_NEW_PRODUCTS', 'Yes', 'Filter New Products module by year, make, model selected?', LAST_INSERT_ID(), '9', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('New Products page', 'YMM_FILTER_PRODUCTS_NEW', 'Yes', 'Filter New Products page (products_new.php) by year, make, model selected?', LAST_INSERT_ID(), '10', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Product Reviews page', 'YMM_FILTER_PRODUCT_REVIEWS', 'Yes', 'Filter Product Reviews page (product_reviews.php) by year, make, model selected?', LAST_INSERT_ID(), '11', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Reviews box', 'YMM_FILTER_REVIEWS_BOX', 'Yes', 'Filter Reviews box by year, make, model selected?', LAST_INSERT_ID(), '12', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Reviews page', 'YMM_FILTER_REVIEWS', 'Yes', 'Filter Reviews page (reviews.php) by year, make, model selected?', LAST_INSERT_ID(), '13', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Specials box', 'YMM_FILTER_SPECIALS_BOX', 'Yes', 'Filter Specials box by year, make, model selected?', LAST_INSERT_ID(), '14', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Specials page', 'YMM_FILTER_SPECIALS', 'Yes', 'Filter Specials page (specials.php) by year, make, model selected?', LAST_INSERT_ID(), '15', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Bestsellers box', 'YMM_FILTER_BEST_SELLERS_BOX', 'Yes', 'Filter Bestsellers box by year, make, model selected?', LAST_INSERT_ID(), '16', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Also Purchased Products module', 'YMM_FILTER_ALSO_PURCHASED_PRODUCTS', 'Yes', 'Filter Also Purchased Products module by year, make, model selected?', LAST_INSERT_ID(), '17', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Upcoming Products module', 'YMM_FILTER_UPCOMING_PRODUCTS', 'Yes', 'Filter Upcoming Products module by year, make, model selected?', LAST_INSERT_ID(), '18', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL),('Search Results page', 'YMM_FILTER_ADVANCED_SEARCH_RESULT', 'Yes', 'Filter Search Results page (advanced_search_result.php) by year, make, model selected?', LAST_INSERT_ID(), '19', 'tep_cfg_select_option(array(\'Yes\', \'No\'), ', now(), NULL);
Chris
#89
Posted 07 July 2011 - 05:08 AM
#90
Posted 13 July 2011 - 04:09 PM
Is there a simple way to be able to add an additional filter field?
I would LOVE to be able to add the engine type in addition to the Make/Model/Year.
Please let me know! Thank you in advance!
#91
Posted 13 July 2011 - 08:02 PM
First of all thanks for this contribution, it seems something that will fit perfectly, however not in an automotive shop. To do this I had to modify a little the script in naming. Some work done, uploaded, box installed. I see in shop admin the section for configuration and can tune that. On the shop It's visible as a box active.
From the configuration of the add-on I can guess that those attributes should be applied to products in the product edit page (configurable number of input fields there). The only issue is that my admin doesn't display any input fields for YMM attributes.
I don't have any idea where can be the error. Can you support in which file is responsible for displaying the YMM on product edit page?
The only incompatibility that I noticed in add-on txt manual is in section 9] index.php subsection 9.a]
The one to be replaced already contains YMM, but I think that it's just a minor instal manual issue.
Find:
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
[b] $categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and " . (YMM_FILTER_CATEGORIES_LISTING == 'Yes' ? YMM_get_categories_where((int)$category_links[$i],$YMM_where) : '') . " c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and " . (YMM_FILTER_CATEGORIES_LISTING == 'Yes' ? YMM_get_categories_where((int)$current_category_id,$YMM_where) : '') . " c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}
[/b]
Replace with this:
//bof Year_Make_Model Contribution v2.3.x by Dunweb Designs
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and " . (YMM_FILTER_CATEGORIES_LISTING == 'Yes' ? YMM_get_categories_where((int)$category_links[$i],$YMM_where) : '') . " c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and " . (YMM_FILTER_CATEGORIES_LISTING == 'Yes' ? YMM_get_categories_where((int)$current_category_id,$YMM_where) : '') . " c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}
//eof Year_Make_Model Contribution v2.3.x by Dunweb Designs
My original piece of index.php that I replaced with the one above:
if (isset($cPath) && strpos('_', $cPath)) {
// check to see if there are deeper categories within the current category
$category_links = array_reverse($cPath_array);
for($i=0, $n=sizeof($category_links); $i<$n; $i++) {
$categories_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
$categories = tep_db_fetch_array($categories_query);
if ($categories['total'] < 1) {
// do nothing, go through the loop
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$category_links[$i] . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
break; // we've found the deepest category the customer is in
}
}
} else {
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.categories_image, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' order by sort_order, cd.categories_name");
}
If anyone can direct me where I should look for my issue, I would appreciate.
Regards
Szymon
#92
Posted 13 July 2011 - 11:43 PM
More or less I sorted out and YMM is working now. However I have few more precise questions:
1) Is YMM working with more than one language? Every input that i place into YMM using second language (english) is switching me into results in (polish).
2) The result of the YMM is top-named "What's new".
3) The header of YMM result is a mess instead of name, price and buynow. It's probably me, but help where to correct it appreciated.
3) The filtering works only if the shop is in the main. Any other action - use of search or categories tree makes YMM not working. Is it normal, or I can correct it? Use of YMM box could or filter previous results given by category tree or search or it could even reset those actions and filter by itself from whole store. But it's quite strange when YMM in such situation looks like active but doesn't launch any action.
4) Use of YMM decrease the number of products displayed on the right of category tree into only those fitting the filter, but when you click on the category it gives all listed, however the number still remains decreased by YMM.
5) YMM runs automatically once you fill the last field (year). Is there any way to disable this? (means - click on go needed)
All the issues you can see on http://sklep.cantine.pl/
#93
Posted 18 July 2011 - 12:27 PM
I don't know why, because using several tools I've been checking implementation of YMM on my already modified shop, and it doesn't give the result. I made a fresh install and applied drop on top files - they are wrong.
To make it working I implemented few corrections mentioned in this thread in several posts:
1. Something with the cache I suppose - post
2. I cutted the red lines from post - link
3. I closed with missing </u> from - post
4. I added //<








