A Cartweaver user asked how he can add alternate pricing to his Cartweaver ecommerce site. He was understandably concerned about the need to edit the database, and how much code editing might be involved. But if you take a systematic approach, it is pretty straightforward.

The first part of setting up any alternate pricing system is to get that info into your database and admin, so you can work with it. In this case, since the basic goal is to duplicate the existing 'price' system, that is exactly what we are going to do.

Here's what to do... First, make a backup copy of your 'admin' directory just to be safe (backing up your work is always step 1!).

Next, you'll need to add exactly ONE column to tbl_skus - open it up and add a new column, however you administer your database ( I highly recommend mySQL and navicat ) - call it SKU_AltPrice .

Then, using your editor's 'global search' feature, search the entire CW3/admin/ folder for any instance of "SKU_Price". Working from the search results, wherever you see that variable, you are going to simply add your own.

There is a bit more to it, but not much:

in a SELECT query, you'll just add a comma after SKU_Price, and then insert SKU_AltPrice

in an UPDATE or INSERT query, you'll just insert a new line, following the pattern you see for SKU_Price.

in a FORM, you'll just duplicate the input named SKU_Price, along with any surrounding html, and then change the name, ID, and any other instance of 'SKU_Price' to 'SKU_AltPrice' in the duplicated code

see where this is going?

Just follow the pattern of SKU_Price wherever you see it in the admin, and you will be well on your way.

( There is also some html editing involved - if copying a form input, you'll probably want to also duplicate the containing table cell or row, as well as make a new in the header row - but again, just follow the pattern of what you see... and when you're done you'll have another bit of data in your sku forms! )

Once you are managing the new price info in your admin, showing it on your display page is even simpler. Using the same method, search for "Sku_Price" in the display includes, and add your "#SKU_AltPrice#" where you want it to appear.

Of course, additional logic is required depending how you want to show this info. In many cases it is simply an 'msrp' price, shown in a different color or font size, in which case, you would be done! Other options involve showing one price or the other depending on the customer's account type (wholesale/retail), or showing the alternate price on certain groups or categories (with another field added to the admin to turn this on or off). Lots of possibilities!