A
A
Artyom2017-11-05 19:01:56
opencart
Artyom, 2017-11-05 19:01:56

How to assign a unique class to blocks?

There is a category output module (categories showcase) for OpenCart 2.1.0.2. The module displays blocks with categories, but all blocks have the same class div class="item-container". What code needs to be written in order to assign a class to each block? Eg. div class="item-container-2", div class="item-container-3", etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artyom, 2017-11-05
@seo-art

Issue resolved:

<?php $h = 1; ?>
<div class="item-container-<?php echo $h; ?>"></div>
<?php $h++; ?>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question