Post by cosmicx » Tue Jan 08, 2019 10:51 am

I'm trying to edit a module myself and I need to echo the SEO product url.
In my local instance of Opencart 2.3.0.2, this code below works:

Code: Select all

<?php echo $this->url->link('product/product', 'product_id=' . $product_id); ?>
But, the question is - what is the 3.0.2.0 counterpart of the code?

I've tried openconverter.io - but this didn't worked, any ideas?

Active Member

Posts

Joined
Mon Jan 09, 2012 6:27 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by cosmicx » Wed Jan 09, 2019 10:01 am

Schema product module from a CyberFox on Github.

Active Member

Posts

Joined
Mon Jan 09, 2012 6:27 pm

User avatar
Expert Member

Posts

Joined
Tue Jul 17, 2012 10:35 pm
Location - România

Post by cosmicx » Tue Jan 15, 2019 10:42 pm

xxvirusxx wrote:
Fri Jan 11, 2019 5:39 pm
Is this right?
viewtopic.php?f=184&t=209272&p=743722#p743722
That's my other post, and the code works fine, but NOT when there are more than 1 review.
My concert in this post is the SEO Product URL
Last edited by cosmicx on Wed Jan 16, 2019 10:12 pm, edited 1 time in total.

Active Member

Posts

Joined
Mon Jan 09, 2012 6:27 pm

Post by Johnathan » Tue Jan 15, 2019 11:53 pm

You may need to set the URL into a variable in the controller file, and then call it in the view file. For example, you'd do this in the controller file:

Code: Select all

$data['product_url'] = $this->url->link('product/product', 'product_id=' . $product_id);

and then do this in the .twig file:

Code: Select all

{{ product_url }}

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by cosmicx » Mon Jan 21, 2019 9:51 pm

Jonathan, thank you! Your guide worked!

Active Member

Posts

Joined
Mon Jan 09, 2012 6:27 pm

Post by Johnathan » Tue Jan 22, 2019 2:36 am

You're welcome, glad I could help

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 146 guests