Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

School me on order total modules


ryos

Recommended Posts

Hi there osCommerce community,

 

I'm creating an osCommerce shop that has very unusual pricing needs. The stock pricing engine wasn't built for shops like mine, nor was it practical to try and extend it, so I've written my own replacement for it. I have a PHP class that computes and returns the price for a given product, and I now must integrate it into the checkout procedure. (We already have a solution for the catalog and shopping cart price displays that involves AJAX, but that naturally won't do for the checkout procedure for security reasons.) This is where I'm hoping you good folks can save me some time.

 

My suspicion is that I need to write an order total module that calls my pricing class, but I'm not sure how. My questions fall into two categories:

  1. How do I write an order total module? I couldn't find any documentation, and the code isn't commented at all anywhere. I could figure it out by reading the code and experimenting, but if someone here could point me to some documentation that would save me a lot of time.
  2. What exactly do order total modules do? Do they provide the subtotals to the customer during the checkout procedure? Do they provide itemized price lists or just a total? Are they the ones in charge of storing the final, "official" price in the database? Do they communicate the price to payment modules? Again, the architecture of the whole checkout, payment, order processing and fulfillment process is somewhat opaque to me. If someone could help me out on this it would again save me a lot of time.

Thanks in advance!

I say not to you, "backup your files before you change them." I say, rather, "use Subversion, and never worry about ruining your files again."

Link to comment
Share on other sites

Dunno if there is some documentation about the order total modules.

 

Basically the order total modules are for final calculations of the order. They have nothing to do with the products pricing or payment. Payment is done by the payment modules, which are classes too.

 

The OT modules are adding taxes, shipping fees, handling fees, insurance and what not to the order. All the things that belong to the order and not to the products. Those values are stored in the orders_total table in the database. When processing an order later on, they can be retrieved from the table without having to recalculate them again.

 

Hope that helps. If you have furter questions, feel free to ask.

Link to comment
Share on other sites

Thanks for the reply!

 

So...here's the deal. I don't need the OT module to do shipping, since it is product-dependent, and neither we nor the customer has any choice as to what service is used, so I just build the shipping into the price of the product. I think we only need to add tax for one state, since we operate out of a home office. We also don't have shipping insurance. So, do I need a custom order total module? Or can I just plug my pricing into the default and let it do its job?

 

Again, I could find these things out by code inspection, but if you know the answers off the top of your head it would benefit me greatly. Thanks again.

I say not to you, "backup your files before you change them." I say, rather, "use Subversion, and never worry about ruining your files again."

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...