- osCommerce Support Forum
- → Viewing Profile: Issues: RMD27
Latest News: (loading..)
Community Stats
- Group Members
- Active Posts 303
- Profile Views 9,279
- Age Age Unknown
- Birthday Birthday Unknown
-
Real Name
Ricardo
-
Gender
Male
-
Interests
Top OSC Contributions
1.Easy Populate - OSC is useless without it
------------------
2.SEO URLS - Awesome
-------------------------
3.KissMT - Has some weaknesses, you cant specify your own tags for example but it is super easy to install
or 3.Header Tags - Big deal to install, can customise the tags.
-------------------------------
4. Ask a product question
---------------------------------
5. Order Editor
--------------------------
6. CSS Product Listing http://forums.oscommerce.com/topic/352919-convert-product-listings-to-table-less-css/
1) add the following code (new class definition) to includes/classes/boxes.php before the final ?>
///// BOF CSSTABLEBOX //////
class csstableBox {
// class constructor
function csstableBox($contents, $direct_output = false) {
for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $csstableBox_string .= $contents[$i]['form'] . "\n";
$csstableBox_string .= ' <div class="cssproduct_listing_item" >' . "\n";
if (isset($contents[$i][0]) && is_array($contents[$i][0])) {
for ($x=0, $n2=sizeof($contents[$i]); $x<$n2; $x++) {
if (isset($contents[$i][$x]['text']) && tep_not_null($contents[$i][$x]['text'])) {
$csstableBox_string .= ' <div class="cssproduct_listing_content">';
if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $csstableBox_string .= $contents[$i][$x]['form'];
$csstableBox_string .= $contents[$i][$x]['text'];
if (isset($contents[$i][$x]['form']) && tep_not_null($contents[$i][$x]['form'])) $csstableBox_string .= '</form>';
$csstableBox_string .= '</div>' . "\n";
}
}
} else {
$csstableBox_string .= ' <div class="cssproduct_listing_content">' . $contents[$i]['text'] . '</div>' . "\n";
}
$csstableBox_string .= ' </div>' . "\n";
if (isset($contents[$i]['form']) && tep_not_null($contents[$i]['form'])) $csstableBox_string .= '</form>' . "\n";
}
$csstableBox_string .= '<div class="cssclear"></div>' . "\n";
if ($direct_output == true) echo $csstableBox_string;
return $csstableBox_string;
}
}
class cssproductListingBox extends csstableBox {
function cssproductListingBox($contents) {
$this->csstableBox($contents, true);
}
}
////// EOF CSSTABLEBOX //////
2) add the following to includes/stylesheet.css
.cssproduct_listing_content{
border: 1px dotted #bbc3d3;
border-width: 0px 0px 0px 0px;
width: 140px;
padding: 2px 0px 2px 0px;
margin: 0px 0px 0px 0px;
}
.cssproduct_listing_item{
float: left;
width: 155px;
height: 165px;
border: 1px solid #bbc3d3;
border-width: 1px 1px 1px 1px;
font-family: Verdana, Arial, sans-serif;
font-size: 10px;
text-align: center;
padding: 5px 0px 5px 5px;
margin: 5px 5px 5px 5px;
}
.cssclear{clear: both;}
3) In includes/modules/product_listing.php:
about line 68 comment out the following.
ie change:
$list_box_contents[0][] = array('align' => $lc_align,
'params' => 'class="productListing-heading"',
'text' => ' ' . $lc_text . ' ');
to:
// $list_box_contents[0][] = array('align' => $lc_align,
// 'params' => 'class="productListing-heading"',
// 'text' => ' ' . $lc_text . ' ');
and change:
new productListingBox($list_box_contents);
to:
// new productListingBox($list_box_contents);
new cssproductListingBox($list_box_contents);
That's it.
---------------------------
7. To speed up the site search
I finally figured out what was bogging down my database when searching for products. I had to post this. I have about 220,000 active products in my store seekshopping.com... parse time is at the bottom if anyone wants to checkout the performance.
I have optimized so many queries and continue to monitor and do so. Whe I started, my search queries were about 20-40 seconds... that's a life time on the net. Including all the variables in the search url with help decrease query speed by about 50%...
keywords=wars&search_in_description=1&categories_id=&inc_subcat=1&medium=&pfrom=&pto=&dfrom=&dto=
Now I'm down to about 11 or 12 seconds for a search which is still not good enough. 6 seconds should be the maximum. Just remove products_model from the search string. Here is the code to change in advanced_search_result.php...
Comment this out:
//$where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%'";
Simply change to this:
$where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%'";
I hope this helps someone out. My queries are running under half a second and my search page parses in about 2 seconds. That's a 1500% imporvement.
check it out at http://www.seekshopping.com/catalog/
http://forums.oscommerce.com/topic/383574-simplified-search-any-contribution-available/
---------------------------
8. To ramp up site speed
2- Run this query in your db
ALTER TABLE `products_to_categories` DROP PRIMARY KEY;
ALTER TABLE `products_to_categories` ADD INDEX `idx_p2c_categories_id` ( `categories_id` );
ALTER TABLE `products_to_categories` ADD INDEX `idx_p2c_products_id` ( `products_id` );
Thanks
http://forums.oscommerce.com/topic/360813-a-big-problem-slow-20-30-sec/
---------------------------
MISC
Open graph protocol
<meta property="og:title" content="<?php echo $product_info['products_name']; ?>" />
<meta property="og:type" content="product" />
<meta property="og:url" content="<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] ;?>" >
<meta property="og:image" content="<?php print 'http://' . $_SERVER['SERVER_NAME'] . DIR_WS_HTTP_CATALOG . DIR_WS_IMAGES . $product_info['products_image']; ?>" />
<meta property="og:site_name" content="<?php echo STORE_NAME;?>" />
<meta property="fb:admins" content="YOUR_ADMIN_KEY_GOES_HERE" />
<meta property="og:description" content="<?php echo preg_replace('/[^a-zA-Z0-9\s]/','',preg_replace('/\s+/',' ',preg_replace("/
/", "",strip_tags($product_info['products_description'])))); ?>" />
====================================
Recommended Hosting Company
HostDog.gr - These guys are awesome
Contact Information
0
Neutral
User Tools
Latest Visitors
Message
There are no issues to display
- osCommerce Support Forum
- → Viewing Profile: Issues: RMD27
- Privacy Policy
- Forum Rules ·



Find content