A
A
AndyLarcin2015-10-21 13:05:10
Magento
AndyLarcin, 2015-10-21 13:05:10

Magento collection?

<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.2.min.js" ></script>
 <script type="text/javascript">
//<![CDATA[script type="text/javascript">script type="text/javascript">

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Petrov, 2015-10-21
@AndyLarcin

It's not entirely clear what you want to get.
If you need to make a selection by two attribute values, then this is done like this:

...
->addAttributeToFilter('url_key', array('in'=>array('men','women')))
...

But this code will still return only one entry (because getFirstItem()), and depending on what is stored first in the database, you will always get either men or women.

O
Oleg Batishchev, 2015-11-03
@z0rg

$product = $this->getProduct();is used in product_view as a rule,
if you use it on the main page, then it’s easier for you to create a custom block in which to place two more blocks
with two selections through the standard product listing, but with different gender attribute values.
Best done through local.xml with a custom module containing blocks.
Another option is to make a small correction and add the data-gender attribute to the elements and do sorting with animation already on the client side through js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question