Announcement

Collapse
No announcement yet.

Customer Custom Fields

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

    #16
    Not trying to redirect the discussion, but it looks like a solution is presented.

    There is a school of thought that you shouldn't need to assign an item to a page if the component item is valid. IOW, especially for a Miva module, Customfields, adding the Read_Customer_ID should be all that was needed for the function to run.

    So, are there other systematic concerns with Component ITEMs?

    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


      #17
      Originally posted by Nick View Post
      Sorry all, I got a little ahead of myself and forgot to add some code:

      Code:
      <mvt:do file="g.Module_Library_DB" name="l.loaded_module" value="Module_Load_Code_Cached( 'customfields', l.customfields_module )" />
      <mvt:if expr="l.loaded_module">
      <mvt:do file="g.Module_Root $ l.customfields_module:module" name="l.success" value="CustomerFieldValue_Load_CodeAndCustomer( '
      customer_customfield_code', l.settings:order:cust_id, l.customfield:field, l.customfield:value )" />
      <mvt:eval expr="decodeattribute(glosub(miva_array_serialize( l.customfield), ',', '<br>'))" />
      </mvt:if>
      All that being said the most optimized way of getting the customer custom field would be to assign the custom field item to the page then run the Read_Customer_ID function:

      Code:
      <mvt:item name="customfields" param="Read_Customer_ID( CUST_ID, 'custom_field_code', l.settings:customfields )" />
      More information can be found here: https://docs.miva.com/template-langu...-documentation
      The custom field item has been assigned to this page all along. It was one of the first things I did.

      Please keep in mind, that I'm an integrator who takes the bits and pieces and then puts them together to make it work. I have looked at the docs numerous times over.

      Obviously, this didn't work for me:

      Code:
      <mvt:item name="customfields" param="Read_Customer_ID( CUST_ID, 'test', l.settings:customfields )" />
      &mvte:customfields:test;
      but the code you posted did spit out this:

      Code:
      :field:code=test
      :field:fieldtype=textfield
      :field:group_id=0
      :field:id=105
      :field:info=Field for message
      :field:name=Test
      :value:field_id=105
      :value:value=This is just a test.
      The last line, the "value" is what I need.




      Leslie Kirk
      Miva Certified Developer
      Miva Merchant Specialist since 1997
      Previously of Webs Your Way
      (aka Leslie Nord leslienord)

      Email me: [email protected]
      www.lesliekirk.com

      Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

      Comment


        #18
        lesliekirk Sorry to bring up an old thread, but I am trying to accomplish this as well. I am seeing the Value in the code that spit out but can't get the value to show up where needed in the Batch Report. Were you ever able to get this to work?

        Comment


          #19
          Originally posted by afiumano View Post
          lesliekirk Sorry to bring up an old thread, but I am trying to accomplish this as well. I am seeing the Value in the code that spit out but can't get the value to show up where needed in the Batch Report. Were you ever able to get this to work?
          I wish there was/is some way to tag these posts to a project. I need to figure out which project I was working on to go back and look. Let me see if I can find it and if it was ever resolved.
          Leslie Kirk
          Miva Certified Developer
          Miva Merchant Specialist since 1997
          Previously of Webs Your Way
          (aka Leslie Nord leslienord)

          Email me: [email protected]
          www.lesliekirk.com

          Follow me: Twitter | Facebook | FourSquare | Pinterest | Flickr

          Comment


            #20
            Originally posted by afiumano View Post
            lesliekirk Sorry to bring up an old thread, but I am trying to accomplish this as well. I am seeing the Value in the code that spit out but can't get the value to show up where needed in the Batch Report. Were you ever able to get this to work?
            If I'm understanding your post I think we would need to see most if not the entire script because it sounds like you just have it placed in the wrong section. IE inside the correct loop or something like that.
            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


              #21
              I agree with Bruce on this. Custom fields can be tricky to work with, because there are two different ways of accessing them, and there are some confusing variable names. An experienced developer can probably find and fix this quickly, but he might need to see all the code, or maybe log in to the store's admin page to take a closer look, check some settings, etc.
              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

              Working...
              X