Checkout Controller method in Opencart - opencart

I'm using Opencart 1.5.6. I want to modify index function in catalog/controller/checkout/payment_method.php, just for my extension. So, is there any way to override index function ?

Related

Hide a field on changing of Ticket Status in Vtiger

Hi I want to Hide Some Fields like Ticket solution when Ticket Status is changed to open. How to do it ?
Adding to the above comments , you can also copy Edit.js inside layouts > v7 > modules > Helpdesk > resources from some other layout. There you can write your own code inside registerEventForPicklistDependencySetup function. Dont forget to remove other unwanted functions.
I would recommend using javascript for that task. Use a jquery selector to retrieve the value of ticketstatus and hide the container of the solution field if depending on the status.
You can use jQuery to perform the task. In vTigerCRM the actual name of the ticket module is HelpDesk. So to change the detail view of ticket module you need to edit layouts/vlayout/modules/HelpDesk/DetailViewHeaderTitle.tpl
file. For your reference, I am providing you with a sample.

How to make a statically binded rendering editable via Experience Editor (Sitecore MVC)

So I have a layout view within Sitecore Mvc, this view contained a Controller Rendering that pulls in a header and footer navigation. Example:
#Html.Sitecore().Rendering("/sitecore/layout/renderings/some_rendering")
This specifies a Controller Rendering I've defined in Sitecore. This works great, except when I'm in the experience editor. It doesn't give me the ability to select this rendering. If I create a Placeholder and then define these navigation elements to this placeholder dynamically via Sitecore, then I can, but these navigational elements exist on every page of this layout, so I would like them statically placed instead of using a Placeholder, but I would still like the user to be able to select the navigation element in the experience editor (so I can create custom command to interact with this navigation, such as creating new links, etc).
Does anyone have an idea that will help me achieve this?
Use Edit Frame for that and create Custom Edit Frame Button for operations like adding new element to the navigation.
And remember to pass Datarsource ID or Path as a second parameter to the Html.Sitecore().Rendering() method:
#Html.Sitecore().Rendering("/sitecore/layout/renderings/some_rendering", new { DataSource = "{some-id-or-path}" })
Here is set of blog posts which can help you to understand how Edit Frames work and how to add them in Sitecore MVC solution:
https://visionsincode.wordpress.com/2015/01/08/how-to-use-editframe-in-sitecore-mvc/
https://www.cmsbestpractices.com/how-to-properly-use-sitecore-edit-frames/
https://briancaos.wordpress.com/2011/11/28/using-sitecore-editframe-in-pageedit/
You won't be able to remove the component or move it around the page (yeah, it's statically bound to one place on your layout), but you will be able to edit it's properties and datasource.
You can try to use GlassMapper views and statically inherit the view from the GlassView.
Then you'll be able to use Editable method to render the field.
But the consideration you need to take is that you'll not be able to set a datasource to the component from the page editor or content editor.
Instead of injecting the rendering through the Rendering method you should be able to use standart MVC RenderPartial.
I've used this approach on one of the projects I've been on and it worked.

How to Get Datasource from sublayout using glassmapper

I know in MVC you could do this.GetLayoutItem<Model>() to get the datasource of rendering on a page. How do we make use of this in sublayouts (.ascx)?
If you inherit your user control from the GlassUserControl the AbstractGlassUserControl has properties for LayoutItem which will give you the datasource if its defined or there is a DataSourceItem property which returns the datasource explicitly.
Using GlassUserControl

fetch list of sublayouts used by item in sitecore

I'm using Sitecore 7.1 with MVC.
I need to get the item ID of the sublayout or rendering used for a particular Sitecore items.
Is there a way i fetch list of sublayouts/rendering used by an item in sitecore using .net.
Could some post the necessary code for that.
Thanks
The traditional way to get an array of renderings prior to Sitecore MVC is:
Sitecore.Context.Item.Visualization.GetRenderings(Sitecore.Context.Device, false)
I believe this will return a list of renderings in both a WebForms and MVC context.
Specific to MVC, you can also get a list of renderings by using the current RenderingContext or PageContext via:
RenderingContext.Current.PageContext.PageDefinition.Renderings
or
PageContext.Current.PageDefinition.Renderings
Please try below code
Sitecore.Context.Database.GetItem(((Sublayout)Parent).RenderingID);
Also see Using the DataSource Field with Sitecore Sublayouts.

Output of one view function to another in django

I have a view function which validates a form and get values from it.
I want to use the values stored in the first view function in another view function.
can anyone please tell me how can it be done as I am a newbie to Django.
You obviously need django wizard form