[SOLVED] NOP 2.65 - A little MVC pattern question - what is the proper way to manipulate the view from the controller (is there any?)?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 Jahre weitere
Hello again.

I need to show or hide my custom checkout step, depending on the shipping method selected in previous checkout step. I was able to do it in NOP 1.90, by saving a custom variable in NopContext, but since Nop 2.65 uses MVC pattern, I don't know how to proceed. So the question is - how can I manipulate the view in this way? I was planning to do something like this:

When OpcSaveShippingMethod is called I would check if the appropriated method was selected, and then set some variable that would be checked inside the view, with something like this:

@if(var){show checkout step}else{don't do it}

is something like this possible?

Thanks in advance.
11 Jahre weitere
Anybody? Is there no way to do this?
11 Jahre weitere
Off hand, I'd say to create a new Property in the model, and simply give a value to that property in the Controller for that view.
11 Jahre weitere
Is your step the very next step after shipping selection?  If so you can handle in ActionResult OpcSaveShippingMethod similar to how it checks for "if (isPaymentWorkflowRequired)"
11 Jahre weitere
Thank for the answers and sorry for my late response - I actually did it by populating the model with relevant data, and then by checking it with JavaScript :)

Best regards.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.