Jump to content
Latest News: (loading..)
DunWeb

[Contribtion] Year/Make/Model for OSC v2.3.x

Recommended Posts

Hello everyone,

I checked the web and there are two particularly slow queries. I point these two queries if you can give me some advice:

 

"

Parse Time: 12.822s

Current Parse Time: 12.823 s with 459 queries

QUERY DEBUG:

 

Array

(

[QUERIES] => Array

(

[0] => select value from sessions where sesskey = '88d2b2c52b144df681f7b8437b138038' and expiry > '1376319442'

[1] => select code, title, symbol_left, symbol_right, decimal_point, thousands_point, decimal_places, value from currencies

[2] => select languages_id, name, code, image, directory from languages order by sort_order

[3] => delete from whos_online where time_last_click < '1376318542'

[4] => select count(*) as count from whos_online where session_id = '88d2b2c52b144df681f7b8437b138038'

[5] => update whos_online set customer_id = '0', full_name = 'Guest', ip_address = '87.221.28.120', time_last_click = '1376319442', last_page_url = '/'

 

etc

etc

etc....

 

[157] => select distinct products_car_make, products_car_model, products_car_year_bof, products_car_year_eof from products_ymm where products_car_make != '' and products_car_model != '' and products_car_year_bof !=0 and products_car_year_eof != 0 order by products_car_make, products_car_model, products_car_year_bof, products_car_year_eof

 

 

etc

etc

etc....

 

[349] => SELECT cd.categories_alt_imagen, p.products_id, p.products_image, p.products_tax_class_id, IF (s.status, s.specials_new_products_price, NULL) AS specials_new_products_price, p.products_price, pd.products_name FROM products p LEFT JOIN specials s ON p.products_id = s.products_id LEFT JOIN products_description pd ON p.products_id = pd.products_id AND pd.language_id = '3'

LEFT JOIN products_to_categories p2c ON p.products_id = p2c.products_id

LEFT JOIN categories_description cd ON p2c.categories_id = cd.categories_id

LEFT JOIN featured f ON p.products_id = f.products_id

WHERE cd.categories_id = p2c.categories_id and cd.language_id = '3' and p.products_status = '1' AND f.status = '1' order by rand(692469238) DESC limit 9

 

etc

etc

etc....

 

 

)

 

[TIME] => Array

(

[0] => 0.005322

[1] => 0.001707

[2] => 0.002025

[3] => 0.002469

[4] => 0.002716

[5] => 0.003216

 

etc

etc

etc....

 

[157] => 5.927031

 

etc

etc

etc....

 

[349] => 1.116730

 

)

 

)

 

"

Share this post


Link to post
Share on other sites

Hello:

I found that when refresh the page, the SQL queries running quickly.

 

[157] => 0.033258

 

etc

etc

etc....

 

[349] => 0.019945

 

This has made me think that the problem may be caused by cookies check when entering the first page.

Can this be possible?

The reality is that the page refreshes in 3 seconds when initially almost takes 13 to open.

Thank you very much for your opinions and advice.

Regards,

Share this post


Link to post
Share on other sites

Hi Nacho

 

Not sure what you are seeing but the site is loading very fast in IE and Firefox by me looking from UK

 

See no problem quicker than a few days ago.

 

regards

Joli


To improve is to change; to be perfect is to change often.

 

Share this post


Link to post
Share on other sites

Hi Nacho

 

Not sure what you are seeing but the site is loading very fast in IE and Firefox by me looking from UK

 

See no problem quicker than a few days ago.

 

regards

Joli

 

Sure?? :D

It's a relief for me to read your reply.

From Google Spain, with Firefox is very slow.

I'm afraid that harm me in Google search results because of slow execution times.

@@joli1811, thanks for your reply.

Share this post


Link to post
Share on other sites

@@DunWeb Will there be an update to work with osc 2.3.3.3? I still get this error after the update:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and p.products_status = '1' and p.products_id = p2c.products_id and pd.produc' at line 1

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_id in () and p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1'

 

[TEP STOP]

Share this post


Link to post
Share on other sites

Hello, which oscommerce version does this addon work on? Ive tried installing it on every version from 2.3.3 - 2.3.3.4 without any good results.

 

