Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Robert Dougan 48 posts 154 karma points
    Dec 10, 2012 @ 12:05
    Robert Dougan
    0

    Adding a custom property to an order

    Hi,

    Is it possible to add a new property to an order object. I want to add an extra address field but I'm not sure how to hook this field up with the order?

    Thanks,

    Robert

  • Rehan Zahid 31 posts 52 karma points
    Dec 12, 2012 @ 12:52
    Rehan Zahid
    0

    Yes it is... Before that your need add Generic property field on related document type, and then go to this javascript file "teacommerce_simple.js" to this method "sendCustomerInformation" and add another property in "formObj"

     var formObj = {

        company: paymentInformation.find("#company").val(),

        firstName: paymentInformation.find("#firstName").val(),

        lastName: paymentInformation.find("#lastName").val(),

        city: paymentInformation.find("#city").val(),

        zipCode: paymentInformation.find("#zipCode").val(),

        streetAddress: paymentInformation.find("#streetAddress").val(),

        phone: paymentInformation.find("#phone").val(),

        email: paymentInformation.find("#email").val(),

        comments: jQuery("#comments").val(),

        shipping_firstName: shippingInformation.find("#shippingFirstName").val(),

        shipping_lastName: shippingInformation.find("#shippingLastName").val(),

        shipping_streetAddress: shippingInformation.find("#shippingStreetAddress").val(),

        shipping_zipCode: shippingInformation.find("#shippingZipCode").val(),

        shipping_city: shippingInformation.find("#shippingCity").val(),

        Your Property: filed value

      };

     

    Then it should work... :)

  • Robert Dougan 48 posts 154 karma points
    Dec 12, 2012 @ 13:02
    Robert Dougan
    0

    Perfect, thanks Rehan, the JavaScript was the missing piece of the puzzle!

    Robert

Please Sign in or register to post replies

Write your reply to:

Draft