ErrorDocument 404 index.php?route=error/not_found
But when we do this, the 404 page is a white screen with just "index.php?route=error/not_found" printed on screen...EXCEPT if the product has been disabled rather than deleted - if the product is disabled, it shows the correct customised 404 page.
Ernie
---
Custom vqmod404
https://www.opencart.com/index.php?rout ... n_id=21264
---
Smarter 404
https://www.opencart.com/index.php?rout ... n_id=21506
---
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.
" It is for Developers only to further improve it and not for direct users. As it may have some more errors. "
I don't want an extension with errors as I'm working on a live website environment.
The second extension apparently replaces your 404 page with a list of similar products containing a matching keyword. Whilst this is interesting, the extension hasn't been updated in 2 years, and some of the comments states that it simply doesn't work in all cases, including "It looks like a great one but it doesn't work, shows a blank page.."
The methodology is flaw. Implementing solutions should never be done on a live website directly but rather having a test environment where the solution can be tested before implementing the solution into the live website.I don't want an extension with errors as I'm working on a live website environment.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
That theory would be incorrect. Development servers are meant to test features to avoid on corrupting live servers while being in production mode as to avoid server maintenance. The need still applies for those cases so to avoid fallbacks due to misprocesses. Creating a new layout is no different. Testing the layout among other installed features is in fact highly recommended to be done on a dev environment before applying the change to the production environment.You don't need a development environment to add a new layout, and I followed the instructions to the letter about adding new layout to certain pages.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Diagnosing your 404 problem, can you invoke your 404 directly from the browser? If it works, the problem may be your .htaccess. If it doesn't work (such as a blank screen), the problem is likely in the code somewhere. At least confirm that it's one or the other, and eliminate causes.
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
https://www.remnanthousefabric.co.uk/cr ... ag-batting
Sample of a disabled product with correct 404:
https://www.remnanthousefabric.co.uk/ja ... collection
https://www.remnanthousefabric.co.uk/aaa
Suppliers Module - XML, CSV, XLS Product Feed Import and Update
Rich Snippets | Facebook Open Graph Meta Tags | WebP Images
Than you can add modules to it creating a layout for it in admin.
If you need help contact me at agatha65@gmail.com
Suppliers Module - XML, CSV, XLS Product Feed Import and Update
Rich Snippets | Facebook Open Graph Meta Tags | WebP Images
"I created a layout called 'error page' and set the route of that page to error/not_found so I could add modules to improve the look of the page. This didn't override the error page unfortunately so I sought some help. "
My issue is specifically for deleted products - disabled products work just fine.
Let's test this theory. In your admin/controller/catalog/product.php file, in the delete() method,My issue is specifically for deleted products - disabled products work just fine.
find:
Code: Select all
$this->response->redirect($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, true));
Code: Select all
echo '<br><br>I can see the step where validateDelete() completes its process!';
exit;
find:
Code: Select all
$this->cache->delete('product');
Code: Select all
echo 'I can see the steps where the products actually gets deleted!';
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Before I deleted this product in it's disabled state, the front end of the site would display the correct not found page - first screenshot. After deletion, I refresh this page on the front end, and got my original error - see later screenshot.
Attachments
error - second screenshot - Screen Shot 2018-04-04 at 16.42.04.png (118.46 KiB) Viewed 2923 times
first screen shot - Screen Shot 2018-04-04 at 16.40.26.png (1.32 MiB) Viewed 2923 times
That was the point of my modifications above and as indicated, it would show you two other messages. Were you able to see those messages?I have tried your steps on a test site I've created, and I can't see any additional messages other that "Success: You have modified products".
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
In the first file, modified to:
public function delete() {
$this->load->language('catalog/product');
$this->document->setTitle($this->language->get('heading_title'));
$this->load->model('catalog/product');
if (isset($this->request->post['selected']) && $this->validateDelete()) {
foreach ($this->request->post['selected'] as $product_id) {
$this->model_catalog_product->deleteProduct($product_id);
}
$this->session->data['success'] = $this->language->get('text_success');
$url = '';
if (isset($this->request->get['filter_name'])) {
$url .= '&filter_name=' . urlencode(html_entity_decode($this->request->get['filter_name'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_model'])) {
$url .= '&filter_model=' . urlencode(html_entity_decode($this->request->get['filter_model'], ENT_QUOTES, 'UTF-8'));
}
if (isset($this->request->get['filter_price'])) {
$url .= '&filter_price=' . $this->request->get['filter_price'];
}
if (isset($this->request->get['filter_quantity'])) {
$url .= '&filter_quantity=' . $this->request->get['filter_quantity'];
}
if (isset($this->request->get['filter_status'])) {
$url .= '&filter_status=' . $this->request->get['filter_status'];
}
if (isset($this->request->get['sort'])) {
$url .= '&sort=' . $this->request->get['sort'];
}
if (isset($this->request->get['order'])) {
$url .= '&order=' . $this->request->get['order'];
}
if (isset($this->request->get['page'])) {
$url .= '&page=' . $this->request->get['page'];
}
$this->response->redirect($this->url->link('catalog/product', 'token=' . $this->session->data['token'] . $url, 'SSL'));
echo '<br><br>I can see the step where validateDelete() completes its process!';
exit;
}
In the second file modified to:
public function deleteProduct($product_id) {
$this->event->trigger('pre.admin.product.delete', $product_id);
$this->db->query("DELETE FROM " . DB_PREFIX . "product WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_attribute WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_description WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_discount WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_filter WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_image WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_option WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_option_value WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_related WHERE related_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_reward WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_special WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_category WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_download WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_layout WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_to_store WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "review WHERE product_id = '" . (int)$product_id . "'");
$this->db->query("DELETE FROM " . DB_PREFIX . "product_recurring WHERE product_id = " . (int)$product_id);
$this->db->query("DELETE FROM " . DB_PREFIX . "url_alias WHERE query = 'product_id=" . (int)$product_id . "'");
$this->cache->delete('product');
echo 'I can see the steps where the products actually gets deleted!';
$this->db->query("DELETE FROM " . DB_PREFIX . "product_accessory WHERE product_id = '" . (int)$product_id . "'");
$this->event->trigger('post.admin.product.delete', $product_id);
}
Users browsing this forum: No registered users and 22 guests