L
L
Lenwoot2015-06-12 10:28:21
PHP
Lenwoot, 2015-06-12 10:28:21

How to show the size in the catalog in magento?

Site vk.cc/3Td5L9 , how to make the size displayed in the product card when hovering over it?
4aca098234f24120b796b4d3ae962ae9.pngd7e51bdc0c4e49438d834bdd687bcfa9.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Puma Thailand, 2015-06-12
@opium

this is usually done through a multi-product

M
Mick Coder, 2015-06-28
@lbondodesc

As far as I understand, such functionality is done through attributes!
prntscr.com/7m9nve
prntscr.com/7m9o2s

$prod = Mage::getModel('catalog/product')->loadByAttribute('sku', $sku);
echo $prod->getSize() . ' - ' . $prod->getAttributeText('size');

O
Oleg Batishchev, 2015-09-12
@z0rg

It highly depends on how it is implemented, Magento is so flexible that the same thing can be done in almost 2-4 ways, but in the end only 1-2 will be correct with further changes, improvements, refactoring, scope expansion, etc.
In this case, this should be implemented through the superattributes of a custom product, and the output will be tied to Stock Inventory, because it makes no sense for us to display the sizes of which are not, ended or did not exist at all.
Written just above will only help for a specific simple product, your option is to modify the catalog/product/list.phtml product listing template and it will look something like this:
Next, we display the attributes in the foreach loop and filter if only 1 needs to be selected.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question