Feeds:
Posts
Comments

My site Goodlivesbeads is still very slow, so searching on the internet for more solution to speed up the site.

I found another solution on this page. Check out post 18.

Solution 2

1. First add these lines in php admin:

alter table banners add index idx_banners_group (banners_group);
alter table banners_history add index idx_banners_history_banners_id (banners_id);
alter table currencies add index idx_currencies_code (code);
alter table customers add index idx_customers_email_address (customers_email_address);
alter table customers_basket add index idx_customers_basket_customers_id (customers_id);
alter table customers_basket_attributes add index idx_customers_basket_att_customers_id (customers_id);
alter table orders add index idx_orders_customers_id (customers_id);
alter table orders_products add index idx_orders_products_orders_id (orders_id);
alter table orders_products add index idx_orders_products_products_id (products_id);
alter table orders_status_history add index idx_orders_status_history_orders_id (orders_id);
alter table orders_products_attributes add index idx_orders_products_att_orders_id (orders_id);
alter table orders_products_download add index idx_orders_products_download_orders_id (orders_id);
alter table products add index idx_products_model (products_model);
alter table products_attributes add index idx_products_attributes_products_id (products_id);
alter table reviews add index idx_reviews_products_id (products_id);
alter table reviews add index idx_reviews_customers_id (customers_id);
alter table specials add index idx_specials_products_id (products_id);
alter table zones add index idx_zones_to_geo_zones_country_id (zone_country_id);

From all these lines, only the last line wasn’t allready on my site.

