Change Opencart 2 success page - opencart

Where can I change the URL for my OpenCart 2 success page?
The way that my site is set up, open cart is a module of the larger site.
On completion of an order I need the user to be returned to a page within the main site rather than the opencart.
Alternately, changing the URL for the "Continue" button would work, but from an analytics perspective , that would be inferior.

Go to Catalog/view/theme/yourtheme/common/header.tpl
And add this code to it
$current_url = $_SERVER['REQUEST_URI'];
if (strpos($current_url,"checkout/success")) {
header("Location: Yourdomain");
}
And you change the "Yourdomain" to the page that you want it to be redirected to just copy and paste your domain.
If you are using some custom URL's that a module generates them than you need to change the "checkout/success" to what ever URL your success page is at.

Just add this to controller/checkout/success.php
$this->response->redirect('http://www.yoursite.com');
Just make sure that redirect code is added after cart and session clearing. In my version you, can add it to line 47.

Related

OpenCart products links on home page are not pointing to correct url

I've started setting up opencart for my online store, everything was working correctly till yesterday, but now its showing some incorrect behavior. On main page I have some "featured" products , When a user click on it, it should navigate user to that product's page for details and url is something like following
http://mystore.com/index.php?route=product/product&path=57&product_id=49
but the url which is its navigating to is something like
http://mystore.com/iphone
hence its not navigating user to product's page and stays on same page (i.e. index page).
Also, I'm unable to login to my admin panel.
I guess I've done something wrong but can't track it. Any help would be highly appreciated.
Store url is this
Thanks
There is something very not alright with .htaccess file in the root folder of your site. Try to rename it back to .htaccess.txt .
OR
Rename .htaccess.txt to .htaccess. Looks like you have you turned on SEO setting in admin but it requires .htaccess file.
Although check if you have right url addresses in both config.php files, root and admin.

Programmatically create Redirects in Wagtail

Is there a way to programmatically create functioning Redirect objects in Wagtail?
I am trying the obvious (naively creating the object):
Redirect.objects.create(old_path='/test', redirect_link='https://stackoverflow.com')
This creates a Redirect that is visible in the Wagtail admin panel, however navigating to /test simply 404s without redirecting.
However, if I then save the Redirect from the admin panel, it suddenly works.
Is there some special post-save logic I need to run in order to activate the redirect? I looked through the source and could not find anything.
User error - I believe I was running into DNS caching issues that prevented the redirect from working. My original code seems to work fine now.

django redirect is applied to all projects directly

I was studying mozilla django tutorial and in between that I came across one point where I have to redirect the url ' ' to '/catalog/' with permanent = True.
Now I have one new project (another project in different directory ) with django-admin and gave the command of manage.py runserver (notice I haven't made any changes in this project) the url '' is automatically being redirect to '/catalog/' in chrome it works fine in opera mini though.
It’s probably not a Django issue, but due to Chrome caching certain requests. You could try a hard refresh of the page:
https://www.getfilecloud.com/blog/2015/03/tech-tip-how-to-do-hard-refresh-in-browsers/
Unless the redirect is being handled by some unusual Javascript (and you are doing this in Django so probably not), you probably just need to refresh the page. Hold the shift key while clicking on the refresh button in Chrome.
This is because chrome has cached this particular redirect and uses it without checking with the server. You can get rid of this by clearing your browser cache - but you might not want to do this because you'll lose other data too. Instead, right click on the page in question and go to developer tools (or hit F12). Go to the Network tab and tick "Disable cache". Now refresh the page without the redirected part of the url, and the page should load correctly. Now close developer tools and it should continue to work as intended.
I solved it by deleting the browser history(going to Advanced mode and selecting everything).

How to change hashbang url to history API

I'm using ember1.0-rc3, i want to change hashbang urls into normal url format (ie, www.site.com/admin#/page1 to www.site.com/admin/page1).In order to make this change,i use location: "history" in app router.
But when i reload a page or bookmark a page doesn't works, it redirects to home page only.I want the options reload and bookmark in my app, without changing redirect urls in .htaccess file.Is there any way for it?Thanks in advance
In order to use HTML5 history with a single page app like ember, your server must be have the behavior of rendering your main index.html file for any URL. The Ember router has the logic to look at the URL when it loads and go to the correct route.

Web Forms for Marketers Redirects to bad path

Why doesn't WFFM use the LinkManager to get the URLs of success redirect items? In web.config, I have the following settings for my site:
rootPath: /sitecore/content/My Site
startItem: /Home
If I browse to www.MySite.com, it works just fine: the Home item shows. Everything I link to using LinkManager.GetItemUrl works just fine.
For my Web Form, I've chosen the success item: /sitecore/content/My Site/Home/Some Directory/Thank You
However, after completing the Web Form, WFFM tries to redirect the user to www.MySite.com/My%20Site/Home/Some%20Directory/Thank%20You (I would expect it to redirect to www.MySite.com/Some%20Directory/Thank%20You)
I've had this problem as well, the only way I've been able to rectify the situation is to manually input the path you're expecting in the actual field for the success item.