Announcement

Collapse
No announcement yet.

Matching Gift Certificates with Redeemed Orders

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Internally, template code isn't very different from script/module code. If you read the docs about MvASSIGN or MvDO, and compare them to mvt:assign or mvt:do, they are very similar. The difference is more in how they are used. In general, I would say that:

    - Template code is fine for small quick jobs. For larger, more complex projects, a module is a better choice.

    - Template code mixes program-type actions with the HTML and text that is displayed to the customer. Modules keep all their code separate from the page templates, and provide data to the templates through the l.settings variables. Separating the code this way makes both parts easier to work with; it keeps the store "cleaner." There's less chance that you'll crash your store because of a typing error while editing a page template :^.

    - Modules are generally written by people with a lot of programming experience. As you noticed, it's easy to write a template tag that calls a library function such as GiftCertificate_Read. It's a lot harder to understand the difference between GiftCertificate_Read, GiftCertificate_Load_Code, and GiftCertificateList_Load_Order, in order to figure out which one to use and how it works.
    Kent Multer
    Magic Metal Productions
    http://TheMagicM.com
    * Web developer/designer
    * E-commerce and Miva
    * Author, The Official Miva Web Scripting Book -- available on-line:
    http://www.amazon.com/exec/obidos/IS...icmetalproducA

    Comment

    Working...
    X