Archive for the ‘osCommerce’ Category

Delivery Time in osCommerce

Friday, February 26th, 2010

The other day, I was asked about the possibility of including a time selection field in the shipping page of an osCommerce site. A typical example would be a delivery service such as a flower shop.
This is very alike my previous code for selcting a delivery date which works well. Basically, all I [...]

Read more from the original source:
Delivery Time in osCommerce

Password Masking osCommerce

Sunday, February 21st, 2010

Quite a while back, I was part of a discussion on a forum (not the osCommerce forum) about Jakob Neilsen's ideas on password masking. You can read Mr Neilsen's thoughts here).
My idea was that his thoughts are valid, and are based on usability. My opinion is that 90% of users don't need to [...]

Read more:
Password Masking osCommerce

Unique Product Models in osCommerce

Saturday, February 20th, 2010

Quite an interesting task to set up a method to easily allow the Shop Owner to see if a model name for a product has already been used whilst adding a new product.
This type of checking is done a lot for usernames in forums and blogs etc. With a bit of thought, it's easy [...]

More:
Unique Product Models in osCommerce

More Image Swapping in osCommerce – mouseover

Monday, February 15th, 2010

Interesting site build the other day for a client, who wanted a cleanly coded way to upload multiple images per product, then have them change on mouseover of a thumbnail.
To enable this, I had to change the admin/categories.php file to alow an extra 7 images in addition to the existing one. That was painless [...]

More here:
More Image Swapping in osCommerce – mouseover

Two prices per product in osCommerce

Sunday, February 14th, 2010

Had an interesting puzzle presented to me the other day. Basically an osCommerce store owner wanted to have two prices of products. In other words;
- the standard price
- a “friends and family” price (% reduction)
My idea was to simply use a Coupon Code to get the % reduction, then amend the display_price to [...]

Originally posted here:
Two prices per product in osCommerce

More new goodies in RC3 osCommerce

Saturday, February 13th, 2010

Looking at the up-to-date version of RC3, and I spy more new things;

Ability to change the admin directory name as part of the installation procedure:

We've all seen the recent eval problem that has been doing the rounds. Changing the admin directory to a completely random name is a great way to help guard against this. Would be nice to have a “make random name” button here. I might code that up later.

Admin access attempts are now part of the new Action Recorder feature:

and

I previously blogged about the Action Recorder here. You can see that we can now set the number of access attempts and number of minutes between login attempts.

Warning about configure file being writable is now also in the Admin Area:

This should help to make users more aware of what they need to do “next”!!

File manager has now gone:

We all know that the File Manager was a risk, not only because of the recent round of hacks but also because it broke files when saving them. Removing this is a great move.

There's more stuff, which I'll blog about again later.

The rest is here:
More new goodies in RC3 osCommerce

Open Source is all about choice

Wednesday, February 10th, 2010

Josh commented;

First, thank you for the original 1.12 contribution [of discount coupons]. It is a very simple, and very easy to follow install. I have been reading for hours all over your site, mostly about the contribution, but I tend to go off on tangents when I see other topics of interest (like the trademark issue).

Anywa, like I said, I've been reading about your contribution all day, mostly on your site. What I don't understand is your attitude (please don't take offense, it's the only word I could think of) towards sharing your code. I consider myself an intermediate php programmer, with intermediate oscommerce skills and knowledge (far from advanced on both accounts), so I don't understand why you keep telling people “I have new great code, and you can buy it, but only if you give me access to your installation and let me install it myself, I will not let anyone else install it.”

The only thing I can think of is that it's a support issue and you don't want to answer the hundreds of questions that are bound to follow when you give someone the code and let them try to install it. But I'm with Tai Kahn when I say that I would not want you (or anyone else) installing anything into any of my websites. You made a (what I took as, sarcastic) comment to him (above) saying “when you are ready to start trusting, come back”, but I think that's a poor attitude for someone who keeps mentioning “paying projects” in many of their blogs (and comments).

If someone like Tai or myself were willing to pay you the same rate that you're charging to do the install, for simply emailing us the code, why would you scoff at that? Why can't you simply make the sale with the simple condition that you will not offer any help installing it? I'm sure if the new contribution is as easy to install as v1.12, you wouldn't hear any more than “thanks” from people who are confident that they can install it themselves.

