Announcement

Collapse
No announcement yet.

is there a new equivalent function for this?

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

    is there a new equivalent function for this?

    This is still available in v55_ui.js:

    Code:
    <a href="JavaScript:PopupProductLookup( l.tabfield );">
    Need the Miva 10 version.

    Scott
    Need to offer Shipping Insurance?
    Interactive Design Solutions https://www.myids.net
    MivaMerchant Business Partner | Certified MivaMerchant Web Developer
    Competitive Rates, Custom Modules and Integrations, Store Integration
    AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
    My T-shirt Collection is mostly MivaCon T-shirts!!

    #2
    PopupProductLookup is now ProductLookupDialog. Note that you should pull in the required dependencies. In some cases (depending on what screen you are on), this might already be done for you, but it is best practice to pull them in anyway (using the functions below will ensure they're only included once per page load... ie, if they've already been output, they won't be output again).

    In the header section:
    Code:
        <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_ProductLookup_Dialog_CSS() }">
    
        <MvIF EXPR = "{ [ g.Module_Admin ].Element_Admin_Catalog_JavaScript_Combined_Begin() }">
            <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_ProductLookup_Dialog_JavaScript() }">
            <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_Admin_Catalog_JavaScript_Combined_End() }">
        </MvIF>
    and in the content (html) section:
    Code:
        <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_ProductLookup_Dialog_HTML() }">
    Then you'd call it just like you would have previously, except using the ProductLookupDialog name instead:

    Code:
        <a href="JavaScript:ProductLookupDialog( l.tabfield );">
    Ryan Guisewite
    Lead UI Developer / Miva, Inc.
    www.miva.com

    Comment


      #3
      Thanks, Ryan. I haven't found them yet. Are these functions not included in the LSK?

      Scott
      Need to offer Shipping Insurance?
      Interactive Design Solutions https://www.myids.net
      MivaMerchant Business Partner | Certified MivaMerchant Web Developer
      Competitive Rates, Custom Modules and Integrations, Store Integration
      AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
      My T-shirt Collection is mostly MivaCon T-shirts!!

      Comment


        #4
        In the above code snippet, what is the variable l.tabfield? I would guess that it's a string containing the name of the form element to receive the looked-up product code; but I'd like confirmation please.

        Thanks --
        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
          I am personally writing the literal string in the module. I don't think there would be an issue if it's a variable, but not actually doing that. Regardless, it is the name of the input field for the form I am in.

          I should have written as
          i.inputfield
          or
          'inputfield'
          .

          Scott
          Need to offer Shipping Insurance?
          Interactive Design Solutions https://www.myids.net
          MivaMerchant Business Partner | Certified MivaMerchant Web Developer
          Competitive Rates, Custom Modules and Integrations, Store Integration
          AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
          My T-shirt Collection is mostly MivaCon T-shirts!!

          Comment


            #6
            Ryan,

            It appears that some resources might not be loading. Is something missing from your code snippets?

            Thanks,

            Scott
            Need to offer Shipping Insurance?
            Interactive Design Solutions https://www.myids.net
            MivaMerchant Business Partner | Certified MivaMerchant Web Developer
            Competitive Rates, Custom Modules and Integrations, Store Integration
            AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
            My T-shirt Collection is mostly MivaCon T-shirts!!

            Comment


              #7
              Scott, they are not in the LSK.

              Kent, l.tabfield was just what Scott was using in his original post, that would be the "id" value of whatever input you want it to populate with the selected value. That ProductLookupDialog function takes id as a param and then calls input = document.getElementById( id ), where "id" is whatever text value you passed to the function. Then, on selection, it sets input.value to the code of the selected product.

              Scott, what resource isn't loading? If you're including those resources, that should be sufficient... Where are you trying to set this up (ie, which vis_xxx api are you using)?
              Ryan Guisewite
              Lead UI Developer / Miva, Inc.
              www.miva.com

              Comment


                #8
                Thanks, Ryan. I think I might now know what is missing in my code. I go back to my module and test it out and report back.


                UPDATE: no joy so far.

                I have the code you supplied in the HEAD function.
                Same in the HTML section.

                Features: util, vis_util

                Code:
                <MvFUNCTION NAME = "Module_Utility_Content"
                I've also changed to a literal

                Code:
                <a href="JavaScript:ProductLookupDialog( LiteralID );">
                or
                Code:
                <a href="JavaScript:ProductLookupDialog( 'LiteralID' );">
                Code:
                <input type="text" id="LiteralID" name="LiteralID" value="" size="20">
                Scott
                Last edited by ids; 02-19-21, 06:48 PM.
                Need to offer Shipping Insurance?
                Interactive Design Solutions https://www.myids.net
                MivaMerchant Business Partner | Certified MivaMerchant Web Developer
                Competitive Rates, Custom Modules and Integrations, Store Integration
                AutoBaskets|Advanced Waitlist Integration|Ask about Shipping Insurance Integration
                My T-shirt Collection is mostly MivaCon T-shirts!!

                Comment


                  #9
                  Here is a complete example that works (just tested it on mine):

                  Code:
                  <MvFUNCTION NAME = "Module_Description" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvASSIGN NAME = "l.module:code"        VALUE = "productlookupexample">
                      <MvASSIGN NAME = "l.module:name"        VALUE = "Example to show ProductLookupDialog">
                      <MvASSIGN NAME = "l.module:provider"    VALUE = "Miva Merchant">
                      <MvASSIGN NAME = "l.module:version"     VALUE = "1.0000">
                      <MvASSIGN NAME = "l.module:api_ver"     VALUE = "5.70">
                      <MvASSIGN NAME = "l.module:features"    VALUE = "util, vis_util">
                  </MvFUNCTION>
                  
                  <MvCOMMENT>
                  |
                  | Feature util
                  |
                  </MvCOMMENT>
                  
                  <MvFUNCTION NAME = "StoreUtilityModule_Action" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "StoreUtilityModule_LeftNavigation" PARAMETERS = "module var, indent" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "StoreUtilityModule_Screen" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "StoreUtilityModule_Validate" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvCOMMENT>
                  |
                  | Feature vis_util
                  |
                  </MvCOMMENT>
                  
                  <MvFUNCTION NAME = "Module_Utility_Tabs" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = "productlookupexample:ProductLookupDialog">
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "Module_Utility_Head" PARAMETERS = "module var, tab" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
                      <MvIF EXPR = "{ l.tab NE 'productlookupexample' }">
                          <MvFUNCTIONRETURN VALUE = 1>
                      </MvIF>
                  
                      <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_ProductLookup_Dialog_CSS() }">
                  
                      <MvIF EXPR = "{ [ g.Module_Admin ].Element_Admin_Catalog_JavaScript_Combined_Begin() }">
                          <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_ProductLookup_Dialog_JavaScript() }">
                          <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_Admin_Catalog_JavaScript_Combined_End() }">
                      </MvIF>
                  
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "Module_Utility_Content" PARAMETERS = "module var, tab, load_fields" STANDARDOUTPUTLEVEL = "text, html, compresswhitespace">
                      <MvIF EXPR = "{ l.tab NE 'productlookupexample' }">
                          <MvFUNCTIONRETURN VALUE = 1>
                      </MvIF>
                  
                      <label>Input Field: <input type="text" id="productlookupdialogexampleinput" name="ANameOfAField" value="" /></label>
                      <a href="JavaScript:ProductLookupDialog( 'productlookupdialogexampleinput' );">Lookup</a>
                  
                      <MvEVAL EXPR = "{ [ g.Module_Admin ].Element_ProductLookup_Dialog_HTML() }">
                  
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "Module_Utility_Update" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  
                  <MvFUNCTION NAME = "Module_Utility_Validate" PARAMETERS = "module var" STANDARDOUTPUTLEVEL = "">
                      <MvFUNCTIONRETURN VALUE = 1>
                  </MvFUNCTION>
                  Ryan Guisewite
                  Lead UI Developer / Miva, Inc.
                  www.miva.com

                  Comment

                  Working...
                  X