Announcement

Collapse
No announcement yet.

Is it possible to change basket charge values directly using SMT?

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

    Is it possible to change basket charge values directly using SMT?

    I've put logic inside of the OPAY basket item that attempts to change the calculated shipping charge for a specific shipping method
    in order to complement the functionality in the weight based shipping method. What I've tried unsuccessfully is as follows:

    Just preceding the existing Order Charge foreach loop i've put an additional loop:

    <mvt:foreach iterator="charge" array="basket:charges">
    <mvt:item name="ry_toolbelt" param="assign|g.charge_cnt|g.charge_cnt + 1" />
    <mvt:if expr="charge:descrip EQ 'whatever') ">
    <mvt:item name="ry_toolbelt" param="assign|l.all_settings:basket:charges[g.charge_cnt]:disp_amt|99.90" />
    <mvt:item name="ry_toolbelt" param="assign|l.all_settings:basket:charges[g.charge_cnt]:formatted_disp_amt|'$99.90'" />
    </mvt:if>
    </mvt:foreach>

    When I look at the variable values using the toolbelt, the values for disp_amt and formatted_disp_amt have not changed from the original. Are there special constraints surrounding changing the basket values that don't allow for "on-the-fly' SMT changes?

    #2
    Re: Is it possible to change basket charge values directly using SMT?

    The only way to effect database values is to manipulate a global variable that is passed withing CGI (i.e., in the URL or a field inside the post).

    OR, if toolbelt actually has a function to query the database...which I believe it does.
    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


      #3
      Re: Is it possible to change basket charge values directly using SMT?

      I don't know exactly how Toolbelt works internally. But in standard Miva script, you can't use a variable inside an array subscript in the "name" or destination part of an assignment. E.g. you can assign to charges[1], charges[2], etc. but not to charges[g.something].

      Also, if you change variables such as l.all_settings:basket, you only change what's displayed on the customer's screen. In the store's database, the old value will be unchanged, and it will pop up again when the customer moves to the next checkout page.

      It's probably possible to fix both these problems with Toolbelt, but it will take some more coding.

      HTH --
      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


        #4
        Re: Is it possible to change basket charge values directly using SMT?

        Joining thread
        Larry
        Luce Kanun Web Design
        www.facebook.com/wajake41
        www.plus.google.com/116415026668025242914/posts?hl=en


        Comment

        Working...
        X