brettbrewer.com

Programming + Design

Home arrow News arrow X-Cart arrow Developing a Manufacturer Coupon in X-Cart
Developing a Manufacturer Coupon in X-Cart PDF Print E-mail
Written by Administrator   
Monday, 10 September 2007
Keeping with my tradition of neglecting my studies in favor of paying work, I haven't done any Flex 2 work since completing 90% of the "Total Training" Flex 2 course and I haven't finished studying for the Zend PHP 5 Certification exam which I'm supposed be taking this Thursday when I attend the PHP|Works conference in Atlanta. Instead I've been focusing on building my freelance web programming business and have been doing a bunch of work on X-cart for several clients. I recently started advertising my x-cart services on the x-cart forums and I've been pretty amazed by how much work there is out there for competent x-cart professionals. I've started working with several clients on customizing their carts and am working with one of the major commercial mod developers on some of their projects.  

Recently I was asked by a client to modify their coupon system in X-Cart 4.0 so that they could create "Manufacturer" coupons in addition to the standard coupon types. Since I recently made the leap from the 3.5.x branch to the 4.1 branch for a new site I'm developing called  trainerexpress.com, I figured I'd just go ahead and develop the mod for a stock version of X-cart 4.1, then set up a copy of my client's site on a local test machine where I could backport the mod to his heavily modded 4.0 store without affecting his live store until testing was complete. Easier said than done!

I budgeted 4 hours for the job. It took about 4.5 hours to do the mod from scratch in my local X-Cart 4.1 install, including implementing all the coupon options such as whether coupons should be applied multiple times for products with quantity > 1, etc. Then came time to do the mod to my client's store. I ssh into the remote server, compress the site, download it to my local server, dump the remote db to a local file, then start setting it all up on my local server. After 20 minutes I'm ready to start testing on the local copy of the site, so I open up the local site address and am greeted with various messages about their X-Cart extensions not being licensed for this IP address. Some are encoded with IONCube, some with proprietary obfuscation. I install the IONCube loaders on my server, then I tried various things to work around the licensing problems, but finally decided that I had already wasted enough time getting the test site set up and that I should just implement the code on the live site to keep from blowing my budget all to hell since I'd only budgeted 4 hours for the job and I had now used over 5 hrs.

So I talk to the client and tell him what's going on and he agrees to let me directly implement the mod on his live site, which is not a problem for me, but usually scary for the client. I tell him I think it will take another hour and I'll let him know when it's ready at which point I'll turn off the store, implement the changes and reactivate the store. So I start looking at the x-cart 4.0 coupon code and discover that it is quite a bit different from the new 4.1 version, but after some analysis, I'm able to get it backported in about 1.5 hours. Or so I thought.  

The client had warned me that they had their coupons set up to apply to the price of the product including the European Value Added Tax (VAT). Being a stupid American, I've never done any work with the VAT system in X-cart, but I assume it's handled separately from the coupon system and that any coupon mods I make will automatically jibe with the tax system since the other coupon types don't do anything special to account for taxes either. Normally, this would all be true. Unfortunately, the client had some previous mods done to the site which change the default behavior of the "percentage" coupon type and after having the client test my new mod he informs me that it's not working right. After some further explanation from the client, and some failed "quick fixes", I resign myself to the fact that I've completely blown my budget and I will just have to eat a bunch of time to get this working right on X-cart 4.0. Fortunately, it's not a blown deadline situation and the client is understanding with the delay which is caused in part by their previous customizations. I tell the client it will be working when he wakes up, even if it takes me all night. Four hours later I finally solve the underlying problem and get the mod working up to the client's expectations. I email the client to let him know it's working and then watch an episode of Star Trek Voyager before drifting off to sleep, hoping that in the morning I will have a message from the client telling me all is well.

Morning comes. The client email arrives. All is well. The client is happy. I breathe a sigh of relief.  

Overall, this was a frustrating, but educational experience. It didn't go as smoothly as I'd hoped, but it did give me the chance to get some experience with X-Cart's VAT system and allowed me to prove to the client that I stand 100% behind my work. If there's a problem with any of my code, I will not rest (within reason) until the problem is fixed. Even with a seemingly simple x-cart mod such as this one, things can go wrong and complications can arise, but a good developer will stand behind his/her work and do whatever it takes to keep their customers' web site running smoothly, even if it means eating a few billable hours or staying up late.

Slowly, I'm learning to add some incedental time to my job estimates. I guess I'm just too much of an optimist when it comes to estimating my development time. I've heard that some developers do their estimate and then double the final time estimate to account for all the unforseen circumstances that ALWAYS seem to arise on any new project. Given that my last two job time estimates were off by about 50%, this seems like an increasingly prudent choice, though I'm sure I'll lose some business if I implement it. For now, I'll probably just start revising new estimates by 30% and see how that works out. I'm afraid of having clients balk at 7-hour estimates for a simple mod, but I'm starting to think it would be better to overestimate and then maybe have the chance of coming in under budget instead of always cutting it so close. I'm hoping this process of estimating time will get easier as I do more freelance work. 

 
< Prev

Search


Brett highly recommends...

Get Your War On: The Definitive Account of the War On Terror 2001-2008

My favorite comic is getting ready to be relased as a single volume. You can preorder now. If you hate the war and love to laugh, do yourself a favor and order this. You can also read all the GYWO comics online for free here.

BBS The Documentary

This is by far the most comprehensive and entertaining documentary I have ever seen regarding the early BBS system. If you're serious about knowing your internet history, or you just want some extra geek-cred, this is your new favorite documentary.

The Nada Chair "BackUp"

The best alternative I have found to overpriced ergonomic office chairs, especially for very low pain around the sacral joint. Works better than my Aeron chair ever did. Also, it comes in navy blue and black, in case you're not into the whole pregnant woman aesthetic (pictured).It's really not meant for sitting on the floor, it's really better for seats that offer poor back support, and works great at sporting events to make sitting in bleachers much more comfortable.

Antec Quiet PC Case

At just under $120 including a 500 Watt power supply, this "quiet pc" case has worked great for me for over 2 years. In fact I now own two great Antec cases/PSUs. For the money, it's hard to beat this combination.

© 2009 www.brettbrewer.com
Joomla! is Free Software released under the GNU/GPL License.