Announcement

Collapse
No announcement yet.

Need help with a <MvDO> a Miva Script at order fulfilment

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

    Need help with a <MvDO> a Miva Script at order fulfilment

    In MM5 how do we <MvDO> a Miva Script at order fulfilment, after payment has been approved, but before the final page display. Also, on this final page, how can we display additional details that would have come from the other Miva Script, all for the given order.

    Example code:
    <MvASSIGN NAME = "g.mm_order_id" VALUE = "{What_Goes_In_here_please}">
    <MvDO FILE="/EspritLMS/scripts/esprit_upd_mm5.mvc">

    When we get to the final page we need to do the following after MM has displayed the order details:
    <MvEVAL EXPRESSION = "{g.esplms_HTM_code}">

    Where g.esplms_HTM_code is loaded with HTM code such as a table, links, etc and is assigned in the esprit_upd_mm5.mvc script above.

    Thank you in advance!
    ---------------------------------
    Robin McDermott, CQE
    Director of Training
    QualityTrainingPortal.com

    #2
    Re: Need help with a &lt;MvDO&gt; a Miva Script at order fulfilment

    You can't write Miva Script code directly into MM5 page templates. The template language alone isn't sufficient for this task, but one of the add-on modules such as Toolbelt or Toolkit should be able to handle it.
    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
      Re: Need help with a &lt;MvDO&gt; a Miva Script at order fulfilment

      Hey Robin -

      Kent is correct, you can't use Miva Script code in the template language. There are a couple ways to do this. Use tool belt which which can has its own MvDO function or what we would typically do is use toolkit to do this.

      Here is your original code:

      Code:
      <MvASSIGN NAME = "g.mm_order_id" VALUE = "{What_Goes_In_here_please}">
      <MvDO FILE="/EspritLMS/scripts/esprit_upd_mm5.mvc">
      
      <MvEVAL EXPRESSION = "{g.esplms_HTM_code}">
      


      This would look something like this using toolkit:

      Code:
      Assign the order id to a global variable called mm_order_id
      <mvt:item name="toolkit" param="mvassign|mm_order_id|l.all_settings:order:id" />
      
      
      The g.mm_order_id would not be available in your esprit_upd_mm5.mvc so you would need to pass it as a post parameter
      <mvt:item name="toolkit" param="callurl|response|https://www.mydomain.com/EspritLMS/scripts/esprit_upd_mm5.mvc|POST|g.mm_order_id" />
      
      
      output the response to the page:
      &mvte:global:response;
      Hope this helps, Brennan
      Last edited by Brennan; 12-13-12, 09:34 AM.
      Brennan Heyde
      VP Product
      Miva, Inc.
      [email protected]
      https://www.miva.com

      Comment


        #4
        Re: Need help with a &lt;MvDO&gt; a Miva Script at order fulfilment

        Thanks for the insight Brennan and Kent. We didn't end up needing Toolbelt or Toolkit although both seems very powerful and are well-priced for what they do.

        We were able to achieve our objective with one line of Javascript code in the invoice footer:

        <script type="text/javascript" src="esprit_upd_mm5.js"></script>

        Then the referenced javascript does the rest of the work.
        ---------------------------------
        Robin McDermott, CQE
        Director of Training
        QualityTrainingPortal.com

        Comment

        Working...
        X