Customization (where to start?)

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Customization (where to start?)

Post by keats76 » Wed Mar 05, 2008 7:41 am

Hello again.

I finally took the plunge and purchased AC7! As per some of my earlier posts, I've written a custom .NET quoting engine that I need to integrate with AC7.

Some background:
My customers will make use of a custom Java Applet on the front end to parse their data files. The applet will then generate HTML line items that correspond to information from the files. These line items are then sent to a custom web service for price quoting. A quote is received by the client JavaScript and then displayed as part of each line item.

Whew :)

Now to the good stuff. I would like to have each line item exist like an auto generated product in AC7. I'd then like to offer the client the ability to click an order button that would take them to a one page checkout where they would have their payment details confirmed, and they could then place their order.

Did I forget to mention that I'm still fairly green to .NET development :) I like to think that I've come a long way in the last few months, but there is quite a bit to learn and I find myself rewriting my code quite often, as I'm always finding a better way to do something.

Anyway, enough rambling, could anyone save me some research time, and point me in the right direction? Here are some starting questions:

1) What constitutes an order?
2) Do I need to create a basket to place the order in? Or can my order exist without a basket (as I don't really need one)?
3) Can I create an auto generated product that doesn't have a corresponding database entry? Or should I create a base product in the DB that will represent all of my line items, and then update the description and price on the fly?
4) Also, on a side note, I noticed that the User Profile is pretty limited. Could I add fields to the profile? Would it be as easy as extending the User object and adding some fields for data persistence, and updating some GUI screens etc?

Thanks in advance! I know this is a lot to take in.

Mike

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Post by keats76 » Wed Mar 05, 2008 8:03 am

The API indicates that each user has Profile object. Each Profile seems to have a list of name/value pairs. Could these be used to add new Profile elements?

For example, if I wanted my users to have a new field called "hair color" then I could add a new property name haircolor that would correspond to a value of the same name?

Also, what role do the PersonalizationProviders play in this?

Thanks!

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Re: Customization (where to start?)

Post by AbleMods » Wed Mar 05, 2008 7:45 pm

Mike, I'll offer what help I can...

If you are fairly new to .Net, you will need to bone up fast and hard on data classes. Everything in AC7 is managed through a (surprisingly well designed) collection of data classes and methods.
If you try creating your own records in AC7 tables and rely solely on SQL referential integrity, you will simply frustrate yourself and SQL Restore will become your best friend. That's not a great start to any learning process.

Start by studying existing AC7 page code files and follow how Able stores information. Walk yourself through the Add/Edit product page code first. Every order starts with a product to be purchased.
From there, walk through the code for checkout. That's how an order gets created. Order creation is final sum of many tables, relationships and data classes. It's not simple but it is learn-able.
My best method was to fire up my VWD debugger and pause a checkout process. Then I could examine data classes, methods and current values without the usual time-sink of trial-and-error.
keats76 wrote:1) What constitutes an order?
That's a pretty general question, no answer is really possible.
keats76 wrote:2) Do I need to create a basket to place the order in? Or can my order exist without a basket (as I don't really need one)?
No. You can create a new order data class and just set it's values. Once you're ready, fire the Save() method on the data class to write the order to the table. The basket class is used as an instance holding place for customer-selected products for purchase. You don't need to create one to create an order so far as I know.
keats76 wrote:3) Can I create an auto generated product that doesn't have a corresponding database entry? Or should I create a base product in the DB that will represent all of my line items, and then update the description and price on the fly?
Everything in AC7 is dependent on finding a product record of some kind, so I'm not sure where you're going with this question. If you don't need to save the product record, don't. Data classes can exist in memory without having to be written to disk. I do it all the time, especially when retrieving products or orders for information using a criteria not designed as a method on the data class.
keats76 wrote:4) Also, on a side note, I noticed that the User Profile is pretty limited. Could I add fields to the profile? Would it be as easy as extending the User object and adding some fields for data persistence, and updating some GUI screens etc?
The user profile could be considered limited, but it does include all the basics for managing an online order history. There are several aspects of AC7 where CRM is lacking - those should improve over time.
There is a "custom field" data class tied to the store data class. However I have not experimented with it yet. The Product data class has an awesome custom field subclass, I use it all the time now.
The User class does not have a custom field class that I can see. Your best option would be to build a new table and tie the records back to ac_Users using the UserId value.

Some General Thoughts

Never modify the existing ac_tables. The data classes depend on the existing field structure. In cases where you need additional fields, build a separate table and link it with the (whatever)Id field.

Many, many times there will be a method already in place to accomplish what you want with AC7 data. Whether it's loading all products for a store, pulling in all orders for a specific customer or auto-creating the manufacturer when the product is saved.
Every table has an associated datasource class i.e. ac_Products has a ProductsDataSource class with many useful methods. Studying those next and learning the pattern Able uses will aid you greatly.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Post by keats76 » Thu Mar 06, 2008 6:07 am

As usual, a very informative and well written post!

Thanks for the input, it will help me out quite a bit. I've been looking through the API and I'm pretty happy with the way AC7 has been put together. I just wish there was more documentation to help new developers hit the ground running a little bit faster.

You should start writing all of your knowledge/experiences down ... perhaps AC would pay you to put a Developer's Guide together. It would be a very beneficial addition to the AC7 product (or you could always publish an e-book, I know I'd buy it ;).

Time to do some reading!

Thanks again,
Mike

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Thu Mar 06, 2008 6:20 am

Posts: 941
Thank you for the compliment. The book is written, it's just really, really spread out :D

There's a link in my sig to my collection of complete articles I've written. I'm sure there's some tidbits in there where you could gain some more insight.

