Announcement

Collapse
No announcement yet.

MivaMerchant Actions. Best way to trigger them.

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

    MivaMerchant Actions. Best way to trigger them.

    Im looking for and "officially sanctioned" method for calling Merchant actions without displaying a screen.

    I've used three methods for calling Merchant actions, each with a downside.

    1. Using MvCall and passing the form data and discarding the screen output.
    downside, server load rendering un-needed screen.

    2. Calling the [merchant.mvc].Action_function() directly after populating required global variables.
    downside, may not work without digging through to see what global variables are missing.

    3. Copying the action into a seperate compiled function and making changes to resolve issues as needed. (g.module_library_db instead of g.library_db etc.)
    downside, prone to breaking as merchant.mvc changes.

    Should I be exploring the AJAX/Json functions.
    Ray Yates
    "If I have seen further, it is by standing on the shoulders of giants."
    --- Sir Isaac Newton

    #2
    Re: MivaMerchant Actions. Best way to trigger them.

    I prefer #2.

    <MvASSIGN NAME="l.save" VALUE="{ [ g.Module_Merchant ].Action_Save_OrderInformation() }">

    As you say, you often have to load all kinds of globals, but they don't change.

    The AJAX functions all require globals anyway, so you're not gaining anything, it seems to me.
    Gordon Currie
    Phosphor Media - "Your Success is our Business"

    Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
    phosphormedia.com

    Comment


      #3
      Re: MivaMerchant Actions. Best way to trigger them.

      We have typically called the action functions directly when we need to do this, or (in some cases), just set g.Action and done a straight MvDO into merchant.mvc without a function call. MvCALL is definitely a bad idea because of the multiplier effect it has on server load.

      Comment


        #4
        Re: MivaMerchant Actions. Best way to trigger them.

        Originally posted by RayYates View Post
        1. Using MvCall and passing the form data and discarding the screen output.
        downside, server load rendering un-needed screen.

        2. Calling the [merchant.mvc].Action_function() directly after populating required global variables.
        downside, may not work without digging through to see what global variables are missing.

        3. Copying the action into a seperate compiled function and making changes to resolve issues as needed. (g.module_library_db instead of g.library_db etc.)
        downside, prone to breaking as merchant.mvc changes.
        I've used all three of these techniques in various projects -- except that, as Burch mentioned, MvDO is a better choice than MvCALL. Fortunately, most of the relevant code is included in the LSK. So it's not too tough to look around in there, e.g. to decide whether to call Merchant directly, or to copy-and-paste and create my own version of the code.
        Last edited by Kent Multer; 02-20-15, 10:26 AM.
        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


          #5
          Re: MivaMerchant Actions. Best way to trigger them.

          Originally posted by burch View Post
          We have typically called the action functions directly when we need to do this, or (in some cases), just set g.Action and done a straight MvDO into merchant.mvc without a function call. MvCALL is definitely a bad idea because of the multiplier effect it has on server load.
          Thanks everyone for the response.

          Jon,

          I hadn't though of that. Don't I also need to set g.screen, or is there some way around that? (e.g. gscreen = 'null').

          I suppose I could setup an empty page template.
          Last edited by RayYates; 02-26-15, 08:40 AM.
          Ray Yates
          "If I have seen further, it is by standing on the shoulders of giants."
          --- Sir Isaac Newton

          Comment


            #6
            Re: MivaMerchant Actions. Best way to trigger them.

            You don't need to do any of that AFAIK, unless there is an Action function/subroutine that checks/sets the value of g.Screen.
            Gordon Currie
            Phosphor Media - "Your Success is our Business"

            Improve Your Customer Service | Get MORE Customers | Edit Any Document Easily | Free Modules | Follow Us on Facebook
            phosphormedia.com

            Comment


              #7
              Re: MivaMerchant Actions. Best way to trigger them.

              Hey Ray,

              I was just reading through the docs and you have probably moved on from this but can you set g.Screen="-1" ? Although it might trigger a l.error.
              http://www.alphabetsigns.com/

              Comment

              Working...
              X