Output attribute category when you hover opencart
Вывод атрибутов в категории при наведении opencart
Creation, development, manufacturing sites | WEB-STYDIA.COM

Good day dear users!

For a long time I did not write anything here, today, one of the clients required to withdraw in terms of, in shares, in the search itd ... except for the ability to display basic information about the product yet and all the attributes that are present in the product, in this regard, I I decided to publish the decision of the question here.

This article and many others on our website by and large written as a note for myself, but I'll be glad if you will come in handy this information.

And so, today, I will try to briefly describe all the steps of how to list items on the site, that is, the categories and the like display attributes to the goods, do we two solutions, the first is what we derive all available product attributes and the second way is to conclude only those attributes that you need that is selectively.

All the actions we will carry on opencart 1,5 ...

The first thing we need to make some changes in the category of controller (If you add to shares, search, manufacturers ... What do all similar)

Open the file:

And in it after the line:

Add:

With the controller completed now proceed to file category.tpl our active template in the store:

Find the unit responsible for the output of goods, each pattern of his style can be different and in any place we add the code shown below I have added it to your template before the final product DIV block.

The above piece of code we display all available product attributes.

If you want to display is defined custom attributes instead of the above piece of code, we add the following code:

Pay attention on the list tsiferok code 12, 13, 14, 15, ..... it is precisely our selected these attributes, that is where we add a comma-separated attribute ID.

Check ID attribute is very simple, go to the admin panel in the Attributes tab, and on the other hand, we desired to display an attribute click to change the browser bar to watch the link at the end of the link will be displayed attribute ID.

In total, you should already appear in the category attributes, but they would look without the formatting, to put it mildly crooked.

To our attributes nice looking, we need to add to them a little style, styles, in this example, I'll point out the ones that I have used for your website, you will also probably have to tinker with them a little bit for yourself!

And so in this example, I bring it attributes when you hover on the product, that is, they are hidden initially, but as soon as we direct the mouse pointer to the desired item appears to us the attributes. Example You can look at the photo in the article!

So add to your stylesheet template code style:

That's basically it.

There are several variants of this decision, but in my opinion he seemed to me the most correct and simple.

General try if something will not work or you want to offer a different solution to write in the comments!

You may also like

No Comment

You can post first response comment.

Leave A Comment

Please enter your name. Please enter an valid email address. Please enter a message.