This is what it looks like on my fresh 2.3.3.4 installation:

 

http://www.dhsbilservice.se/bilder/IMG01.jpg

http://www.dhsbilservice.se/bilder/IMG02.jpg

http://www.dhsbilservice.se/bilder/IMG03.jpg

http://www.dhsbilservice.se/bilder/IMG04.jpg

 

Thanks in advance // Jonas

Share this post


Link to post
Share on other sites

Hello, which oscommerce version does this addon work on? Ive tried installing it on every version from 2.3.3 - 2.3.3.4 without any good results.

 

This is what it looks like on my fresh 2.3.3.4 installation:

 

http://www.dhsbilservice.se/bilder/IMG01.jpg

http://www.dhsbilservice.se/bilder/IMG02.jpg

http://www.dhsbilservice.se/bilder/IMG03.jpg

http://www.dhsbilservice.se/bilder/IMG04.jpg

 

Thanks in advance // Jonas

 

apart from a missing language define all the rest looks ok.


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

apart from a missing language define all the rest looks ok.

 

Hmm, then I have to ask you how to use it heh.. Because when I fill out the information when adding a new product, it doesnt get added. Also I the "Use Previous" dropdowns doesnt get filled with any information. And I haven't seen any related errors, non at all for that matter. Maybe I should check out the mysql logs, as there might be a problem inserting the information into the database?

Share this post


Link to post
Share on other sites

Hmm, then I have to ask you how to use it heh.. Because when I fill out the information when adding a new product, it doesnt get added. Also I the "Use Previous" dropdowns doesnt get filled with any information. And I haven't seen any related errors, non at all for that matter. Maybe I should check out the mysql logs, as there might be a problem inserting the information into the database?

 

Have you done as per the post linked below? The most current version of osC uses MySQLi, so you have to update all references to mysql_ as explained in the link below......

 

http://forums.oscommerce.com/topic/370902-contribtion-yearmakemodel-for-osc-v23x/page__st__200#entry1677588

Share this post


Link to post
Share on other sites

Have you done as per the post linked below? The most current version of osC uses MySQLi, so you have to update all references to mysql_ as explained in the link below......

 

http://forums.oscommerce.com/topic/370902-contribtion-yearmakemodel-for-osc-v23x/page__st__200#entry1677588

 

Not quite sure what is meant by that, but I'm running PHP 5.3.13 so that fix shouldnt be needed for me it seems?

 

Maybe im doing something wrong during my install?

 

What I do is I copy the files to the catalog folder, then I install it. I added the SQL to the install files so that it creates the table and so forth. Then when the installation is done i install the module under modules>boxes.

 

After this everything should be golden, no?

 

Still facing the same problems as before, so if anyone have any suggestions. Feel free to shime in!

 

Thanks in advance.

 

Nevermind, I resolved it. There was still one occurence of mysql_* in categories.php.

Edited by srtu

Share this post


Link to post
Share on other sites

Hello again, didn't get the last version to work. Populated the database fine but I couldnt use the drop downs to search for products..

 

Tried installing everything again and now I'm back to square 1, running OSC 2.3.1 and the latest YMM. I'm running it on WAMP Apache 2.2.22, PHP 5.3.13 and MySQL 5.5.24.

 

It looks as it looked on the SS's I posted before, http://www.dhsbilservice.se/bilder/IMG01.jpg , http://www.dhsbilservice.se/bilder/IMG02.jpg , http://www.dhsbilservice.se/bilder/IMG03.jpg , http://www.dhsbilservice.se/bilder/IMG04.jpg .

 

I've replaced all the mysql_* occurencies with tep_db_* as was suggested, stll no luck.

 

What I do, in this order is. Create the database, install OSC, populate the database with the YMM data, move the YMM files over to OSC, install the box from modules >> boxes. After that it looks like on the SS's, and I can't populate the database.

 

I saw that there was a new step in the latest YMM version "install box from Catalog >> ymmajax.php", not sure about how to perform this one. I dont have anything called ymmajax.php under my catalog dropdown in the admin panel.

 

I'm starting to run out of ideas =/

 

Any ideas nor help would be much appriciated!

 

Thanks in advance // Jonas

Share this post


Link to post
Share on other sites