Now, instead of just buying your code, I'm going to have to take hours to modify v1.12 code to do what you've already written. If this was an issue of money, I could understand, but it doesn't seem to be, so I really don't understand your point of view. Can you please explain it to me (and everyone else who reads this? In fact, I think this would actually be worthy of getting it's own blog topic. I'm sure you have many readers who don't read every blog and all of their comments, so making this a new blog topic would make it visible to everyone.

Again, thank you for the original contribution that you were actually willing to share.

Josh, no offence taken, and I hope you will not take offence at my answer and understand my viewpoint…

Open Source is all about choice. I'ts my choice to relese code in any way I see fit. As you already know the v1.2 is a very simple install – yet I get between 5 and 10 support requests daily…if I go on to release a codebase that is 5 times bigger and harder to install, how many support requests might I get? 20 per day, 30? It's not viable for me to even look at so many emails…

So, that brings me to YOUR choices. You choose to disallow me access to your shop admin, and that's OK! Your choice therefore is to use a different discount system, or to use the v1.2 as you already are and update it – that's great – would be better if, after you update it, you then contribute it back to the community and support it.

You may have noticed that my contribution total stands at around 40 to 50 – guess how many people have actually emailed me over the past 10 years to say “hey thanks for contribution XYZ, it really helped me”. You could count the number on the fingers of 1 hand. But that's unimportant and is a side-issue. Many more people have thanked me for taking the time to install and support after payment!

As you rightly say, it's not about the money – $50 doesn't come close to covering my time to install and support, but it sorts out the people who are serious about their business, compared to those who are not.

So, my choice is to release this only with installation.
And your choice is to accept that, or not.

It seems a fair and equitable way to make the vast majority of people realise that Open Source does not mean Free.

Originally posted here:
Open Source is all about choice

Image Swapping based on attributes in osCommerce

Sunday, February 7th, 2010

I was tasked by a customer to create some sort of image swapping device for a tshirt store. With some thought my idea was to use a piece of javascript based on the attribute selection which updates the image.

Then my customer decided he only wanted to upload 1 image rather than multiple images.

In the end I decided to do it in a different way, using only 1 image, can you guess how? Here's a video;

Read more here:
Image Swapping based on attributes in osCommerce

Only 1 product at a time in osCommerce

Monday, January 25th, 2010

Over at the official osCommerce forum, someone asked about the possibility of only allowing a buyer to select 1 of each product.  My answer was to amend the display of the shopping cart and the shopping cart class…

It’s fairly easy.  What I am going to show you is amending the display using HTML and CSS, then a bit of PHP code to only add 1 of a product in the class file.

Step 1:  Make the quantity box readonly and look nicer.

As someone who has done a lot of HTML over the years I know that the attribute called “readonly” makes an input “read only”!  So I add this to the shopping cart page.  Open up shopping_cart.php and find

PHP:

  1. ‘text’ => tep_draw_input_field(‘cart_quantity[]‘, $products[$i]['quantity'], ’size=”4″‘) . tep_draw_hidden_field(‘products_id[]‘, $products[$i]['id']));

Change it to:

PHP:

  1. ‘text’ => tep_draw_input_field(‘cart_quantity[]‘, $products[$i]['quantity'], ’size=”4″ id=”clubosc” readonly=”readonly”‘) . tep_draw_hidden_field(‘products_id[]‘, $products[$i]['id']));

You can see that I have added the readonly attribute and given it a css ID called “clubosc”.

Step 2:  Amend the look of the box using .css

Open up stylesheet.css and add this code;

PHP:

  1. #clubosc {
  2. border: none;
  3. text-align: center;
  4. background: transparent;
  5. }

Add something to the cart and your quantity box now looks like this:

Whereas the usual look is like this:

Now, because we have made the contents of the quantity field readonly, we have to ensure that not more than 1 product can be added. At the moment a buyer could return to the product page, and click “buy” again, ending up with 2 of the same item in his cart.

Step 3: Making only 1 buyable…

Open up /includes/classes/shopping_cart.php and find this line of code:

PHP:

  1. $this->update_quantity($products_id_string, $qty, $attributes);

More osCommerce Breadcrumb funkiness

Thursday, January 14th, 2010

I really wanted to try out a menu system that I found online, in osCommerce. The menu system is the one at Izzy Menu…and integrating it into osCommerce was fairly simple.

The code from the Izzy site is quite straightforward, so I simply used it on the breadcrumb osCommerce function. You can see the results in this video;

It looks pretty good and (as far as I recall) only needed changes in one osCommerce file and the stylesheet,as well as moving the breadcrumb to the top of the header.php file. I’ve tested it in Firefox and IE8 and it seems OK.

Original post:
More osCommerce Breadcrumb funkiness