Guest Posted June 20, 2005 Share Posted June 20, 2005 Not sure if this is in the right forum but there you go, please move it if its in the wrong one.... Our store is a single currency, single language site as im sure there are many of. I was wondering if anyone could help out in removing the redundant queries that make up the osC store? Its easy to comment out the currency box, and language etc from column right or wherever but the queries that are related to these are still executed. Is there an easy way to get rid of these currency and language queries at all and thus speed up the store a little in the same process? Cheers James Link to comment Share on other sites More sharing options...
FalseDawn Posted June 20, 2005 Share Posted June 20, 2005 http://www.oscommerce.com/forums/index.php?showtopic=119077 Might give you some ideas. Yes, it is the wrong forum. And no, there's no "easy" way really. Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2005 Share Posted June 20, 2005 http://www.oscommerce.com/forums/index.php?showtopic=119077 Might give you some ideas. Yes, it is the wrong forum. And no, there's no "easy" way really. <{POST_SNAPBACK}> Already been through all of that many times over thanks. Thought this might be a "next step" hence putting it here rather than eleswhere. If theres no "easy" way perhaps some ideas on how to do it the more difficult way might be of use? Is it a matter of removing all of the calls to these functions in each query? Ie going through index.php and product_info.php for example and searching for X and deleting it, then looking for Y then deleting it? Link to comment Share on other sites More sharing options...
boxtel Posted June 20, 2005 Share Posted June 20, 2005 Already been through all of that many times over thanks.Thought this might be a "next step" hence putting it here rather than eleswhere. If theres no "easy" way perhaps some ideas on how to do it the more difficult way might be of use? Is it a matter of removing all of the calls to these functions in each query? Ie going through index.php and product_info.php for example and searching for X and deleting it, then looking for Y then deleting it? <{POST_SNAPBACK}> You might take the biggest ones out first for currency and language by addressing the currencies and language classes which handle most of their functionality. Treasurer MFC Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2005 Share Posted June 20, 2005 You might take the biggest ones out first for currency and language by addressing the currencies and language classes which handle most of their functionality. <{POST_SNAPBACK}> Thanks for your imput Amanda, would you care to expand on how I would go about doing that please? Taking the language class as an example I can see 3 functions inside the language class, is it safe to just comment these out or something? Link to comment Share on other sites More sharing options...
boxtel Posted June 20, 2005 Share Posted June 20, 2005 Thanks for your imput Amanda, would you care to expand on how I would go about doing that please? Taking the language class as an example I can see 3 functions inside the language class, is it safe to just comment these out or something? <{POST_SNAPBACK}> first I would copy the classes to a save place for when you might want to re-install the original versions. then amend the functions. for the function language () simply remove everything but keep : $this->set_language('en'); then in function set_language($language) only keep: $this->language['directory'] = 'english'; $this->language['id'] = '1'; in function get_browser_language() only keep : $this->language['directory'] = 'english'; $this->language['id'] = '1'; I am sure there is a more nice way to handle it but basically you remove all the processing and simply have the functions return the static data you want. This way you do not have to go in all the code to remove parameters or function calls because you change it at the core. Treasurer MFC Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2005 Share Posted June 20, 2005 first I would copy the classes to a save place for when you might want to re-install the original versions. then amend the functions. for the function language () simply remove everything but keep : $this->set_language('en'); then in function set_language($language) only keep: $this->language['directory'] = 'english'; $this->language['id'] = '1'; in function get_browser_language() only keep : $this->language['directory'] = 'english'; $this->language['id'] = '1'; I am sure there is a more nice way to handle it but basically you remove all the processing and simply have the functions return the static data you want. This way you do not have to go in all the code to remove parameters or function calls because you change it at the core. <{POST_SNAPBACK}> Great, I just tried it out and renamed the original file for safekeeping. All seems to be working :thumbsup: Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2005 Share Posted June 20, 2005 Great, I just tried it out and renamed the original file for safekeeping.All seems to be working :thumbsup: <{POST_SNAPBACK}> Forgot to say thank you :blush: .... so ermmmmm thank you! :D Link to comment Share on other sites More sharing options...
Guest Posted June 20, 2005 Share Posted June 20, 2005 Looking at this the long way around.... $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); Here an example of a product info query from index.php, all of the bold info is commented out/not used in our store. Would it therefore be an idea to remove all of this bolded code? Link to comment Share on other sites More sharing options...
boxtel Posted June 20, 2005 Share Posted June 20, 2005 Looking at this the long way around.... $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'"); Here an example of a product info query from index.php, all of the bold info is commented out/not used in our store. Would it therefore be an idea to remove all of this bolded code? <{POST_SNAPBACK}> I don't think that that would help much, a field from the same table more or less makes no significant difference. If it would allow you to eliminate a table join and reduce it to a simple select on 1 table with the index field, yes, then it would. So if for instance you would have to join the manufacturers table to get the manufacturers name which you don't need, then removing that would help. Treasurer MFC Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.