I'm using a theme called techone and it's mostly working but when I come to using advanced grid module and the products tabs type column it's displaying the product name from the last product in the products grid with carousel instead of the module title name. It should display Featured Categories.
I have attached a screenshot of the issue.
I checked the error log and only thing related to it that I can see is the following
[17-Jul-2024 20:14:20 Europe/London] PHP Fatal error: Cannot declare class ControllerExtensionModuleAdvancedGrid, because the name is already in use in /home/itdoneri/public_html/shop/catalog/controller/extension/module/advanced_grid.php on line 0
If that is the issue, I'm not sure how to solve it but I Googled the issue and it sounds like another extension may be using the same class name but I may be wrong but if that is the case, is there anyway to try and find which extension is using the same class name or is it just disabling each one until the issue is resolved
I am using version 2.3.0.2
I have attached a screenshot of the issue.
I checked the error log and only thing related to it that I can see is the following
[17-Jul-2024 20:14:20 Europe/London] PHP Fatal error: Cannot declare class ControllerExtensionModuleAdvancedGrid, because the name is already in use in /home/itdoneri/public_html/shop/catalog/controller/extension/module/advanced_grid.php on line 0
If that is the issue, I'm not sure how to solve it but I Googled the issue and it sounds like another extension may be using the same class name but I may be wrong but if that is the case, is there anyway to try and find which extension is using the same class name or is it just disabling each one until the issue is resolved
I am using version 2.3.0.2
Attachments
advanced_grid_issue.jpg (136.32 KiB) Viewed 2442 times
You could search in all the .php files, including in storage/modification for "ControllerExtensionModuleAdvancedGrid". This should tell you if you have 2 classes with the same name.
Thank you, what's the quicker way to do it or do I need to open every php file I find in both the admin and catalog and storage/modification folder and search for that line?ADD Creative wrote: ↑Thu Jul 18, 2024 9:28 pmYou could search in all the .php files, including in storage/modification for "ControllerExtensionModuleAdvancedGrid". This should tell you if you have 2 classes with the same name.
I downloaded a tool called agent ransack and searched the files for ControllerExtensionModuleAdvancedGrid and it found 4 files that has the code in
Below is the files it found with the code in
admin\controller\extension\module\advanced_grid.php
catalog\controller\extension\module\advanced_grid.php
itshopadmin\controller\extension\module\advanced_grid.php
system\storage\modification\catalog\controller\extension\module\advanced_grid.php
My admin folder where I login is itshopadmin, should I maybe remove the file in the admin folder or because the issue looks like it's on the front end, should I look at the two files catalog\controller\extension\module\advanced_grid.php and system\storage\modification\catalog\controller\extension\module\advanced_grid.php
Below is the files it found with the code in
admin\controller\extension\module\advanced_grid.php
catalog\controller\extension\module\advanced_grid.php
itshopadmin\controller\extension\module\advanced_grid.php
system\storage\modification\catalog\controller\extension\module\advanced_grid.php
My admin folder where I login is itshopadmin, should I maybe remove the file in the admin folder or because the issue looks like it's on the front end, should I look at the two files catalog\controller\extension\module\advanced_grid.php and system\storage\modification\catalog\controller\extension\module\advanced_grid.php
It's OK to have the class in the admin and catalog as they are effectively separate applications. I can't see why you should have two admin directories.
The file in storage\modification will be used in place of the one in catalog\controller\extension\module\ as it is the same file just with modifications, so that looks OK. You could check the differences between the files to see what modifications have been made.
The next step would be disabling extensions and modifications one by one to see if any are causing the issue.
The file in storage\modification will be used in place of the one in catalog\controller\extension\module\ as it is the same file just with modifications, so that looks OK. You could check the differences between the files to see what modifications have been made.
The next step would be disabling extensions and modifications one by one to see if any are causing the issue.
I'm scared to delete the admin folder just in case It causes a issue with something else on the site.ADD Creative wrote: ↑Thu Jul 18, 2024 11:35 pmIt's OK to have the class in the admin and catalog as they are effectively separate applications. I can't see why you should have two admin directories.
The file in storage\modification will be used in place of the one in catalog\controller\extension\module\ as it is the same file just with modifications, so that looks OK. You could check the differences between the files to see what modifications have been made.
The next step would be disabling extensions and modifications one by one to see if any are causing the issue.
I compared the two files side by side using a online tool and the file in system\storage\modification\catalog\controller\extension\module\advanced_grid.php has some google tag manager code added to it
I'll disable extensions and modifications that I can and see if any are causing the issue and I'll report back in a bit with a update
Found the modification file that's causing the issue, it's the Google Tag Manager modification file as I disabled each modification one by one and still had the issue until I disabled the Google Tag Manager one and the issue was resolved and was displaying Featured Products instead of a product name for the module title.
I've looked the modification file for Google Tag Manager and found the following in it
Is it best to add that code directly into the advanced_grid.php file or will that still cause issues or should I contact the developer and mention the issue and see if they can update it to work with custom themes?
I've looked the modification file for Google Tag Manager and found the following in it
Code: Select all
<file path="catalog/controller/extension/module/advanced_grid.php">
<operation error="skip">
<search><![CDATA[public function index($setting) {]]></search>
<add position="after"><![CDATA[
$this->load->model('catalog/tagmanager');
$data['tagmanager'] = $this->model_catalog_tagmanager->getTagmanger();
]]></add>
</operation>
<operation error="skip">
<search><![CDATA[$products[] = array(]]></search>
<add position="replace"><![CDATA[
$this->load->model('catalog/tagmanager');
$tagmanager = $this->model_catalog_tagmanager->getTagmanger();
$array = explode("_", basename(__FILE__, '.php'));
$listname = ucfirst(end($array));
$pprice = 0;
if(isset($result) && isset($result['price'])) {
$value = $result;
} elseif (isset($product_info) && isset($product_info['price'])) {
$value = $product_info;
} elseif (isset($product) && isset($product['price'])) {
$value = $product;
}
if (isset($value)) {
if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {
$pprice = $this->currency->format($this->tax->calculate($value['price'], $value['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency'],'',false);
}
if ((float)$value['special']) {
$pprice = $this->currency->format($this->tax->calculate($value['special'], $value['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency'],'',false);
}
$pid = $this->model_catalog_tagmanager->tagmangerPmap($value['model'],$value['sku'],$value['product_id']);
$brand = $value['manufacturer'];
$cat = $this->model_catalog_tagmanager->getProductCatName($value['product_id']);
$title = $this->model_catalog_tagmanager->tagmangerPtitle($value['name'], $brand, $value['model'],$value['product_id']);
}
$products[] = array(
'pid' => (isset($pid) ? $pid : ''),
'title' => (isset($title) ? $title : ''),
'brand' => (isset($brand) ? $brand : ''),
'category' => (isset($cat) ? $cat : ''),
'pprice' => (isset($pprice) ? number_format((float)$pprice, 2, '.', '') : '0'),
]]></add>
</operation>
</file>
Adding the code directly will cause the same issue. Best contact the developer. The advanced_grid.php is not part of OpenCart so it is strange that it being modified by another extension.
Sorry for just getting back to your reply. No worries I'll contact the developer, thank you for the replies etc. Appreciate itADD Creative wrote: ↑Fri Jul 19, 2024 6:52 amAdding the code directly will cause the same issue. Best contact the developer. The advanced_grid.php is not part of OpenCart so it is strange that it being modified by another extension.
If it's a paid theme and it's not working as expected then that's the very first thing you should have done.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Who is online
Users browsing this forum: No registered users and 12 guests