Archive for July, 2007

AJAX Online Document Store

Tuesday, July 17th, 2007

Here is the code for the simple AJAX online collaboration document store I wrote a while back.

You should just be able to upload it to the document root, edit the header.php and footer.php files to your design and everything should work. If not, try editing it to get it working on your server.

Vaio SZ: Remove or replace the DVD drive

Thursday, July 12th, 2007

About a month after I bought my Sony Vaio VGN-SZ1XP, I nocked it off the desk. It seemed that everything was alright but recently the DVD writer has been failing to write and it doesn’t read some of the old disks I burnt. I decided to get a new drive so off to eBay I went and managed to get one for £30. Bonus.

Unfortunately I couldn’t find out how to actually get in to the damn thing to get it out. Well I figured it out and here it is:

  1. Hold down the F1, F2 and Num Lock key and while doing this, slide the keyboard backwards.
  2. There are three screws holding down the palm rest / mouse pad thing. Undo these
  3. Slide the palm rest towards you.
  4. There’s one screw holding down the DVD drive. Undo this and then slide the drive out.
  5. Put new one in and then repeat these backwards.

If this is helpful, click on an ad!

PHP Script to Import Sexshop365 into osCommerce

Tuesday, July 10th, 2007

As I mentioned in the previous post I wanted to write a script to take the online CSV file from Sex Shop 365 and be able to import it directly into my osCommerce shops.

I’ve tested it and it works fine with my installation. You will have to modify it though as I’ve added an extra field (RRP) and modified the products_price based on this. If you’d like it, you can get the code from this page

PHP Code For Importing CSV Into osCommerce
Latest version for download as .txt file

The script should do the following:

  • Extract top level categories and import into database if not already there
  • Take sub categrories and import into database if not already there
  • Exrtact all products and import main information into products table
  • Add products name and description into products_description table
  • Match products to categories

Someone might find this useful. As per usual - back everything up first! No warranty is implied or given. Do write to me if you much up your database - I enjoy a good laugh (harsh, but for your own good newbies)

Importing sexshop365 CSV file into osCommerce

Sunday, July 8th, 2007

A while ago I decided I wanted to change suppliers from our existing one to Sex Shop 365 as the old one tend to be a bit slow making deliveries and you have to do all the ordering by email. Sex Shop 365 are much better since you can do everything through their site and they’re very good in general.

The only downside is that it means I’ve got to completely recreate the product database. On the up side, sexshop365 have their product range online in CSV format. Luckily there’s this osCommerice contribution that lets you import the CSV into the product database. It doesn’t do everything automatically so I’m going to work on a script to do everything and then put it up.

PayPal IPN Update

Saturday, July 7th, 2007

Well, the guy who ordered of me in the last post has been back on the shop and ordered again and it’s all working now. Only trouble is that I now didn’t get an email from the shop telling me an order had been placed. Luckily I get the emails from PayPal saying I’d received funds so I knew about it.

I’m going to have a look on Monday and see if there’s a known work around or if not, see if I can fix it. If I have to fix it, I’ll post the work around here.

osCommerce & PayPal IPN Invoice Error

Wednesday, July 4th, 2007

I’ve just had an email from a customer about an order through one of our osCommerce run shops saying they had placed an order but when they had gone through to PayPal, they received a message saying

“ERROR DETECTED: This invoice has already been paid. For more information, please contact the merchant.”

I checked PayPal and there was no transaction but when checking in osCommerce the customer had placed an order which appeared to be paid for, After a bit of checking I found out what was causing the problem and the fix as well!

It appears that when using the PayPal IPN, it requires a unique Invoice Number for each transaction which isn’t a problem most of the time. We’ve had a problem because we’re using the same PayPal account (email address) for several shops. Unfortunately since we’re using seperate installations of osCommerce and therefore seperate databases for each, there’s sometimes a overlap of invoice numbers.

Luckily we aren’t the first and you can find the solution on this osCommerce Forums Thread

Modify the Page Title of a WordPress Post

Monday, July 2nd, 2007

I’m by no means a SEO expert but I roughly know what I’m doing and I’ve always thought that the default way WordPress displays the page titles for a post is a bit the wrong way round. A post should be optimised for the content on that particular page as opposed to the name of the blog which should mean that the post name should precede the blog name in the title tag, e.g.

<title>This is the post title » Blog Name</title>

You can do this by modifying a line of code within your header file. Go to:

WP root > wp-content > themes > theme_name > header.php

Open this file and replace the code within the title tags with the following:

<title><?php wp_title(’ ‘); ?><?php if(wp_title(’ ‘, false)) { echo ‘ &raquo;’; } ?> <?php bloginfo(’name’); ?></title>

And that should be it!