@@DunWeb

 

Hi Chris,

 

I have a bit of a bug and I am not sure what is causing it.

 

I am using the fork you made for the extra part field and it works to a degree except that when I make a selection from all dropdowns and the ajax invokes it produces this error:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') and p.products_status = '1' and p.products_id = p2c.products_id and pd.produc' at line 1

 

select count(distinct p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join specials s on p.products_id = s.products_id, products_to_categories p2c where p.products_id in () and p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1'

 

[TEP STOP]

 

However if I go back to the index.php (the dropdowns are still prefilled) and I click the 'go' button then the code works perfectly and the relevant products are displayed.

 

I have narrowed the offending query down to this one:

 

if($current_category_id){
 $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}else{
 $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "'";
}

 

as for if there is a problem with the ajax then I have no idea.

 

Any help would be appreciated on this one.

 

Thanks

 

Mark


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

@@DunWeb

 

Hi Chris,

 

I have a bit of a bug and I am not sure what is causing it.

 

I am using the fork you made for the extra part field and it works to a degree except that when I make a selection from all dropdowns and the ajax invokes it produces this error:

 

 

 

However if I go back to the index.php (the dropdowns are still prefilled) and I click the 'go' button then the code works perfectly and the relevant products are displayed.

 

I have narrowed the offending query down to this one:

 

if($current_category_id){
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$current_category_id . "'";
}else{
$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where " . (YMM_FILTER_PRODUCT_LISTING == 'Yes' ? $YMM_where : '') . " p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "'";
}

 

as for if there is a problem with the ajax then I have no idea.

 

Any help would be appreciated on this one.

 

Thanks

 

Mark

 

ok I found out what the issue was.

 

As the part code I had 12" and when I changed it to just 12 it worked

 

now to work out how to escape that character when being called from the database so I can still use the " character.

 

Mark


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

ok must admit I am now a bit stuck. I need to escape special characters in the 'Part' pulldown so not to cause a 1064 error.

 

Anyone have any ideas or have had to do this themselves?

 

Thanks

 

Mark


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

Hi, I installed the module as per instructions. I am new to OSC so I guess I am a little lost. I can't seem to add year make and model info in a product and there is nothing in the dropdown boxes, completely empty with no "Choose Make" etc. What am I supposed to do now?

Share this post


Link to post
Share on other sites

Also is there a way to add more dropdown box searches, I need it for something like "Dodge" - "Ram 1500" - "SLT" - "8 cly". Otherwise this whole cart system wont work for me.

Share this post


Link to post
Share on other sites

Also is there a way to add more dropdown box searches, I need it for something like "Dodge" - "Ram 1500" - "SLT" - "8 cly". Otherwise this whole cart system wont work for me.

 

if you use this version by DunWeb 'http://addons.oscommerce.com/info/7835

 

download the 'FORK' which will give you the extra field you need.

 

If nothing is showing then recheck your install to ensure it is all correct and make sure the year/make/model info is being saved to the database.

 

Mark

Edited by PupStar

Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

if you use this version by DunWeb 'http://addons.oscommerce.com/info/7835

 

download the 'FORK' which will give you the extra field you need.

 

If nothing is showing then recheck your install to ensure it is all correct and make sure the year/make/model info is being saved to the database.

 

Mark

 

Hi Thanks for responding. There was one file, products_info.php which I uploaded but i don't see any changes. When I try to set the YMM, it doesn't save anything.

Share this post


Link to post
Share on other sites

This is what I see and where it says add new, when I input it and save, nothing saves..

 

and the configuration is set to 'Yes' for the product info page???


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

@@DunWeb Okay new problem, I reinstalled, made sure I used Dunweb's files this time but now the box destroys the html column tables on the page unless I use it at the end of the right column. Still can't create a new product and enter the ymmp info, wont save anything. What am I missing?

Share this post


Link to post
Share on other sites

@@vectorsites

 

I would say this is down to your <div>'s not been correctly closed or the code placed in the incorrect place.

 

As to why it does not work could be anyones guess. Without checking your install personally then there is no way of knowing.

 

Regards

 

Mark


Bootstrap 3 ROCKS!

(or it will if I ever get my head around it lol)

(and I think I have now (w00t) )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×