Announcement

Collapse
No announcement yet.

Refresh BasketCharges Array

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

    Refresh BasketCharges Array

    We'd like to make adjustments on the OSEL screen via template code. So far, so good...however, we need to refresh the BasketCharges array so the basket display has the correct info. Is there a way to do that from the template code or do we need to use a module?
    Bruce Golub
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
    phosphormedia.com

    #2
    By "adjustments," I gather that you want to write template code that adds or deletes BasketCharges, or changes their prices or other data; is that correct? You should be able to write code that will update the l.settings:basket:charges array to be in synch with your changes. You'll also want to update some totals and subtotals, and possibly other l.settings data.

    Of course, by the time your template code runs, all the system Action codes will have been executed, and the other page components will all be initialized; so you may find that some more work is needed to get everything working correctly. Depending on exactly what you're trying to accomplish, you might run into a situation where you do need a module. But you can do a lot with template code, especially if you have one of the Tool modules in the store.

    Hope that helps --
    Last edited by Kent Multer; 10-22-16, 02:07 PM.
    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


      #3
      basically just looking for the function that creates the l.settings:basket:charges array...I didn't find it in the LSK.
      Bruce Golub
      Phosphor Media - "Your Success is our Business"

      Improve Your Customer Service | Get MORE Customers | Edit CSS/Javascript/HTML Easily | Make Your Site Faster | Get Indexed by Google | Free Modules | Follow Us on Facebook
      phosphormedia.com

      Comment


        #4
        There's a library function BasketChargeList_Load_Basket(basket_id, basketcharges VAR) . That should allow you to get a fresh copy of the customer's BasketCharge data from the DB. However, the l.settings:basket:charges array may have other pieces of data added on, such as currency-formatted numbers, which you'll need to re-create with some more template code. And again, there may be totals and subtotals that need to be adjusted, which aren't part of the :charges array. I think you can look at the source code in the LSK for the basket and mini-basket component modules to see how they create l.settings:basket:charges.
        Last edited by Kent Multer; 10-22-16, 04:18 PM.
        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