Post by screwtape_mk » Sat Aug 19, 2017 5:39 pm

Hi

I have created Gift Voucher as a category and have made it appear here:
http://liomi.co.za/index.php?route=common/home

Now i want to specify the redirect route of that Gift Voucher Tab to:

http://liomi.co.za/index.php?route=account/voucher

Instead of where it currently is:

http://liomi.co.za/index.php?route=prod ... ry&path=73

New member

Posts

Joined
Sun May 14, 2017 2:39 am

Post by sachin6609 » Mon Aug 21, 2017 7:03 pm

Hii

You can do it by little custome

But Why you add that opencart page in the category..??

i can do that by costume code easily

Thanks

Sachin

Active Member

Posts

Joined
Thu Jul 23, 2015 2:57 pm

Post by screwtape_mk » Fri Dec 01, 2017 4:01 am

Hi

Sorry for the late response- but i still need your help with this; what would would you need from me in order to produce

New member

Posts

Joined
Sun May 14, 2017 2:39 am

Post by sachin6609 » Mon Dec 04, 2017 1:28 pm

screwtape_mk wrote:
Fri Dec 01, 2017 4:01 am
Hi

Sorry for the late response- but i still need your help with this; what would would you need from me in order to produce
Hii

sure I will Help You

Let Me know Which Opencart version you are using..?

So i can help you to edit the files

Thanks

Sachin

Active Member

Posts

Joined
Thu Jul 23, 2015 2:57 pm

Post by opencartboost » Mon Dec 04, 2017 6:46 pm

That is easy.
Open file category.php in folder catalog/controller/product/category.php
Find :

Code: Select all

$category_info = $this->model_catalog_category->getCategory($category_id);
Before, add:

Code: Select all

if ($category_id == '73') {
	$this->response->redirect($this->url->link('account/voucher'));
}
73 is your category_id, may be need change that.

Active Member

Posts

Joined
Thu Jul 09, 2015 5:59 am

Post by screwtape_mk » Tue Jan 16, 2018 9:43 pm

Thanks so much opencartboost

I will try out your solution - do you mind explaning what Category Id is so i can put the correct Id; since you said i may have to change that

New member

Posts

Joined
Sun May 14, 2017 2:39 am

Post by Johnathan » Tue Jan 16, 2018 11:28 pm

Just to note, if you want to do this without having to edit files manually yourself, my Redirect Manager extension can do this. You enter the URL your want to redirect, and then can redirect it wherever you want. It should work for your purpose, if you can't (or don't want to) get the manual edit working.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by screwtape_mk » Wed Jan 17, 2018 2:31 am

Hi

I have added this line of code:

if ($category_id =='73')
{
$this->response->redirect($this->url->link('account/voucher'));
}



Before this line:
$category_info = $this->model_catalog_category->getCategory($category_id);

Nothing changed. Im using version 2.0.1.1

New member

Posts

Joined
Sun May 14, 2017 2:39 am

Post by Johnathan » Wed Jan 17, 2018 11:26 pm

If you have any ocMods installed, don't forget to refresh your ocMod cache in Extensions > Modifications after making an edit. If any ocMod edits the same file you did, your edit won't be active until you refresh the cache.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by screwtape_mk » Fri Jan 19, 2018 9:03 pm

It worked - except every Category or Category item redirects to :

http://liomi.co.za/index.php?route=account/voucher

New member

Posts

Joined
Sun May 14, 2017 2:39 am

Post by screwtape_mk » Sat Jan 20, 2018 1:52 am

Hi

Thanks once again for your help my problem has been solved.
I just now need to redirect all the products in the that are listed in the Category tabs to their actual product pages.
For instance 'Female Fragrances >212 VIP Carolina Herrera' redirects to

http://liomi.co.za/index.php?route=prod ... h=25_32_65

I would like it to redirect to :

http://liomi.co.za/index.php?route=prod ... duct_id=43

New member

Posts

Joined
Sun May 14, 2017 2:39 am
Who is online

Users browsing this forum: No registered users and 8 guests