Copied to clipboard

Flag this post as spam?

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


  • Hannes Rahm 28 posts 47 karma points
    Jan 17, 2012 @ 10:09
    Hannes Rahm
    0

    Custom Properties not appearing on order line

    Heya!

    Having some troubles with adding custom properties to my orderlines using javascript. Order lines are added but lack the custom properties.

    Working on a store which sells flower-cards with different designs in different sizes.

    I made two different products for the different sizes we are starting out with, and now I want to add a custom property containing the id of the selected design:

    TeaCommerce.addUniqueOrderLine
        (id, false, quantity, { properties: { 'design': designId} }); 

    I have added "design" to the "Order line property aliases" field in settings. 

    I'm using chromes firebug equivalent to spy on the network traffic and can't see any properties added to the order lines.

    Would be super thankful for a quick response, as I am approaching deadline fast :)

    /Hannes

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 17, 2012 @ 10:46
    Rune Grønkjær
    0

    What version of Tea Commerce are you using? Your JavaScript looks fine, so maybe you are using and older version of Tea Commerce. The style you are using where introduced in version 1.4.0.0.

    /Rune

  • Hannes Rahm 28 posts 47 karma points
    Jan 17, 2012 @ 11:38
    Hannes Rahm
    0

    I use

    Package version 1.4.1.2

    /Hannes


  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 17, 2012 @ 11:43
    Rune Grønkjær
    0

    So far so good.

    Here's some code we use, that I know works:

    TeaCommerce.addUniqueOrderLine(id, -1, 1,
    {
      properties: {
        relatedUniqueOrderlineId: uniqueOrderlineId
      }
    });

    /Rune

  • Hannes Rahm 28 posts 47 karma points
    Jan 17, 2012 @ 16:19
    Hannes Rahm
    0

    Thanks, but sorry, that doesn't work either.

    Is there anything else I need to do? (didnt start with the starter kit, and don't have a license yet (since I don't see this working yet ;)))

    /Hannes

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 17, 2012 @ 16:29
    Rune Grønkjær
    0

    Do you have a website somewhere online that I can visit to see the problem?

    You can send the url to [email protected] if you don't want to share it to the world :)

    What you could try, to rule it out, is to download the very latest version of Tea Commerce, unpack it and find the teaCommerce.js file and overwrite your own.

    You could also try using the none unique add order line and see if that works like this:

    TeaCommerce.addOrderLine(1172, 1, {properties: {'test': 'lala'}})

    Also how are you testing that the properties are not on the order? Have you tried an <xsl:copy-of select="$order" /> to see if theres nothing on the order.

    /Rune

  • Hannes Rahm 28 posts 47 karma points
    Jan 17, 2012 @ 17:26
    Hannes Rahm
    0

    Mail sent!

    /Hannes

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 17, 2012 @ 18:04
    Rune Grønkjær
    0

    Hi Hannes,

    It's actually working fine when I'm doing it. Using the firebug console I can invoke the following script with success:

    TeaCommerce.addUniqueOrderLine(1885, -1, 1, {properties: {test: 'lala'}})

    I now think your problem is the "designId" variable. It's probably empty! If it's empty the property will not be added.

    /Rune

  • Hannes Rahm 28 posts 47 karma points
    Jan 17, 2012 @ 18:29
    Hannes Rahm
    0

    Maybe I am misunderstanding something. The custom properties should appear in the json returned by GetOrder.aspx in Order.OrderLines[x].Properties, right?

    My var is not empty. I am debugging the javascript. Following it all the way into addUniqueOrderLine().

    Check screenshots:

     

  • Hannes Rahm 28 posts 47 karma points
    Jan 17, 2012 @ 18:37
    Hannes Rahm
    0

    Did some more testing.

    It DOESNT work for custom properties that ARE defined in the backoffice.

    If I remove "design" from the list, or use another property alias it works like a charm.

    This must be a bug right?

    /Hannes

    [EDIT] OR that is not what that setting is for. However none of the properties are showing up on the orders in the backoffice... *SIGH*

    The quantities and the price show up fine.

    And if i look in the db the properties are there. Why arent they showing up in the backoffice?

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 18, 2012 @ 08:09
    Rune Grønkjær
    0

    Hi Hannes,

    The designId property should not be entered in the "Order line property aliases" in the Tea Commerce general settings. All properties you enter there will be automatically added from the corresponding property on the product node. Furthermore these order line properties are locked from the clientside script to secure them from outside manipulation. That is why it's not being updated. So just remove it from there and youre good to go.

    As for showing your custom properties in the backend, and in the confirmation email, you must edit the "teaCommerceAdminOrder.xslt" and the teaCommerceEmailTemplate.xslt and insert the extra fields there. You have 100% control over what is showed there and how. The standard templates only show the most basic information.

    By the way. Cool looking webshop you are building there.

    /Rune

  • Hannes Rahm 28 posts 47 karma points
    Jan 18, 2012 @ 08:58
    Hannes Rahm
    0

    Thanks Rune!

    Misunderstanding on my end.

    Awesome with the teaCommerceAdminOrder.xslt script!

    I really like Tea Commerce!
    The only real problem is the docs, which is the basis of probably all my troubles.
    I guess you are still working on that :)

    /Hannes

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 18, 2012 @ 09:02
    Rune Grønkjær
    0

    Yes, we know about the docs. We are working on a plan to clear more time for documenting. Until then, no questions will be too dumb here in the forum! :)

    The forum fortunately holds a large amount of documentation searchable by google.

    On the same note, please mark the correct answer in this post for others to see.

    /Rune

  • Hannes Rahm 28 posts 47 karma points
    Jan 18, 2012 @ 09:38
    Hannes Rahm
    0

    My reply disappeared into thin air... maybe I'm cursed web wise? ;)

    Anyway. I really like Tea Commerce. It's great.
    Probably most of my troubles stem from the somewhat lacking docs.

    The teaCommerceAdminOrder.xslt stuff was awesome. Enabled me to show previews of the designs etc. 

    Thanks!
    /Hannes 

  • Rune Grønkjær 1372 posts 3103 karma points
    Jan 18, 2012 @ 09:40
    Rune Grønkjær
    0

    Your post just disappeared to page two. The paging is almost invisible on this forum :)

    /Rune

Please Sign in or register to post replies

Write your reply to:

Draft