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):
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.
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('<button type="submit">Gå til betaling</button>')" 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?
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.
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
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):
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
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
Sounds good. Looking forward to a link to the site you have been working on.
/Rune
I'll be sending it to you and Anders for sure.
To be honest, the GetPaymentForm method seems pretty unflexible, and like a bit of a hack. This ain't pretty:
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?
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
Ah, so I was overlooking something. Still not pretty, but it works! :)
Thanks for the quick reply.
is working on a reply...