Category View: Grid or List?

In the ongoing project that I am working on, the client decided that he would like the ability to choose how each category displays; whether it be a “grid” view, or a “list” view…

There are a few older forum posts about this, and some sites have some good examples of something very close in action. A typical example is Matts site (example category page) where the user can change the view from list to grid and vice-versa.

We needed something slightly different, as we need the Admin to decide the correct view and then not have the ability for the user to change it.

Admin
Has the ability to choose how the category is shown. If “list” is selected (which it is by default), then the usual osCommerce product_listing modules is shown. If “grid” is selected, then a new coded module is shown.

Shop “List” view

Shop “Grid” view

It’s a pretty good idea, as sometimes it is better for the end-user to have the available information presented in a different way. Whatever is better for the end-user is usually better in terms of the shops’ bottom-line !!

System for assigning products to specifications

Currently working on a modification that allows the shop owner to easily add new “specifications” and then assign products.

A typical use for this would be in a clothes shop. Sometimes clothes come in men, women, unisex. My new system would give the ability to have these specifications set out like the manufacturers are, and show products in that way.

It’s kind of hard to explain, so here’s a few images;

Adding the Specifications

Assigning Specifications to Products

The Specifications Menu

which shows the products in that specification..in the usual “product listing” style;

The Specifications Reminder box

When looking at a product that has a specification, the specification image shows for all the specifications attached to the product!

Pretty nifty modification, which seems to work well. I know there are a couple of similar things floating about, but none of them suited the clients needs, as I will (in the future) need to integrate some older custom code into this – therefore it is easier (and cheaper!) for me to make this from scratch than try to work with other peoples contributions.

More uses?

Perhaps this could go really well to show ratings for DVDs and Bluray – U, PG, 12a, 18 and such. Or maybe for a Pet shop that has products that can be used for many animals, this product is great for rat, gerbil, mouse…

Pretty much any shop that sells an item that is usable for more than 1 use, I think this mod would be good for.

Minimum Items to Checkout

Was contacted recently by someone who wanted the ability to define a minimum number of items in the cart to allow checkout. The answer to this is very simple; in checkout_shipping.php, use $cart->count_contents() and link that to a tep_redirect back to shopping_cart if the number is not big enough;

if ($cart->count_contents() < 5) tep_redirect(tep_href_link(FILENAME_SHOPPING_CART)); So, if there is less than 5 items in the cart, they cannot progress through the checkout. Then I got to thinking. What about if the shopowner wanted the buyer to have at least 5 different items in their cart before checking out? Again, something similar, but instead of using cart->count_contents(), use $cart->get_product_id_list()

I thought that something like this might come in handy one day, so I set out to make it. Within an hour I had the basics in place;

Admin

This shows the three options that I coded;

Minimum Items.
“What is the minimum number of items to allow checkout”. If the shopowner inserted the number 3, then the buyer would be forced to add at least 3 of EACH product to his cart.

Minimum Items (Overall)
“Minimum number of items per order overall to allow checkout”. If the shopowner inserted 5 here, then the buyer would need to have at least 5 products in his cart in order to checkout. These 5 could be ANY combination; 5 of the same product, 5 different, 3 of 1 and 2 of another and so on.

These also work in conjunction with each other.

So, let’s say that “minimum items” is set to 2, and “minimum items (overall)” is set to 6. Logic would say that the buyer is forced to buy at least 2 of any item, but 6 overall, thus:

What the buyer could do is purchase 6 of 1 item and this would be OK as it satisfies both the “minimum items” and “minimum items (overall)” rule;

Or the buyer could purchase 2 of 1 item and 4 of another (as this also satisfies the rules);

Let’s take an example that at first glance appears to satisfy the rules; (eg, 2 of 1 product, 3 of another product and 1 of another) – this will not complete checkout. The example breaks the “minimum items” rule, but satisfies the “minimum items (overall)” rule;

Minimum Items (Different, Overall)
“Minimum number of different items allowed in order” – this number signifies the amount of DIFFERENT products that the buyer is forced to purchase!

So, keeping the previous example (2 of 1 product, 3 of another product and 1 of another), and setting the “Minimum Items (Different, Overall)” to (say) 4…this will fail TWO rules. As we have only 3 products in the cart -> failure of “Minimum Items (Different, Overall)”, and as we are buying only 1 of a particular item -> this fails “Minimun Items”;

Let’s correct the order to satisfy all of the rules;

We now have;

  1. At least 2 quantity of each product -> satisfies “minimum items” rule
  2. 9 quantity being purchased -> satisfies “minimum items (overall)” rule
  3. 4 products being purchased -> satisfies “minimum different items (overall)” rule

Using a mixture of these three rules, enables the shopowner to have really good flexibility with what is being sold.

Typical “rule failure” example

This cart breaks all three rules and so there are 3 error messages. The shopowner can change the error messages to make them more flowery or understandable for the buyer.

Barclays Pingit Payment Module for osCommerce

Earlier today, Barclays bank launched a new “payments via mobile phone” service called Pingit. You can read about it here and here. And the official Barclays page here.

Seems like an ideal way to accept small payments for small businesses and personal use. Might force the likes of Paypal and all those other assorted payment processors to come up with some more realistically priced offerings.

A module for osCommerce

Anyway, I came up with a very basic Pingit Payment Module for osCommerce. It’s at http://addons.oscommerce.com/info/8345 and is released on the basis that it is v1.0 and so is highly likely to change over the coming weeks and months.

Installation

Is super simple. Just add it as you would any payment module. Then edit it to add your mobile number and the max amount you would want to accept per order.

In use

If the order value exceeds your “max amount” then the payment module does not show. If the payment module is available, and the buyer chooses to use it, then they are asked for their “pingit” mobile number on the checkout_confirmation page.

and

This number is written to the order_history and can be seen in the order details page in admin. This allows you to tie up the order to the pingit amount that you receive from that mobile number.

It’s all straightforward. It’s a very basic implementation, and you use at your own risk. If anyone who does use it needs changes, I can quote to make those changes if you cannot manage to make them on your own.

Update all currencies by CSV

osCommerce comes with a built in currencies updater which is operated manually and gets rates from “oanda” and “xe” – both of which are well known currency converter sites. In addition, it is possible to manually update the currency rates one by one.

For some sites, it is desirable to update prices 10 times or more each day, and to do this manually is a chore, especially if the shopowner has multiple currencies. For example a site selling gold. The price of gold fluctuates wildly day by day, even hour by hour!

I was approached by a client who wanted a CSV input box which would allow them to update all their currencies in one go. So, they would input something like:

USD:1,EUR:0.8,GBP:0.9

Then press “update”, and all of the currencies are updated in one go. This saves a massive amount of time daily.

The end result:

And Video: