Ikool’s Blogbed

Fix of unable to update Product details in WP e-commerce

After playing with WP e-commerce for sometime and fixing some issues (see Incorrect URLs for images, css and js files in Products page of WP e-commerce plugin, Fix of Settings menu on WP e-commerce‚Äôs Products admin page and Tips on display categories in WP ecommerce), I am able to display products and categories. But I also notice an issue which is users can’t really update product details such as product name, description, product tags, and price and stock control after a product is added.

Let’s take a look at what the issue is. If you check your apache log for your site, then you will notice there is an error message regarding the update SQL query statement used to update the product details as shown below:

[Tue Jun 18 12:11:34 2008] [error] [client IP-ADDRESS] WordPress database error Incorrect integer value: '' for column 'brand' at row 1 for query UPDATE `wp_product_list` SET `name` = '9113 - Retractable ball pen', `description` = 'Plastic retractable ball pen', `additional_description` = '', `price` = '0.70', `pnp` = '', `international_pnp` = '5', `brand` = '', quantity_limited = '0', `quantity` = '0', `special`='0', `special_price`='', `display_frontpage`='0', `notax`='1', `donation`='0', `no_shipping` = '0' WHERE `id`='1' LIMIT 1 made by include, referer: http://blog.sdu2.hyperion.com/wp-admin/admin.php?page=wp-e-commerce/display-items.php

The error specifically points out that database error Incorrect integer value: '' for column 'brand' Continue reading

June 24, 2008 Posted by | How Tos, Wordpress Tips, WP E-Commerce | , , , , | 11 Comments

Tips on display categories in WP ecommerce

There are a few ways to enable WordPress e-commerce plugin to display categories. Some of them are not so obvious to be noticed. Well, you have to bear with that since it’s open source world, what can you expect more. Most of the time we have to dig into the code to figure things out. And I am hoping my finding will help someone else out there. My environment (Windows XP, WordPress 2.5.1 and WP e-commerce 3.6.6) may be different from yours, therefore, the tips here may not apply to yours and you have to use your own judgement, but you may still learn something useful here though. Keep on reading.

Tip #1: Add [showcategories] to your post or page wherever you want it to go, WordPress engine will figure out how to replace this by the corresponding product category list

Tip #2: Calling nzshpcrt_display_categories_groups() function directly. This function is defined in products_page.php. There are a few references to it in this release. Here are:

wp-e-commerce\products_page.php(45): function nzshpcrt_display_categories_groups() {
wp-e-commerce\products_page.php(101): echo nzshpcrt_display_categories_groups();
wp-e-commerce\products_page.php(167): echo nzshpcrt_display_categories_groups();
wp-e-commerce\wp-shopping-cart.php(2015): $output = nzshpcrt_display_categories_groups();

Line numbers may be off a bit, so in this case you will need to just look around. It should not be a big problem

Tip #3: Calling show_cats_brands() directly. Well, this is the core to showing categories. You definitely need to take a look at this function if your changes won’t work. This function is defined in show_cats_brands.php, and here is the signature:

function show_cats_brands($category_group = null , $display_method = null, $order_by = 'name')

June 23, 2008 Posted by | How Tos, Wordpress Tips, WP E-Commerce | , , , , , | 8 Comments

Tips on speeding up WordPress Admin’s Dashboard

You may notice that WordPress shows error messages in your WordPress dashboard saying timeout if you host your own WordPress somewhere, that’s because your PHP socket timeout is set too low, mine is 60 secs which is big enough. You may also be aware that you don’t really look at them(Development blog, Incoming Links, Developers news, and WordPress plugins) most of the time. Originally I thought to just remove/comment out some of code related to dashboard but I recall there is a plugin which just does that for you. So I did a search in wordpress.org and found that it’s wordpress-dashboard-editor.

And I installed it and tried it, and it works fine. And I love it, thanks Aaron Harun for the great plugin, here is the description of this plugin:

This plugin allows you to add whatever you want to the WordPress dashboard through PHP and HTML even Sidebar Widgets. You can also wipe the entire dashboard or individually remove some of the more irritating sections like the Dev news, Planet WordPress and the getting started section.

Continue reading

June 15, 2008 Posted by | Wordpress Plugins, Wordpress Tips | , , , , , , , , , , , , | 1 Comment

Tips on speeding up load time of WP e-commerce plugin in Admin Panel

I have to say WP e-commerce solves a big problem for so many of us who want to set up an online shopping site. It’s so lovely to have it around. But I have to admit that accessing e-commerce menu in administration panel is a headache, especially when web server is on a slow network. Therefore, I try figuring out how to speed it up. Here is what I noticed:

  1. The plugin tries to load feeds from http://www.instinct.co.nz/feed by making the following call (display_log.php):

    You can just comment out this line if you want. This works for me in my development environment.

    Continue reading

June 14, 2008 Posted by | Wordpress Tips, WP E-Commerce | , , , , , , | 1 Comment

Compatibility issue of Thickbox and jQuery in WordPress when both NextGen Gallery and WP e-commerce present

Both jQuery and Thickbox have different versions, and WordPress and its plugins may use different versions of jQuery for different plugins since plugin engineers basically work on their parts without paying much attentions to others’. I checked my installation of WordPress 2.5.1 and it has jQuery 1.2.3 and Thickbox 3.1. However, when you install other plugins which might use a fairly new jQuery such as 1.2.4, what happens in this case is they conflict, some of the features may not work at all, such as Fix of issues with old version of jQuery in WordPress 2.5.1 when using FeedWordPress. In the case of having both NextGen Gallery and WP e-commerc, you may even see what I saw as depicted in this image. The problem gets even worse when the plugins are using Thickbox because different versions of Thickbox will only work perfectly with their corresponding versions of jQuery:

Continue reading

June 14, 2008 Posted by | Wordpress Plugins, Wordpress Tips, WP E-Commerce | , , , , , , , , | 9 Comments

Tips on how to reduce the loading time of NextGen Gallery in WordPress Admin Panel

First of all, I’d like to say that I am very happy with this plugin, and it’s a very ambitious photo gallery software having many nice features and many of us like it very much, thanks the team for doing such a great job.

Indeed it has some issues, for example, it’s painful when you have to wait for the page to be loaded from internet after clicking on “Gallery” menu, especially when your server has a slow internet access or even when you are trying it from your local machine. What NextGen Gallery does after you click “Gallery” menu is that it tries to check for a new version and load some messages. It depends on the speed of your server’s internet access, it may take fairly long to do, especially when you are working on some of the features of it. I figure out a way to temporarily disable it(not completely remove it. I am not sure if it’s good but at least I don’t have to wait for some time after clicking the menu). Continue reading

June 13, 2008 Posted by | Wordpress Tips | , , , , , , | Leave a comment