M
M
mToni2017-10-01 14:58:00
opencart
mToni, 2017-10-01 14:58:00

How to generate a link to a product from the main page so that the link is generated through the category?

How to generate a link to a product from the main page so that the link is generated through the category.
Example:
If you go to the product through the category page, then the link to the product looks like breeds/shotlandskaya-poroda?product_id=50
And if through the main page, for example, through the Recommended module, then the link looks like index.php?route=product/product&product_id=50
The task is to have the links as in the first example.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2017-10-02
@zoozag

$this->url->link('product/product', 'path=' . $this->request->get['path'] . '&product_id=' . $result['product_id'] . $url)

Here is the generation of a link to the product through the category
Replace $this->request->get['path'] with the path of the category you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question