2. Add the next lines in php admin:

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` );

Yeeeaaaahhhhhh , the lines of point 2 are really helping for now.

I hope it stays that way. I really see a difference on my site and I think my customers will notice it too.

On 2-10-2009 there was an update for the Contrib Ultimate SEO Urls.

I started with the normal thing for the update, to copy the seo.class.php to catalog/includes/classes. Then I followed the “normal” update procedure to open the file in the browser and after that set the configuration setting back to what they were before.

Then I checked my all-products.php pages (those were part of the update changes), and to my surprise it wasn’t working. back to the forum. In the forum was written that you had to do some more staps this time.

1. Update admin/includes/functions/general.php with the lines in the install instruction.

2. Add an extra line to the .htacces or in case of the windows users to the httd.ini

I checked the lines for the .htaccess file and found out that I also missed two other ones. So my httpd.ini file now looks like this:

[ISAPI_Rewrite]

UriMatchPrefix /catalog/
UriFormatPrefix /catalog/

# From Ultimate SEO URLs
RewriteRule [^?]*-p-([^?]*)\.html(?:\?(.*))? /product_info.php\?products_id=$1?2&$2 [I,L]
RewriteRule [^?]*-c-([^?]*)\.html(?:\?(.*))? /index.php\?cPath=$1?2&$2 [I,L]
RewriteRule [^?]*-m-([^?]*)\.html(?:\?(.*))? /index.php\?manufacturers_id=$1?2&$2 [I,L]
RewriteRule [^?]*-pi-([^?]*)\.html(?:\?(.*))? /popup_image.php\?pID=$1?2&$2 [I,L]
RewriteRule [^?]*-t-([^?]*)\.html(?:\?(.*))? /articles.php\?tPath=$1?2&$2 [I,L]
RewriteRule [^?]*-a-([^?]*)\.html(?:\?(.*))? /article_info.php\?articles_id=$1?2&$2 [I,L]
RewriteRule [^?]*-au-([^?]*)\.html(?:\?(.*))? /articles.php\?authors_id=$1?2&$2 [I,L]
RewriteRule [^?]*-pr-([^?]*)\.html(?:\?(.*))? /product_reviews.php\?products_id=$1?2&$2 [I,L]
RewriteRule [^?]*-pri-([^?]*)\.html(?:\?(.*))? /product_reviews_info.php\?products_id=$1?2&$2 [I,L]
RewriteRule [^?]*-i-([^?]*)\.html(?:\?(.*))? /information.php\?info_id=$1?2&$2 [I,L]
RewriteRule [^?]*-links-([^?]*)\.html(?:\?(.*))? /links.php\?lPath=$1?2&$2 [I,L]
RewriteRule [^?]*-pm-([^?]*)\.html(?:\?(.*))? /info_pages.php\?pages_id=$1?2&$2 [I,L]
RewriteRule [^?]*-by-([^?]*)\.html(?:\?(.*))? /all-products.php\?fl=$1?2&$2 [I,L]
UriMatchPrefix
UriFormatPrefix

After adding all the changes and uploading the files to the server, my site seems to work fine now.

For a couple of weeks I have the feeling that my site Goodlivesbeads became very slow. I don’t know where that comes from. I did a lot of work on my site, so maybe there is a problem with one (or more) of the contributions. Or maybe my provider did something. I think it will be hard to find out what it is.

So I’m going to surf on the internet and see If I can find some solutions to the slow site.

Solution 1

The first thing that I found was a forum post from FWR Media. He found out that if your images on non secure page are loading as https, then you had to do what he did. I couldn’see if my images are loading that way, but I tried his solution, just in case.

1. In catalog/includes/application_top.php the following line sets the request type SSL or not.

// set the type of request (secure or not)
$request_type = (getenv(‘HTTPS’) == ‘on’) ? ‘SSL’ : ‘NONSSL’;

For whatever reason my server was always returning ON even when not an SSL request.

This causes the base href of non secure pages to be https and causes ALL images to load as https://www.mysite.com/thisimage.php causing massive slowdown.

Changing the line to …

// set the type of request (secure or not)
$request_type = (getenv(‘SERVER_PORT’) == ‘443′) ? ‘SSL’ : ‘NONSSL’;

2. catalog/includes/functions/general.php

Change:

if ( (ENABLE_SSL == true) && (getenv(‘HTTPS’) == ‘on’) ) { // We are loading an SSL page

Into:

if ( (ENABLE_SSL == true) && (getenv(‘SERVER_PORT’) == ‘443′) ) { // We are loading an SSL page

After implementing this solution I did have the feeling that some pages ar loading a little bit faster, but still not what I was used to. It really should have my prioroty from now on to get the site faster, because I have a lot of new products to add, and more products can make it even more slow.

So searching for more………………….

This morning I woke up, checked my site and found two warnings on the Contrib_tracker (Contribution 4815), one on the top of the page:

Warning: Invalid argument supplied for foreach() in catalog\admin\contrib_tracker.php on line 119

The second warning was after the sentence “Latest OSC contribution”, the same sentence, but then on line 735

So I googled a little bit, but couldn’t found a real solution, only the same problems wit other contribs. In One forum I found a “solution” that I tried.

Solution

In catalog/admin/contrib_tracker.php, find 

1. on line 119: foreach ($articlelist['item'] as $article ) {  

Before this add:

if (is_array ($articlelist['item'])){

2. add }    after 

// UPDATE THE CONTRIBUTIONS THAT ARE IN THE RSS FILE
    tep_db_query(“UPDATE ” . TABLE_CONTRIB_TRACKER . ” SET status =’0′, contr_last_modified = ‘” . $osc_rss_pubdate . “‘ where contrib_name = ‘” . $thetitle . “‘ and last_update < ‘” . $osc_rss_pubdate . “‘”);
  }
}

3.  find on line 737: foreach ($articlelist['item'] as $article ) {

Before this line add:

if (is_array ($articlelist['item'])){

4. add }    after

echo “ERROR: Could not open RDF feed\n”;
}

After uploading my warnings were gone. Instead of that I saw the sentence

    ERROR: Could not open RDF feed

So probably a problem on the OSC site. I hope it’s gone soon

The update to Ultimate Seo urls version 2.2.d is easy.

I first made a screenshot of my settings in the control panel and I copied the special character conversion settings to Excell, so Icould easily copy them back later.

The only thing you need to do with the installation is copy seo.class.php to catalog/includes/classes. After that you call the file in your browser (www. yourdomain.com/catalog/includes/classes/seo_class.php). I didn’t see anything in my screen after opening the file, but at the admin site I saw that the configuration settings have changed.

In the admin I went to configuration/SEO Urls and changed back my settings. There is one new line:  Enable use Header tags as name. I left that to false, because I think the Ultimate seo Urls handels the names fine. After that I reseted Seo urls Cache, and finished.

Screenshot Configuration settings:

050 Ultimateseourls3

Do you also hate the fact when you want to control something in your Admin, you are logged out again (for the hundredst time that day)? Then the contrib Simpler admin session length Controller is something for You too.

This Contrib is very easy to install and only takes a couple of minutes work.

Warning: be careful if you copy any code from the blog. It is possible that WordPress breaks the code and that during copying whitespaces or other hidden caracters occur in your files, so always check if your codes look normal

Installation

1. Upload the row out of the installation file to you php admin.

INSERT INTO `configuration` (`configuration_id`, `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES (471, ‘Admin Session Lifetime’, ‘MYSESSION_LIFETIME’, ‘3600′, ‘Length of time you can stay on one page in ADMIN, without a refresh, before you are required to log in. Measured in Seconds. (The value you set is added to 10 minutes, so that you can not set this to 0 and mess yourself up.)’, 15, 8, ‘2005-01-19 03:43:31′, ‘2005-01-19 03:30:25′, NULL, NULL);