Good luck. It's really a neat design, you just have to get the hang of how Able structured it. Once you figure one data class design structure out, the rest of the lightbulbs click on really fast.

I learned almost everything through trial-and-error. Able helped me in a few places when I'd get really stuck, but I don't like to bother them if I don't have to. There's a certain value to the knowledge gained when you learn it yourself that doesn't exist if someone else helps you.

I just started in .Net a year ago. Quite a change from my 20 years of FoxPro development.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Post by keats76 » Thu Mar 06, 2008 7:06 am

I come from the Java camp myself. I was at IBM for the last 8 years or so, but I found myself on the road way too often. My wife and I had our first child (Isabella) about 2 years ago, and I missed a good bit of her first year.

That was enough of a wake up call for me. I'm at a new company now, and they're a .NET shop :). I've found that C# is pretty much Java with a few tweaks (not even sure why J# exists ... don't get me started on MS). Anyway, I've been pretty impressed with how easy it is to get up and running on .NET. Microsoft has a very robust platform and has a small barrier to entry (for Java developers at least), but that ease of use comes with a price (i.e. performance). There is a lot of overhead in .NET, and I think that is what is going to take me the most time to track down (i.e. when to use ashx files to bypass unnecessary processing etc).

I must admit though, .NET allowed me to create my very first web service, and communicate with it via AJAX in a matter of a few days. That's no trivial feat. All I have to do now is determine if the performance is acceptable :).

Thanks again for your input. I'll check out the articles, and I'm sure I'll be posting in the forums pretty regularly until I'm on to my next project.

Thanks, Mike

P.S. -- I'm not much of an outdoorsman, but I promised my daughter I'd take her fishing this summer, so I'll look into some fishing times when I figure out where we're going ;).

User avatar
jmestep
AbleCommerce Angel
Posts: 8164
Joined: Sun Feb 29, 2004 8:04 pm
Location: Dayton, OH
Contact:

Post by jmestep » Sat Mar 08, 2008 7:49 am

My best method was to fire up my VWD debugger and pause a checkout process. Then I could examine data classes, methods and current values without the usual time-sink of trial-and-error.
Can you give the steps for doing this?
Thanks
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Sat Mar 08, 2008 8:40 am

VWD allows you to attach a breakpoint to any line of .Net code as long as the source file is available.

Just edit the checkout.aspx page and put a breakpoint on the first line in the Page_Load() section. Then start the VWD debugger using the little green arrow-thingy.

Once your site loads, add something to the cart and click checkout. The page will stop and VWD will become active again.

In VWD you now have an "Immediate Window" that you can use to examine variables, etc. All the variables, methods and classes are exposed to the immediate window, the Watch window and Locals window.

You can step through the .Net code one line at a time, dive into subroutines and see their code too...it's quite robust.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Post by keats76 » Tue Mar 11, 2008 5:24 am

What are your Visual Studio settings under the Menu item (Website -> Start Options)? Do you have it set up to use the "Current Page" and "Default Web Server" or are you specifying the use of the IIS server that is hosting the site?

I can start up the debugger with AC7 and VS2005 just fine, but I can't get any pages to load, and every breakpoint I set says that it is invalid and that no symbols are loaded.

The debugger wants to start AC7 under an internal copy of IIS with a random default port. I think this may be the problem, but I'm not sure.

Thoughts?

Thanks,
Mike

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Mar 11, 2008 5:46 am

I access my project via the Local IIS method, so IIS is used for debugging.

To my knowledge VWD will only allow the internal web server debugger when the project is opened via local file system.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Post by keats76 » Tue Mar 11, 2008 5:58 am

So when you debug, you have a new copy of IIS that opens with a randomly assigned default port. Then when you access the debug copy of the website, the URL looks something like (http://localhost:9123/). Is that correct?

I guess the licensing structure knows that the copy of able that is in use is a developer copy and that it can be accessed in such a manner. When you open up your CommerceBuilder.lic file does it list "localhost" as the domain or is it using the ip of the development machine (see below).

<domains>
<domain>XX.XX.XX.XX</domain>
</domains>

Thanks again!
Mike

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Mar 11, 2008 6:10 am

There are two ways to debug in VS so far as I know:

1. Using the local IIS installed on your Windows PC.
2. Using the included ASPX page emulator web server provided with Visual Studio.

If you open your project using "Local IIS", it will debug using your IIS web server and the popup on your taskbar never appears.

If you open the project using "Local File System" and browse to a folder on your C-Drive, then VS assumes no IIS is installed and will fire the integrated ASPX page emulator.

I'm no expert on this stuff, but that's how it works on my computer.
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

keats76
Commander (CMDR)
Commander (CMDR)
Posts: 117
Joined: Sat Dec 15, 2007 4:45 pm

Post by keats76 » Tue Mar 11, 2008 6:50 am

OK, something must have been hosed with the initial project that I had created. I created a new website project. I selected HTTP as the protocol and I pointed it to the ip of the development instance. I selected the language as C# and then I clicked on done.

The project was created successfully, it built just fine, and I am finally able to debug!! Thanks for letting me vent :)

Now it's time to get my hands dirty!

User avatar
AbleMods
Master Yoda
Master Yoda
Posts: 5170
Joined: Wed Sep 26, 2007 5:47 am
Location: Fort Myers, Florida USA

Post by AbleMods » Tue Mar 11, 2008 7:09 am

I think that's what I'm going to have to do - I think my project is corrupted somehow :?
Joe Payne
AbleCommerce Custom Programming and Modules http://www.AbleMods.com/
AbleCommerce Hosting http://www.AbleModsHosting.com/
Precise Fishing and Hunting Time Tables http://www.Solunar.com

Post Reply