Answer the question
In order to leave comments, you need to log in
opencart | How to link to a specific category of products?
Good afternoon!
You need to add links to certain product categories in the article.
I want to do this by example, as with links in the footer to articles ↓
<ul class="list-unstyled">
<li><a href="<?php echo $informations[8]['href']; ?>"><?php echo $informations[8]['title']; ?></a></li>
<li><a href="<?php echo $informations[9]['href']; ?>"><?php echo $informations[9]['title']; ?></a></li>
<li><a href="<?php echo $informations[10]['href']; ?>"><?php echo $informations[10]['title']; ?></a></li>
</ul>
<li><a href="<?php echo $category_id[5]['href']; ?>"><?php echo $category_id[5]['title']; ?></a></li>
Answer the question
In order to leave comments, you need to log in
How do you do it will not work, because when you add a line to an article
<li><a href="<?php echo $category_id[60]['href']; ?>"><?php echo $category_id[60]['title']; ?></a></li>
you are bypassing the php interpreter that handles your variables <?php echo $category_id[60]['href']; ?>
<li><a href="/index.php?route=product/category&category_id=60">Категория 60</a></li>
Something doesn't work...
My category, as I understand it, is #60
Therefore, if everything is correct in the previous example, then it should look like this ↓ , or something like that)
<li><a href="<?php echo $category_id[60]['href']; ?>"><?php echo $category_id[60]['title']; ?></a></li>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question