At my site the 471 in the row gave a duplicate error. So I checked my configuration table and the last used configuration_id was 626, so I changed it to 627.

2. Copy the replacement code to admin/includes/function/session.php

Finished with installation

In you admin you can set under the configuration > sessions the time that you want to stay logged into the admin session.

Screenshots (my site)

064 Simpler admin session length1

On the shop goodlivesbeads.nl I allready had installed the contrib Quantity Price per Product. I updated it a couple of days ago. Really a terrible contrib to install when you allready have other contribs like margin report, Ultra pics, Ms2 Html manager, tabedit etc. You have to be careful not to copy all the new code over the old code, and also be careful not to forget some code. So trying to install this on Claudiavandijk.com was a little bit faster, cause now I can use the code of the first site. That’s always better. I installed version 1.3.5 of 7-9-2008 and added the two shopping cart changes of 17-7-2009 after that.

Warning: be careful if you copy any code from the blog. It is possible that WordPress breaks the code and that during copying whitespaces or other hidden caracters occur in your files, so always check if your codes look normal

Installation

1. First copying the sql statements of price_breaks.sql in php admin.

2. Copying all the new files to their folders

3. Changes in catalog/index.php. Because of product descrition and new products Icon, my code looks a little bit different.  It looks like this now:

// show the products of a specified manufacturer
// BOF qpbpp
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
// p.products_date_added to query for New Product Icon contribution
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_date_added, p.manufacturers_id, p.products_price, p.products_qty_blocks, 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 . ” p left join ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” . TABLE_MANUFACTURERS . ” m, ” . TABLE_PRODUCTS_TO_CATEGORIES . ” p2c left join ” . TABLE_SPECIALS . ” s on ‘p.products_id = s.products_id’ where p.products_status = ‘1′ and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = ‘” . (int)$HTTP_GET_VARS['manufacturers_id'] . “‘ 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)$HTTP_GET_VARS['filter_id'] . “‘”;
} else {
// We show them all
// p.products_date_added to query for New Product Icon contribution
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_date_added, p.manufacturers_id, p.products_price, p.products_qty_blocks, 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 . ” p left join ” . TABLE_SPECIALS . ” s on ‘p.products_id = s.products_id’, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” . TABLE_MANUFACTURERS . ” m where p.products_status = ‘1′ and pd.products_id = p.products_id and pd.language_id = ‘” . (int)$languages_id . “‘ and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = ‘” . (int)$HTTP_GET_VARS['manufacturers_id'] . “‘”;
}
} else {
// show the products in a given categorie
if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only specific catgeory
// p.products_date_added to query for New Product Icon contribution
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_date_added, p.manufacturers_id, p.products_price, p.products_qty_blocks, 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 . ” p left join ” . TABLE_SPECIALS . ” s on ‘p.products_id = s.products_id’, ” . TABLE_PRODUCTS_DESCRIPTION . ” pd, ” . TABLE_MANUFACTURERS . ” m, ” . TABLE_PRODUCTS_TO_CATEGORIES . ” p2c where p.products_status = ‘1′ and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = ‘” . (int)$HTTP_GET_VARS['filter_id'] . “‘ 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 {
// We show them all
// p.products_date_added to query for New Product Icon contribution
$listing_sql = “select ” . $select_column_list . ” p.products_id, p.products_date_added, p.manufacturers_id, p.products_price, p.products_qty_blocks, 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 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 . “‘”;

4. catalog/product_info. I only added  p.products_qty_blocks, at the first instruction for this file.

The second instruction is the same, but the third is different. I use the no stock no checkout contrib for my website. So I had to add the code like this:

<?php
if ($product_info['products_quantity'] <=0) { ?>
<td align=”right”><?php echo tep_draw_hidden_field(‘products_id’, $product_info['products_id']) . tep_image_button(‘button_in_cart_na.gif’, IMAGE_BUTTON_IN_CART_NA); ?></td>
<?php
} else { ?>
<?php // BOF qpbpp
//<td align=”right”><?php echo tep_draw_hidden_field(‘products_id’, $product_info['products_id']) . tep_image_submit(‘button_in_cart.gif’, IMAGE_BUTTON_IN_CART);
?>
<td align=”right”>
<table border=”0″ align=”right”>
<tr><td align=”center”>
<?php echo TEXT_ENTER_QUANTITY . “:” . tep_draw_input_field(‘cart_quantity’, $pf->adjustQty(1), ’size=”6″‘); ?>
</td></tr>
<tr><td align=”center”>
<?php echo tep_draw_hidden_field(‘products_id’, $product_info['products_id']) . tep_image_submit(‘button_in_cart.gif’, IMAGE_BUTTON_IN_CART); ?>
</td></tr>
</table>
</td>
<?php // EOF qpbpp ?>

5. catalog/admin/categories.php

This file is heavily edited in my shop. So with all the replacements I am very careful with what I add and what not. I try to see what’s new in the replacements and just add that code. There is nothing strange about it, so I don’t copy all the code here.

6. catalog/includes/classed/shopping_cart.php

It’s the same as with the categories.php file, be careful not to delete code from other contribs, just add the new code instead of replace all the new code.

7. The last instruction in catalog/includes/modules/product_listing.php is a little bit difficult. I don’t show prices in this shop for now, so also not in productlisting, but I do have the New products Icon and Products description installed. Why install this contrib then? Well I’m probably going to sell cards or posters of the photos that I make in the future,  so I’m preparing the site for this allready. My code looks like this now:

switch ($column_list[$col]) {
case ‘PRODUCT_LIST_MODEL’:
$lc_align = ”;
$lc_text = ‘&nbsp;’ . $listing[$x]['products_model'] . ‘&nbsp;’;
break;
case ‘PRODUCT_LIST_NAME’:
// added for New Product Icon contribution
//  2592000 = 30 days in the unix timestamp format
if ( ($today_time – strtotime($listing[$x]['products_date_added'])) < 2592000) {
$listing[$x]['products_name'] .= ‘&nbsp’ . tep_image_button(‘icon_newarrival.gif’, TEXT_ICON_NEW_PRODUCT. ‘&nbsp;:&nbsp;’ . $listing[$x]['products_name'], ‘align=”middle”‘);
}
// end addition
$lc_align = ”;
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$lc_text = ‘<a href=”‘ . tep_href_link(FILENAME_PRODUCT_INFO, ‘manufacturers_id=’ . $HTTP_GET_VARS['manufacturers_id'] . ‘&products_id=’ . $listing[$x]['products_id']) . ‘”>’ . $listing[$x]['products_name'] . ‘</a>’;
} else {
$lc_text = ‘&nbsp;<a href=”‘ . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? ‘cPath=’ . $cPath . ‘&’ : ”) . ‘products_id=’ . $listing[$x]['products_id']) . ‘”>’ . $listing[$x]['products_name'] . ‘</a>&nbsp;’;
}
// Product description
if (PRODUCT_LIST_DESCRIPTION && $listing[$x]['products_description'] && PRODUCT_LIST_DESCRIPTION_MAX_LENGTH)
$lc_text .= ‘<br><table border=”0″ cellpadding=”0″ cellspacing=”0″ width=”100%”><tr><td>’ . tep_flatten_product_description($listing[$x]['products_description'],  ‘ <a href=”‘ . tep_href_link(FILENAME_PRODUCT_INFO, ‘products_id=’ . $listing[$x]['products_id']) . ‘”>’ . TEXT_MORE . ‘</a>’) . ‘</td></tr></table>’;
// Product description
break;
case ‘PRODUCT_LIST_MANUFACTURER’:
$lc_align = ”;
// Auto Sort Mod Start ——
if (PRODUCT_LIST_AUTOSORT == ‘True’) {
// Add the Sort criteria to the URL
$sortcol = PRODUCT_LIST_AUTOSORT_COL;
if (PRODUCT_LIST_AUTOSORT_DIR == ‘Ascending’) {
$autosort = $sortcol . “a”;
} else {
$autosort = $sortcol . “d”;
}

$lc_text = ‘&nbsp;<a href=”‘ . tep_href_link(FILENAME_DEFAULT, ‘manufacturers_id=’ . $listing['manufacturers_id']);

$lc_text .= ‘&page=1&sort=’ . $autosort . ‘”>’ . $listing['manufacturers_name'] . ‘</a>&nbsp;’;

} else {
$lc_text = ‘&nbsp;<a href=”‘ . tep_href_link(FILENAME_DEFAULT, ‘manufacturers_id=’ . $listing[$x]['manufacturers_id']) . ‘”>’ . $listing[$x]['manufacturers_name'] . ‘</a>&nbsp;’;
}

//    $categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . ‘”>’;
// This was replaced: $lc_text = ‘&nbsp;<a href=”‘ . tep_href_link(FILENAME_DEFAULT, ‘manufacturers_id=’ . $listing['manufacturers_id']) . ‘”>’ . $listing['manufacturers_name'] . ‘</a>&nbsp;’;
// Auto Sort Mod End ———–
break;
case ‘PRODUCT_LIST_PRICE’:
$lc_align = ‘right’;
if (tep_not_null($listing['specials_new_products_price'])) {
$lc_text = ‘&nbsp;<span><s>’ .  $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ‘</s></span>&nbsp;&nbsp;<span>’ . $currencies->display_price($listing['specials_new_products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ‘</span>&nbsp;’;
} else {
$lc_text = ‘&nbsp;<span>’ . $currencies->display_price($listing['products_price'], tep_get_tax_rate($listing['products_tax_class_id'])) . ‘</span>&nbsp;’;
}
break;
case ‘PRODUCT_LIST_QUANTITY’:
$lc_align = ‘right’;
// Mod for Not Showing Quantity with No Stock No CheckOut
//  $lc_text = ‘&nbsp;’ . $listing['products_quantity'] . ‘&nbsp;’;
$lc_text = ‘&nbsp;&nbsp;’;
break;
case ‘PRODUCT_LIST_WEIGHT’:
$lc_align = ‘right’;
$lc_text = ‘&nbsp;’ . $listing[$x]['products_weight'] . ‘&nbsp;’;
break;
case ‘PRODUCT_LIST_IMAGE’:
$lc_align = ‘center’;
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$lc_text = ‘<a href=”‘ . tep_href_link(FILENAME_PRODUCT_INFO, ‘manufacturers_id=’ . $HTTP_GET_VARS['manufacturers_id'] . ‘&products_id=’ . $listing[$x]['products_id']) . ‘”>’ . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ‘</a>’;
} else {
$lc_text = ‘&nbsp;<a href=”‘ . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? ‘cPath=’ . $cPath . ‘&’ : ”) . ‘products_id=’ . $listing[$x]['products_id']) . ‘”>’ . tep_image(DIR_WS_IMAGES . $listing[$x]['products_image'], $listing[$x]['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . ‘</a>&nbsp;’;
}
break;
case ‘PRODUCT_LIST_BUY_NOW’:
$lc_align = ‘center’;
// no stock no checkout
if ($listing['products_quantity']<=0) {
$lc_text = tep_image_button(‘button_buy_now_na.gif’, IMAGE_BUTTON_BUY_NOW_NA) . ‘&nbsp;’;
} else {
$lc_text = ‘<a href=”‘ . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array(‘action’)) . ‘action=buy_now&products_id=’ . $listing[$x]['products_id']) . ‘”>’ . tep_image_button(‘button_buy_now.gif’, IMAGE_BUTTON_BUY_NOW) . ‘</a>&nbsp;’;
}
// no stock no checkout
break;
}
// EOF qpbpp

