Post by SubatWest » Thu Jun 17, 2021 5:55 pm

I am working on an editing issue and using this code:

Code: Select all

if (!isset($this->request->get['product_id'])) {
			$data['action'] = $this->url->link('catalog/product/add', 'user_token=' . $this->session->data['user_token'] . $url, true);
		} else {
			'edit'       -> $this->url->link('catalog/product/edit', 'user_token=' . $this->session->data['user_token'] . '&product_id=' . $result['product_id'] . $url, true);
                'link'('index.php?route=catalog/product/product&product_id='. $result['product_id']);
		}
I amgetting this error message:
Uncaught Error: Object of class ControllerCatalogProduct could not be converted to string in C:\xampp\htdocs\test_website\storage\modification\admin\controller\catalog\product.php:575
Can anyone guide me as to what is wrong in the coding , causing this error message?
Thanks

Active Member

Posts

Joined
Fri Oct 31, 2014 1:29 am

Post by OSWorX » Thu Jun 17, 2021 6:11 pm

I would fix that line:

Code: Select all

'link'('index.php?route=catalog/product/product&product_id='. $result['product_id']);

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by SubatWest » Thu Jun 17, 2021 6:30 pm

Thanks for the quick reponse. Can you explain further as to what is wrong with it and how to correct?

Active Member

Posts

Joined
Fri Oct 31, 2014 1:29 am

Post by OSWorX » Thu Jun 17, 2021 6:55 pm

SubatWest wrote:
Thu Jun 17, 2021 6:30 pm
Thanks for the quick reponse. Can you explain further as to what is wrong with it and how to correct?
Sorry, but you edit code and do not know what you are doing.
I gave you the wrong line, the wrong coding is visible also for noobs.
Just view your posted lines and the difference between edit and the next line.

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by paulfeakins » Thu Jun 17, 2021 6:57 pm

SubatWest wrote:
Thu Jun 17, 2021 6:30 pm
Thanks for the quick reponse. Can you explain further as to what is wrong with it and how to correct?
Well you've got apostrophes around the function name?

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by SubatWest » Thu Jun 17, 2021 7:14 pm

OSWorX wrote:
Thu Jun 17, 2021 6:55 pm
SubatWest wrote:
Thu Jun 17, 2021 6:30 pm
Thanks for the quick reponse. Can you explain further as to what is wrong with it and how to correct?
Sorry, but you edit code and do not know what you are doing.
I gave you the wrong line, the wrong coding is visible also for noobs.
Just view your posted lines and the difference between edit and the next line.
It is true that I may not know what I am doing, as I am on a journey of learning, but I can only learn by doing and seeking help of willing experts. I do not understand 'noobs'.

Active Member

Posts

Joined
Fri Oct 31, 2014 1:29 am

Post by thekrotek » Thu Jun 17, 2021 8:20 pm

The whole part after "else" is full of syntax errors. Just check the code, these are basics of PHP.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by OSWorX » Thu Jun 17, 2021 8:39 pm

SubatWest wrote:
Thu Jun 17, 2021 7:14 pm
It is true that I may not know what I am doing, as I am on a journey of learning, but I can only learn by doing and seeking help of willing experts.
I would recommend to use your preferred Search Engine, e.g. by using "learn php"
Results are like this:
https://speckyboy.com/php-tutorials-for-beginners/
SubatWest wrote:
Thu Jun 17, 2021 7:14 pm
I do not understand 'noobs'.
Read: https://en.wikipedia.org/wiki/Newbie

Full Stack Web Developer :: Dedicated OpenCart Development & Support DACH Region
Contact for Custom Work / Fast Support.


User avatar
Guru Member

Posts

Joined
Mon Jan 11, 2010 10:52 pm
Location - Austria

Post by SubatWest » Thu Jun 17, 2021 8:59 pm

Thank you for this generousity of help. Much appreciated and no doubt will also be welcomed by noobs.

Active Member

Posts

Joined
Fri Oct 31, 2014 1:29 am
Who is online

Users browsing this forum: No registered users and 177 guests