Copied to clipboard

Flag this post as spam?

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


  • Matt Taylor 873 posts 2086 karma points
    Sep 08, 2011 @ 15:25
    Matt Taylor
    0

    Minimal use of scripts

    Having opted to build my site with .Net controls I'm not making use of all the scripts that come with Tea Commerce.

    In fact the only script I'm referencing is teaCommerce.js so I can call the TeaCommerce.goToPayment() function at the last stage of the checkout.

    Can I safely remove all the other functions from this script file?

    Regards,

    Matt

  • Rune Grønkjær 1371 posts 3102 karma points
    Sep 08, 2011 @ 15:35
    Rune Grønkjær
    0

    You do not need the TeaCommerce.goToPayment() call anymore. With our no javascript fallback you can do it by posting a normal form. That might give you problems if using a runat="server" form around all your code. Anyways... You can download the updated starter kits from teacommerce.dk and se how to do it there.

    To generate the payment form use the xslt library method (Which can be called from your .NET):

    TeaCommerce.Library.GetPaymentForm( string submitInput )
    

    The submitInput parameter is a full html input submit button. You need to provide that, because you might want to control the look and feel about it. It will be what the user will click, to go to payment.

    And to answer your question. Yes, you can delete all other scripts if you like. There are many ways of doing a Tea Commerce webshop.

    /Rune

  • Matt Taylor 873 posts 2086 karma points
    Sep 08, 2011 @ 15:49
    Matt Taylor
    0

    Thanks Rune for the information,

    I have been working with an older version Tea Commerce but with being so close to going live I'd rather not start making changes I do not need to.

    I'll stick with the script call for now but it's nice to know how's the product's moved on and will use it in my next project.

    Cheers,

    Matt

  • Rune Grønkjær 1371 posts 3102 karma points
    Sep 08, 2011 @ 15:50
    Rune Grønkjær
    0

    Sounds good. Looking forward to a link to the site you have been working on.

    /Rune

  • Matt Taylor 873 posts 2086 karma points
    Sep 08, 2011 @ 15:54
    Matt Taylor
    0

    I'll be sending it to you and Anders for sure.

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Sep 13, 2011 @ 11:34
    Dan Okkels Brendstrup
    0

    To be honest, the GetPaymentForm method seems pretty unflexible, and like a bit of a hack. This ain't pretty:

    <xsl:value-of select="teacommerce:GetPaymentForm('&lt;button type=&quot;submit&quot;&gt;Gå til betaling&lt;/button&gt;')" disable-output-escaping="yes" />

    Furthermore, because the input needs to be XML-escaped, I can't find a way to execute XSLT within the input parameter, and thus I cannot localize the string within the button element. Am I overlooking an obvious solution?

    How about a GetPaymentFormUrl method instead, that simply returns a URL that I can stick in a forms @action attribute, and thus control all the markup myself?

  • Rune Grønkjær 1371 posts 3102 karma points
    Sep 13, 2011 @ 11:39
    Rune Grønkjær
    0

    Yes, I know it's not pretty. Was not meant to be pretty but flexible. Exactly the localization will be possible with this solution as you can concat your string and thus inserting a dictionary text.

    To make it pretier you can create the escaped button in a variable first, and the output that variable in GetPaymentForm method.

    /Rune

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Sep 13, 2011 @ 11:55
    Dan Okkels Brendstrup
    0

    Ah, so I was overlooking something. Still not pretty, but it works! :)

    Thanks for the quick reply.

Please Sign in or register to post replies

Write your reply to:

Draft