Post by ovidiublaga88 » Tue Sep 24, 2019 8:36 pm

Hello,

I am in public_html/catalog/view/theme/OPC070174-8/template/product/product.twig. I try to edit the product.twig file and in the URL I have https://exampletest.ro/index.php?route= ... duct_id=55. I want to use a command that if (GET['product_id'] == 55) { "do something" }. How can i do this? please help.

Many thanks

Newbie

Posts

Joined
Fri Mar 22, 2019 10:35 pm

Post by developer@avi » Wed Sep 25, 2019 1:25 am

You need set product is in data in product controller like
$data['product_id']=$this->request>get['product_id'];

Then use {% if product_id==55 %}

On template

Newbie

Posts

Joined
Mon Aug 20, 2018 1:05 am

Post by ovidiublaga88 » Wed Sep 25, 2019 1:53 pm

developer@avi wrote:
Wed Sep 25, 2019 1:25 am
You need set product is in data in product controller like
$data['product_id']=$this->request>get['product_id'];

Then use {% if product_id==55 %}

On template
Thank you. So I use {% if product_id==55 % echo '<a href="www.google.com">google</a>'} ?

I use ECHO then?

Newbie

Posts

Joined
Fri Mar 22, 2019 10:35 pm

Post by ovidiublaga88 » Wed Sep 25, 2019 4:07 pm

Thanks a lot. It worked

Newbie

Posts

Joined
Fri Mar 22, 2019 10:35 pm
Who is online

Users browsing this forum: No registered users and 4 guests