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

      Working...
      X