Announcement

Collapse
No announcement yet.

ASSIGN check number to OPAY form

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

    ASSIGN check number to OPAY form

    Hi, I'm trying to get around the prompt to enter a check number when a user selects the 'Check' payment method. It seems like an easy way to do it would be to assign a check number behind the scenes, without displaying the prompt to enter the check number.

    I'm having a hard time determining the right variable. I tried posting a regular order, entering check number '222' into the prompt, then using TokenList to look for the number 222 on both OPAY and INVC. It didn't turn up. So I'm wondering where the check number gets passed.

    I tried adding something like this to the OPAY form:
    <mvt:if expr="l.settings:payment:desc EQ 'Check'">
    <mvt:assign name="l.settings:payments:field" value="222" />
    Select Continue to complete your order.

    I tried a few other variants of the variable as well. Still get an error message that a field was filled out incorrectly, so it seems the check number isn't being assigned.

    Is this possible what I'm trying to do?

    Thanks!
    Kyle Creasy, Alphatect

    #2
    You haven't completely explained what you're trying to do. Obviously you don't want to use the number 222 for every check payment. Are you trying to set up some kind of internal counter, to assign unique numbers to each one?
    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
      Originally posted by Kent Multer View Post
      You haven't completely explained what you're trying to do. Obviously you don't want to use the number 222 for every check payment. Are you trying to set up some kind of internal counter, to assign unique numbers to each one?
      Thanks Kent. Well, actually I am intending to use the same check number over and over. My only goal is to move past the part that requires the customer to enter a check number - as most will not have that available. I can add a note to just enter a few zeros or 1234, which I have actually done. But I think it would look better to do without that. (This is a dev store BTW.)

      Now I am wondering what the unintended consequences would be to assigning the same check number. I can't see any problems at this point. I don't think I'm using the store feature where the check number would be used. Where is the check number used?

      Comment


        #4
        On OPAY you should be able to write a conditional that detects the check payment method (just be sure you are looking for the correct value and I'd use g.PaymentMethod), but you want to assign the check number to a GLOBAL by assigning it to a hidden input <input type="hidden" name="what-ever-the check-module-input-was" value="222">
        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


          #5
          Originally posted by Bruce - PhosphorMedia View Post
          On OPAY you should be able to write a conditional that detects the check payment method (just be sure you are looking for the correct value and I'd use g.PaymentMethod), but you want to assign the check number to a GLOBAL by assigning it to a hidden input <input type="hidden" name="what-ever-the check-module-input-was" value="222">
          Thanks Bruce. I was using 'assign' instead of 'input'. Makes sense though. I'll try different variables with 'input'.

          Comment


            #6
            Yea, you need the variable created for check to be available on the NEXT post so just creating on the page wont get you too far :)
            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


              #7
              I'm having a hard time determining what to use for name here:

              <input type="hidden" name="what-ever-the check-module-input-was" value="222">

              Using TokenList, it's not giving me many clues. Here's a sample of what it gives me:
              Variable - Entity - Value
              l.settings:payment:desc - &mvt:payment:desc; - Check or Money Order
              l.settings:payment:fields[1]:code - &mvt:payment:fields[1]:code; - check
              l.settings:payment:fields[1]:prompt - &mvt:payment:fields[1]:prompt; - Check #:
              l.settings:payment:module:code - &mvt:payment:module:code; - check
              l.settings:payment:module:module - &mvt:payment:module:module; - modules/payment/check.mvc
              l.settings:payment:module:name - &mvt:payment:module:name; - Check Payment
              l.settings:payment:module_data - &mvt:payment:module_data; - check
              l.settings:payment:paymentmethodrules:descrip - &mvt:payment:paymentmethodrules:descrip; - Check or Money Order
              l.settings:payment:paymentmethodrules:meth_code - &mvt:payment:paymentmethodrules:meth_code; - check
              l.settings:payment:paymentmethodrules:mod_code - &mvt:payment:paymentmethodrules:mod_code; - check
              l.settings:paymentmethod:module:code - &mvt:paymentmethod:module:code; - check
              l.settings:paymentmethod:module:module - &mvt:paymentmethod:module:module; - modules/payment/check.mvc
              l.settings:paymentmethod:module:name - &mvt:paymentmethod:module:name; - Check Payment
              l.settings:paymentmethod:module_data - &mvt:paymentmethod:module_data; - check

              I've tried plugging in "check", "Check #", "Check #:", "payment:field", "payment:fields", "payment:field:code", "payment:fields:code", "payment", "PaymentMethod"

              Here's a simplified version of the code I'm using for this:

              <mvt:if expr="l.settings:payment:desc EQ 'Check or Money Order'">
              <input type="hidden" name="check" value="333">
              <div>
              <h2 id="sec-opay-label">Complete Order</h2>
              Select <b>Submit Order</b> below to complete your order.
              </div>
              <mvt:else>

              The if statement is working because it does pull the the rest of the div and text there. It's just the name that I can't nail down.

              This is what Miva uses for displaying the empty text fields in this form:
              <mvt:item name="payment" param="field:code" />


              Comment


                #8
                If you are using the built in Miva Check module the hidden input should be named Check_Number as in:

                <input type="hidden" name="Check_Number" value="&mvt:whatever_variable_you_want;">

                And you are looking for detecting on g.paymentMethod EQ check:check

                I simply looked at an installed check module, checked what the name/value was for THAT payment method, then checked to see what its input field name was on OPAY.
                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


                  #9
                  That did it! Thaks Bruce.

                  Here's the simplified code. I actually placed it above and outside of the whole foreach loop in the payment methods section:

                  <mvt:if expr="g.paymentMethod EQ 'check:check'">
                  <input type="hidden" name="Check_Number" value="1234">
                  <div>
                  <h2>Complete Order:</h2>
                  Select <b>Submit Order</b> below to complete your order.<br>
                  Payment instructions will follow on next screen.
                  </div>
                  <mvt:else>
                  ...The rest of the foreach loop for payment methods
                  </if>

                  It allowed me to login as a customer, then order twice. So it didn't reject the duplicate check number. It won't take all zeros though.

                  The check number doesn't appear to carry over to Invoice or Order Status. But now I am noticing it when viewing an order through Order Processing. It shows up in the Payment Section. There is a 'Check Payment' link there that allowed me to change the check number.

                  Comment

                  Working...
                  X