Copied to clipboard

Flag this post as spam?

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


  • Morten Christensen 61 posts 215 karma points
    Aug 25, 2015 @ 14:38
    Morten Christensen
    0

    What triggers "CopiedFromOrderId"

    We have a large shop that runs on Teacommerce 2.3.2.

    Sometimes (it happens randomly) a Order is copied somewhere in the checkout process. I can see in the DB that the new Order has a "CopiedFromOrderId" with the old order id. The problem is that all custom properties is not copied to the new order, so we lose a lot of information in the process..

    So my question is: What TC method could trigger this copy function? We use all features of TC 2.3 (Shipping, Payment, Internationalization).

    An explanation of CopiedFromOrderId could also help me a lot in the debug process :)

    Thanks!

  • Anders Burla Johansen 2560 posts 8256 karma points
    Aug 26, 2015 @ 06:18
    Anders Burla Johansen
    2

    Hi Morten The CopiedFromOrderId is set when an order is cloned. This happens when you generate the payment form for an order - this locks the order for further changes. If you then do ANYTHING with the order using the HTML/JavaScript/Razor or XSLT API then the order will be copied. So try and look if any of your code does anything after the order has been "GeneratedPaymentForm()". But when its cloned it should copy all properties, order lines etc.

    Kind regards

    Anders

  • Paul Wright (suedeapple) 222 posts 606 karma points
    Aug 26, 2015 @ 08:26
    Paul Wright (suedeapple)
    0

    This one got me as well. As I was unsure why a lot of CARTS were being re-generated/copied.

    Maybe put something in the TC docs about what happens when you put the payment form button on a page.

  • Phil Dye 141 posts 296 karma points
    Aug 26, 2015 @ 09:44
    Phil Dye
    0

    Ah-ha, I had the same thing yesterday with OrderLines, couldn't work out why their Id was changing! Thanks for the explanation!

    With that in mind, does it make sense to only call GeneratePaymentForm on a 'silent' payment page, rather than on the 'Accept' page, so the order is only copied and frozen once the user actually goes to pay, rather than before? Or is there no real overhead in doing so?

    Phil

  • Paul Wright (suedeapple) 222 posts 606 karma points
    Aug 26, 2015 @ 12:12
    Paul Wright (suedeapple)
    0

    To get the checkout flow to work as my client wants it a "Silent page" is something I had to go down (for the time being)

    But this now requires the user to have JS enabled, to trigger the form button submit. Then again, most of the site requires JS to be on :-)

  • Morten Christensen 61 posts 215 karma points
    Aug 26, 2015 @ 11:13
    Morten Christensen
    0

    Thank you Anders! I think I know the problem now.. We call GeneratedPaymentForm() on the payment page.. if the user goes back and change something in the process, and then go to payment again.. GeneratedPaymentForm() will then be called again. The problem must be this..

    And as Paul says.. some doc to CopiedFromOrderId would be nice :)

  • Anders Burla Johansen 2560 posts 8256 karma points
    Aug 26, 2015 @ 12:17
    Anders Burla Johansen
    0

    On the silent page you can generate the payment form with a submit button so people without JS can click the button. The ones with JS will auto post using e.g jQuery

Please Sign in or register to post replies

Write your reply to:

Draft