I don't understand why such basic things are not explain in docs.
I want to change URLs such as
https://nnkaravan.dev/index.php?route=account/login
https://nnkaravan.dev/index.php?route=account/register
to
https://nnkaravan.dev/login
https://nnkaravan.dev/register
I made necessary updates to enable SEO URL's.
There are similar questions to this in this forum but they are mostly asked for Opencart v2.x
Some of the answers suggested extenstions (which are also does not support Opencart v3.x). It is basic need so it is a shame if I will need to install an extension for it. I did not find anything about how routing works in OpenCart docs.
Thanks in advance.
You obviously expect everything for OC, to come for free. Butit is a shame if I will need to install an extension for it.
OC is not a welfare Project for the poor, one just has to use Google and
some other Sites, to find out, what one's looking for, or then pay someone,
like in any other business too, to get it made, if one cannot achieve it.
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
I am actively using Symfony and Codeigniter PHP frameworks. Following their documentation I can find answer for most of my needs.IP_CAM wrote: ↑Thu Sep 03, 2020 9:15 pmYou obviously expect everything for OC, to come for free. Butit is a shame if I will need to install an extension for it.
OC is not a welfare Project for the poor, one just has to use Google and
some other Sites, to find out, what one's looking for, or then pay someone,
like in any other business too, to get it made, if one cannot achieve it.
It is not about being poor, I am a developer, I like to solve things myself, but Opencart documentation is not written for developers.
Need to waste some time and dig into code.
Using SEO URL's became a basic need it should be implemented within framework. I did not make a choice of using OpenCart for this project, and I am very frustrated of Opencart
in catalog/controller/startup/seo_url.php you have:
Code: Select all
} elseif ($key == 'path') {
$categories = explode('_', $value);
foreach ($categories as $category) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
} else {
$url = '';
break;
}
}
unset($data[$key]);
}
change that to:
Code: Select all
} elseif ($key == 'path') {
$categories = explode('_', $value);
foreach ($categories as $category) {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = 'category_id=" . (int)$category . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . (int)$this->config->get('config_language_id') . "'");
if ($query->num_rows && $query->row['keyword']) {
$url .= '/' . $query->row['keyword'];
} else {
$url = '';
break;
}
}
unset($data[$key]);
} elseif ($key == 'route') {
// no need to query root
if ($value == 'common/home') {
$url = '/';
} else {
$sql = "SELECT * FROM " . DB_PREFIX . "seo_url WHERE `query` = '" . $this->db->escape($value) . "' AND store_id = '" . (int)$this->config->get('config_store_id') . "' AND language_id = '" . $this->config->get('config_language_id') . "'";
$query = $this->db->query($sql);
if ($query->num_rows) {
if ($url != '/') $url .= '/';
$url .= $query->row['keyword'];
unset($data[$key]);
}
}
}
then you can add any other route like account/login in admin->design->seo url and it removes common/home
Crystal Light Centrum Taiwan
Extensions: MailQueue | SUKHR | VBoces
“Data security is paramount at [...], and we are committed to protecting the privacy of anyone who is associated with our [...]. We’ve made a lot of improvements and will continue to make them.”
When you know your life savings are gone.
We are looking for documentation writers, would you volunteer?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Well, a Documentation for OC should not be needed for DEV's, but for OC Users, becauseI like to solve things myself, but Opencart documentation is not written for developers.
Developers usually already know PHP, and what else might be part of such. But, in contrary
to a lot of Code, available at the Web, OpenCart ONLY serves one Purpose, and that Purpose
is, to create income, in one or the other way
But who would support others, and help someone, eventually ending up as direct Competitor ?!
It's one of the main problems, when it comes to such Software. And it's more a miracle, that the
OC 'Community' Idea worked so long, compared with other Projects, I've been following, during
all those Years on the Web. And as more 'complex' a Projects gets, as less 'free' is usually part of it,
by Nature of all 'business' things, that just needs to be understud.
Still, one can find lot's of 'basic' information on/about OpenCart, but it's mostly for 'older' Versions,
and out of a time, when the 'Sharing-Idea' was still part of it. I collected a range of such Links on
my Demo Site Front Pages, in the Section: Lots of free Wisdom about Opencart, and you might
find some useful 'basic' OC info, partly still valid for later OC Versions too:
http://www.bigmax.ch/shop/index.php
Just better take it, as it comes, it's of no use, to complain, because nobody else will care about ...
Ernie
My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.
Users browsing this forum: No registered users and 219 guests