I'm running Virtuemart 3.4.2 and when I click to link of a product that has been deleted, the system brings this error "0 - Using $this when not in object context" instead of redirecting to "404 Error-Product Not Found".
Virtuemart 3.4.2
Joomla 3.8.13
PHP 7.1.22
just tested here -- I get a proper message
you need to turn on Joomla debug and full error to find where this error is
Unfortunately I'm not a developer. Could someone please take a look at the link?
https://www.everhome.gr/products/υπνοδωμάτιο/σετ-πάπλωμα-satin-printed-205tc-1428-heidi-detail (https://www.everhome.gr/products/%CF%85%CF%80%CE%BD%CE%BF%CE%B4%CF%89%CE%BC%CE%AC%CF%84%CE%B9%CE%BF/%CF%83%CE%B5%CF%84-%CF%80%CE%AC%CF%80%CE%BB%CF%89%CE%BC%CE%B1-satin-printed-205tc-1428-heidi-detail)
link helps no one .. without full error reporting on to say WHERE this error is occurring
http://forum.virtuemart.net/index.php?topic=121692.0
I'm receiving the existing errors
Notice: Trying to get property of non-object in /var/www/vhosts/everhome.gr/httpdocs/components/com_virtuemart/views/productdetails/view.html.php on line 81
Warning: Declaration of & CustomfieldsForAllFilter::getInstance($tagsArray = Array, $attrArray = Array, $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1) should be compatible with & Joomla\CMS\Filter\InputFilter::getInstance($tagsArray = Array, $attrArray = Array, $tagsMethod = 0, $attrMethod = 0, $xssAuto = 1, $stripUSC = -1) in /var/www/vhosts/everhome.gr/httpdocs/plugins/vmcustom/customfieldsforall/helpers/filter.php on line 0
Notice: Trying to get property of non-object in /var/www/vhosts/everhome.gr/httpdocs/plugins/vmcustom/customfieldsforall/customfieldsforall.php on line 815
The code inside view.html.php
$product_model->withRating = $this->showRating = $ratingModel->showRating($virtuemart_product_id);
$product = $product_model->getProduct($virtuemart_product_id,TRUE,TRUE,TRUE,$quantity);
$this->assignRef('product', $product);
$last_category_id = shopFunctionsF::getLastVisitedCategoryId();
$customfieldsModel = VmModel::getModel ('Customfields');
line 81: if ($product->customfields){
$customfieldsModel -> displayProductCustomfieldFE ($product, $product->customfields);
}
they are only warnings/notices and 2 are not from VM
this has nothing to do with the subject of your post
Ok thanks.
Is there a way to download VM 3.4.0 where everything worked just fine?
It seems that the problem is coming from Virtuemart 3.4.2 «404 Error Handling». So I disabled it and created a custom Joomla 3.8.13 «404 redirection page».
Please use this package http://dev.virtuemart.net/attachments/download/1146/com_virtuemart.3.4.3.9973_package_or_extract.zip
Hello Max
Thank you for your help. This solution brings up the right message, but it redirects wrongly. The redirection page is something like a mix of non-found-product category view and product details view. Very weird.
which is not possible. It should call the last correctly opened category
For example, If I load https://www.mysite.com/products/category/product-detail the 404 error handling produces the proper message and redirects me to the same url https://www.mysite.com/products/category/product-detail and not the desired one which is https://www.mysite.com/products/category/. Thus the outcome is a weird page view. How can I omit the product-detail part on the redirections?
Anybody?
I just can say, that it works in my case
404 The requested product does not exist.
for index.php/en/product-attributes/default-pro45duct-detail with the sample data.
and I opened first the category index.php/en/product-attributes and then the product default-product-detail