Marco Expressions for eCommerce Shopping cart

Dcode warner asked on April 7, 2017 18:04

Do anyone know the correct macro expressions / variables for the following in the Kentico eCommerce Shopping Cart. Or where Can I find a list/library of them? Example: {%TotalPrice%}

TotalPrice TotalShipping PaymentOption OrderInvoiceNumber OrderDate

Correct Answer

Peter Mogilnitski answered on April 7, 2017 18:39

{%ECommerceContext.CurrentShoppingCart.TotalPrice |(identity)GlobalAdministrator%} For the list of macro objects I don't remember exactly but Image Text At the bottom menu bar there is a button {#} (not sure if it was in 7). It gives you macro object tree. For Kentico 7 you can use K# and Macro Engine Test UI

0 votesVote for this answer Unmark Correct answer

Recent Answers


Dcode warner answered on April 7, 2017 18:51 (last edited on April 7, 2017 19:05)

Thank you so much! These works and what I've been looking for! However can't seem to find any for "OrderInvoiceNumber" "OrderDate" --> {#} is not in kentico 7 < --

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on April 7, 2017 21:22 (last edited on December 10, 2019 02:30)

You are welcome, just mark it as the answer so the others can use it in the future.

OrderInvoiceNumber should be in orders for example: {% CommerceContext.CurrentCustomer.Orders.LastItem.OrderInvoiceNumber |(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

Dcode warner answered on April 7, 2017 22:26 (last edited on December 10, 2019 02:30)

I will [ edited] This works for me for Order invoice Number: {%ECommerceContext.CurrentShoppingCart.ShoppingCartCustomer.AllOrders.FirstItem.OrderInvoiceNumber|(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

Dcode warner answered on April 7, 2017 23:39 (last edited on December 10, 2019 02:30)

I thought this was working. But it look like it's not anymore: {%ECommerceContext.CurrentShoppingCart.ShoppingCartCustomer.AllOrders.FirstItem.OrderInvoiceNumber|(identity)GlobalAdministrator%}

0 votesVote for this answer Mark as a Correct answer

Peter Mogilnitski answered on April 8, 2017 02:35 (last edited on December 10, 2019 02:30)

OrderInvoiceNumber should be under .Orders or .AllOrders of Customer/User objects. The only thing to keep in my is that while a user is in his shopping cart you don't have the current order. As soon as he goes to a payment processor at the last step of the shopping cart - shopping cart info gets transferred to order info - the order gets created. You can't really get the info for the present order of the shopping cart, because the order does not exist yet. You might try {%ECommerceContext.CurrentShoppingCart.ShoppingCartUser.Orders.LastItem.OrderInvoiceNumber |(identity)GlobalAdministrator%}

1 votesVote for this answer Mark as a Correct answer

Dcode warner answered on April 24, 2017 16:58 (last edited on April 24, 2017 17:23)

These variable works when I'm signed in but not for guests when I select "Continue as a guest". How can I adjust the script to make it work for both?

0 votesVote for this answer Mark as a Correct answer

Dcode warner answered on June 29, 2017 19:20

Hey there.

I need to revisit this question again. (sorry about this) It's regarding the last comment.

Is there a work around to display the 'Order number' and 'Order date' for guests (not signed in) Im able to generate for price/total shipping and payment option but not for the ID. I understand these are not generated until the order is placed? Is this correct?

What's a good work around so I can get the ID number since it's displaying right there on the page.ugh: [screenshot] http://prntscr.com/fpodxy

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.