Screenshots (my site)

These screenshots are from both of my sites, because on claudiavandijk.com the prices are not visible, and that won’t show the price breaks then.

Product Information:

063 QPBPP1

File in product listing:

063 QPBPP4

Tabel in Product Info Admin site:

063 QPBPP2

Configuration Price break:

063 QPBPP3

Since I have Header Tags SEo installed on my mulptiple language store, my product editing page on the admin site became very large. In the other shop (goodlivesbeads), I also have quantitiy price break installed, so there it’s even larger.  Searching on the internet I found the Tabedit Contrib.

Only this contrib is in French. So I tried to translate it to English, and put the translation on the contrib page. You can choose between a normal version and a version with Header tags and FCK editor. I first tried the Header tags with FCK editor, but that one gave me a parse error. And I don’t have the FCK editor, I use Ultrapics with html editor.

Warning: be careful if you copy any code from the blog. It is possible that WordPress breaks the code and that during copying whitespaces or other hidden caracters occur in your files, so always check if your codes look normal

Installation

I followed all the instructions, but instead of deleting the code, I put the code between <!–      –>

So if something would be wrong it’s much easier to change.

1. At point 1 You had to find: <script type=”text/javascript” src=”includes/general.js”></script>

My code looked like this:  <script language=”javascript” src=”includes/general.js”></script>

