Now I'd like to output the saved value of that property in the cart so the customer can see which shipping option they've chosen, but I don't think I have the syntax right and can't actually see a method in the documentation that looks like it would do this (I'm just assuming/hoping it's possible!). I've tried this:
That's cool, thanks Rune. It does feel a bit frustrating sometimes as this stuff is usually really simple but can take way too long to uncover. If I could put in a feature request (for after the documentation!) it would be to offer a stripped-back starter kit that is ultra-basic in terms of functionality. This was really useful with TC1, where you offered two starter kits - a bare-bones one and a fully-fledged one, but I've found that the starter kit in TC2 is way overkill for a simple starter project and actually quite confusing. It has lots of package dependencies and uses pretty much the full gamut of TC functionality, which is obviously a good thing if it's a show-case of the product, but I've found it quite laborious to strip all of this stuff out and just get back to a simple 'add this product to cart' type of functionality. Personally, I'd prefer to start light and add functionality than start heavy and strip back.
I love Tea Commerce, and the beauty of it is that it's SIMPLE, but I've found that with TC2 the simplicity is very hidden and things seem more complicated than (a) they are, and (b) they used to be with TC1, when actually it's probably simpler than TC1.
Just my two cents anyhow. I know you guys are busy and this will all fall into place eventually. :)
Get custom property of Tea Commerce order in razor
Hi,
I've used AJAX to save a custom property on an order, like this:
Now I'd like to output the saved value of that property in the cart so the customer can see which shipping option they've chosen, but I don't think I have the syntax right and can't actually see a method in the documentation that looks like it would do this (I'm just assuming/hoping it's possible!). I've tried this:
And this:
But it's erroring on saving the .cshtml file.
Can anyone advise on how to retreive this custom property in the Razor script?
Thanks
Got it! The correct syntax for getting a property is
So my code above ended up like this:
Works nicely. The more I find out about the API the more I like it - it's just difficult with the incomplete documentation at the moment.
Good thing you figured it out. The starter kit is all the documentation you will ever need ;)
Nah, we know we need more documentation and it will come in august when we are over the summer holidays.
/Rune
That's cool, thanks Rune. It does feel a bit frustrating sometimes as this stuff is usually really simple but can take way too long to uncover. If I could put in a feature request (for after the documentation!) it would be to offer a stripped-back starter kit that is ultra-basic in terms of functionality. This was really useful with TC1, where you offered two starter kits - a bare-bones one and a fully-fledged one, but I've found that the starter kit in TC2 is way overkill for a simple starter project and actually quite confusing. It has lots of package dependencies and uses pretty much the full gamut of TC functionality, which is obviously a good thing if it's a show-case of the product, but I've found it quite laborious to strip all of this stuff out and just get back to a simple 'add this product to cart' type of functionality. Personally, I'd prefer to start light and add functionality than start heavy and strip back.
I love Tea Commerce, and the beauty of it is that it's SIMPLE, but I've found that with TC2 the simplicity is very hidden and things seem more complicated than (a) they are, and (b) they used to be with TC1, when actually it's probably simpler than TC1.
Just my two cents anyhow. I know you guys are busy and this will all fall into place eventually. :)
Cool. Thanks for the great feedback. We really appreciate it bad and/or good.
The plan is more documentation as part of the Tea Commerce training courses we are preparing. They will go hand in hand.
/Rune
Hi Dan
What do you think the functionality should be of such a simpler package?
And would you maybe create it? :)
If its a much simpler solution maybe it would be quick for you to create it.
Kind regards
Anders
is working on a reply...