I am experiencing an issue with a particular type of discount that I am setting up, basically I am creating a discount so that if a member of a particular member group is logged in, and they apply the supplied discount code they get 100% off the order total, see below for setup in backend.
The issue during checkout is that if I apply the code on the information page, then the discount does not get applied, it only gets applied "after" I have selected a payment method and landed on the "review" page. If I then step back to the payment method the standard zero value message then appears.
At first I thought it was something specific to my solution, but I have tried discount codes that don't involve member groups and the discount is applied fine and shows on the information page as it should as soon as the discount code is submitted.
Are you able to give this scenario a try and confirm if it is indeed a bug in the checkout process? For your reference I have got the latest version of Vendr 1.2.10 and Vendr Checkout 1.1.5 installed.
The only reason I could think this would happen is if the order isn't assigned to the member. Currently this happens at two points, 1) when the order is created and 2) when the BeginPaymentForm method is called in the review step.
If your member logged in after the order was created then it wouldn't get assigned to them untill the payment review step, which might explain why it takes them needing to get to the review stage for the discount to apply.
Does this happen to all orders? ie, if you placed this order, and then started a new one when you know they are definitely logged in and the order is created after they are logged in. Or is it potentially only under this scenario where the order was created prior to login?
If it is the later, you might need to add something to your login routine that says if the member has a current order when they sign in, then assign the order to that member via order.AssignToCustomer(currentMember.Key.ToString())
When you say creating an order in the standard way, do you mean via Order.Create or via the sessions managers _sessionManager.GetOrCreateOrder()? If its the later, this should be assigning the member. If it's the former, then yes, you will need to call AssignToCustomer yourself.
It might be worth tracking the orders order.CustomerInfo.CustomerReference to see whether the order is actually assigned to a member or not. If it's empty, then it's not assigned.
Well the code I am to create an order is as follows, so I am using the the _sessionManager.GetOrCreateOrder() way.
When I get to it tonight I will track the CustomerReference and see if the order is assigned to the member or not when I hit the information page from the basket.
just before I save the order when creating it for the first time as was shown in the previous post. I can confirm that now I am calling it manually that the customer reference is set correctly and discounts are applied.
If you find out what the issue is and create a fix, let me know and I will remove the manual piece of code.
Member Group Discount Issue
Hey Matt,
I am experiencing an issue with a particular type of discount that I am setting up, basically I am creating a discount so that if a member of a particular member group is logged in, and they apply the supplied discount code they get 100% off the order total, see below for setup in backend.
The issue during checkout is that if I apply the code on the information page, then the discount does not get applied, it only gets applied "after" I have selected a payment method and landed on the "review" page. If I then step back to the payment method the standard zero value message then appears.
At first I thought it was something specific to my solution, but I have tried discount codes that don't involve member groups and the discount is applied fine and shows on the information page as it should as soon as the discount code is submitted.
Are you able to give this scenario a try and confirm if it is indeed a bug in the checkout process? For your reference I have got the latest version of Vendr 1.2.10 and Vendr Checkout 1.1.5 installed.
Many thanks,
Graham
Hey Graham,
The only reason I could think this would happen is if the order isn't assigned to the member. Currently this happens at two points, 1) when the order is created and 2) when the
BeginPaymentForm
method is called in the review step.If your member logged in after the order was created then it wouldn't get assigned to them untill the payment review step, which might explain why it takes them needing to get to the review stage for the discount to apply.
Does this happen to all orders? ie, if you placed this order, and then started a new one when you know they are definitely logged in and the order is created after they are logged in. Or is it potentially only under this scenario where the order was created prior to login?
If it is the later, you might need to add something to your login routine that says if the member has a current order when they sign in, then assign the order to that member via
order.AssignToCustomer(currentMember.Key.ToString())
Matt
Hey Matt,
So this is happening even when an order is created after the member has logged in.
I think what I am missing is the "order.AssignToCustomer" line as I am just currently creating an order in the standard way.
Thanks for the heads up, I will give the above a try tonight and let you know if it resolves it (I am sure it will).
Graham
When you say creating an order in the standard way, do you mean via
Order.Create
or via the sessions managers_sessionManager.GetOrCreateOrder()
? If its the later, this should be assigning the member. If it's the former, then yes, you will need to callAssignToCustomer
yourself.It might be worth tracking the orders
order.CustomerInfo.CustomerReference
to see whether the order is actually assigned to a member or not. If it's empty, then it's not assigned.Matt
Well the code I am to create an order is as follows, so I am using the the _sessionManager.GetOrCreateOrder() way.
When I get to it tonight I will track the CustomerReference and see if the order is assigned to the member or not when I hit the information page from the basket.
Then yea, that should be tracking it.
Do let me know what you find as if it's nor persisting, that is a bug.
Matt
Hey Matt,
So I have given this a try tonight and am outputting
on the information page of Vendr checkout and there is no value output, so it is definitely not persisting for some reason.
I have got around this for now by calling:
just before I save the order when creating it for the first time as was shown in the previous post. I can confirm that now I am calling it manually that the customer reference is set correctly and discounts are applied.
If you find out what the issue is and create a fix, let me know and I will remove the manual piece of code.
Graham
Strange 🤔
I’ll take a look tomorrow though and see if I can see what is going on.
Thanks for confirming and glad we have an interim workaround.
is working on a reply...