2. One of the last piece that you replace in point 3 looks like this:

<td><?php echo tep_draw_textarea_field(‘products_description[' . $languages[$i]['id'] . ‘]’, ’soft’, ‘70′, ‘15′, (isset($products_description[$languages[$i]['id']]) ? ereg_replace(‘& ‘, ‘&amp; ‘, trim(stripslashes($products_description[$languages[$i]['id']]))) : tep_get_products_description($pInfo->products_id, $languages[$i]['id'])),’style=”width:100%”‘); ?></td>

I replace it with this:

<td><?php echo tep_draw_textarea_field(‘products_description[' . $languages[$i]['id'] . ‘]’, ’soft’, ‘70′, ‘15′, (isset($products_description[$languages[$i]['id']]) ? stripslashes($products_description[$languages[$i]['id']]) : tep_get_products_description($pInfo->products_id, $languages[$i]['id']))); ?></td>

That’s the code that was in the header tags Seo, so that seemed safer to me.

3. At point III you had to edit catalog/admin/includes/functions/html_output.php

I didn’t do that step.  My code looks like this:

$field = ‘<textarea name=”‘ . tep_output_string($name) . ‘” wrap=”‘ . tep_output_string($wrap) . ‘” cols=”‘ . tep_output_string($width) . ‘” rows=”‘ . tep_output_string($height) . ‘”‘;

So I have ‘wrap’ instead of ‘id’. I didn’t see any difference, but made a note for myself, that there  could be a problem.

Troubles/notes

I have to work on the header tags version if I have some time

Screenshots (my site)

(The screenshot is made on Apple, so the Ultrapics/html editor is not visible)

058 Tabedit

Last week I made my second contribution, named Stock Inventory report with export function.

I was looking for a stock report, which can show me the name, Price, Costprice, Quantity, Manufacturer, Model, Status and that I could export to Excel. I installed a lot of contribs, but none of them did what I want. So I tried to change one to give me everything that I need.

For this Contrib you need to have the Contrib Margin report (version 3.00a) installed (http://addons.oscommerce.com/info/1594), otherwise you don’t have poducts cost.

The contrib is based on the old inventory report. But that one just didn’t do what I wanted.

I want to make the contribution bigger with other contribs like Low stock report, Inventory value and have the possibilities to choose: All products, active or inactive.

Installation

Just follow the instuction in the package

I also opened a topic in the OsCommerce forum:  http://forums.oscommerce.com/index.php?showtopic=340801

Screenshots (my site)

The upper and bottom site of the report

057 Inventory report1057 Inventory report2

After all the Contact_us misery, it’s time to add some reports. I first started with Margin report , version 3.00 a. With the Margin report Contrib you are installing a Cost price for your products in you shop. With this Costprice you can count your Margin, but you can also use this to count the value of your shop, at least what you paid for it. More reports are working with the costprice from Margin report, so it’s good to have this installed in your admin part of your website.

Warning: be careful if you copy any code from the blog. It is possible that WordPress breaks the code and that during copying whitespaces or other hidden caracters occur in your files, so always check if your codes look normal

Installation

The installtion is not so difficult, only you have to be carefully if you have contribs installed like Ultra pics and Quantity price break.  You can’t replace all the code without breaking those contribs.

1. catalog/admin/categories.php . When you have to find

if (isset($HTTP_GET_VARS['search'])) {    (and further)

Only add two times after p.products_price :                   p.products_cost

2. The same when it says find:

} elseif ($HTTP_POST_VARS['copy_as'] == ‘duplicate’) {      (and further)

Only add two times:        products_cost      again ater products_price

and one time :  . tep_db_input($product['products_cost']) . “‘, now(), ‘”

3. Find:

if (isset($HTTP_GET_VARS['pID']) && empty($HTTP_POST_VARS)) {     (and further)

Only add 1 time: p.products_cost

4. In catalog/includes/classes/order.php

Be careful, because we’re going to the catalog side and not the admin side anymore.

replace with: $orders_products_query = tep_db_query(“select orders_products_id,     etc. Also here only add products_cost           and              ‘cost’ => $orders_products['products_cost'],

5. the same for the last replacement in that file, only add:                     ‘cost’ => $products[$i]['cost'],

6. In catalog/includes/classes/shopping_cart, at the first point you only have to add:    $products_cost = $product['products_cost'];

And at the second point add:    ‘cost’ => $products['products_cost'],

7. In the last file catalog/checout_process.php only add:   ‘products_cost’ => $order->products[$i]['cost'],

Troubles/notes

1. Look careful where all the lines are added in the installation instruction and place it on the same place if possible. It’s always tricky to replace so much code because other Contribs could easily be killed. Instead of that just check what’s new and put some extra codelines with all the changes you make like // BOF margin report and after the code // EOF margin report. Believe me after some time you don’t know what you changed the year before, so it’s easy to replace code that should have stayed in the files.

2. The margin report adds all the product of your shop to the report. So also all the double ones that you have in multiple categories and all the inactive ones too.

3. If you click on the button export on the right in the report, don’t forget to give the file a name, otherwise it’s not working.

Screenshots (my site)

Products price added to the product info on the admin side

056 Margin report1

Margin report

056 Margin report2

Older Posts »