Page 1 of 1

Featured Products

Posted: Wed Mar 06, 2013 2:24 am
by mota_nginya
I need help with changing featured products and also make filter show categories instead of prices. I have not been able to find that written anywhere here. Please help!

Thanks,
Mota_nginya.

Re: Featured Products

Posted: Wed Mar 06, 2013 11:13 am
by phillipuniverse
Could you be a little more descriptive? Where do you want to change featured products and what do you want to change? What filter should show categories instead of prices?

Re: Featured Products

Posted: Wed Mar 06, 2013 12:24 pm
by mota_nginya
Once again thanks for your timely response.

1. In the default.html there is this section:

Code: Select all

<section id="right_column">
        <header>Featured Products</header>
        <div id="options">
            <div class="section">
                 <blc:related_products categoryId="2001" quantity="3"/> 
                 <ul id="featured_products" class="group">
                    <li th:each="product : ${products}" th:object="${product}" th:include="catalog/partials/productListItem" class="product_container"></li>
                 </ul>
            </div>                                 
        </div>
    </section> 


I would like to know how to set the products that are displayed in this section. This is displayed as the featured product on the right pane of the layout.

2. There is also this section that says "Filter Your Results", right now it is filtering by "Price" but I would also like to filter by categories so that those categories that are not shown on the horizontal menu can be seen there. I think it is called "facetfilter" and here is the code snippet that takes care of that:

Code: Select all

<div th:remove="tag">
   
    <!-- Active facets -->
    <div th:each="facetDto : ${facets}" th:if="${facetDto.active}" class="section">
        <h3>
            <span th:text="${facetDto.facet.label}" th:remove="tag"></span>
            <a th:if="${facetDto.facet.canMultiselect}"
                th:attr="onclick=${'HC.showFacetMultiselect(''__${facetDto.facet.field.abbreviation}__'')'}"
                href="javascript:;"
                class="remove_facet_values">[ <span th:text="#{facet.edit}">Edit</span> ]</a>
            <a blc:removefacetvalueslink="${facetDto}" class="remove_facet_values">[ Clear ]</a>
        </h3>
       
        <li th:each="facetValue : ${facetDto.facetValues}" th:if="${facetValue.active}">
            <!-- Facet Value display fragment -->
            <span th:remove="tag" th:fragment="facet-value-display">
                <span th:if="${facetValue.value != null}" th:remove="tag" th:text="${facetValue.value}"></span>
                <span th:unless="${facetValue.value != null}" th:remove="tag">
                    <span blc:price="${facetValue.minValue}" th:remove="tag"></span>
                    <span th:text="${facetValue.maxValue == null ? ' __#{facet.orMore}__ ' : ' - '}" th:remove="tag"></span>
                    <span th:if="${facetValue.maxValue != null}" blc:price="${facetValue.maxValue}" th:remove="tag"></span>
                </span>
            </span>
        </li>
    </div>
   
    <!-- Inactive facets -->
    <div th:each="facetDto : ${facets}" th:unless="${facetDto.active}" class="section">
        <h3 th:text="${facetDto.facet.label}"></h3>
        <ul>
            <li th:each="facetValue : ${facetDto.facetValues}" th:class="${facetValue.active}? 'active'" th:if="${!facetDto.showQuantity or facetValue.quantity > 0}">
                <a blc:togglefacetlink="${facetValue}" class="maker">
                   
                    <span th:substituteby="catalog/partials/facetFilter :: facet-value-display" />
               
                    <span class="facetCount" th:if="${facetDto.showQuantity and !facetDto.active}" th:text="${facetValue.quantity}"></span>
                    <i th:if="${facetValue.active}" class="icon-remove"></i>
                </a>
            </li>
            <li>
                <a th:if="${facetDto.facet.canMultiselect}"
                    th:attr="onclick=${'HC.showFacetMultiselect(''__${facetDto.facet.field.abbreviation}__'')'}"
                    href="javascript:;"
                    class="maker multiple"><span th:text="#{facet.chooseMultiple}">Choose Multiple...</span></a>
            </li>
        </ul>
    </div>
   
    <!-- Multiselect facets -->
    <div th:each="facetDto : ${facets}" th:if="${facetDto.facet.canMultiselect}">
        <div th:id="${'facet-' + facetDto.facet.field.abbreviation}" style="display: none;" class="multiselect_facet_container">
            <h3 th:text="${facetDto.facet.label}"></h3>
            <blc:form method="GET">
                <li th:each="facetValue : ${facetDto.facetValues}" th:if="${facetDto.active or (!facetDto.showQuantity or facetValue.quantity > 0)}">
                    <input type="checkbox"
                        th:name="${facetDto.facet.field.abbreviation + '-' + facetValue.valueKey}"
                        th:id="${facetDto.facet.field.abbreviation + '-' + facetValue.valueKey}"
                        th:checked="${facetValue.active}" />
                       
                    <label th:for="${facetDto.facet.field.abbreviation + '-' + facetValue.valueKey}">
                        <span th:substituteby="catalog/partials/facetFilter :: facet-value-display" />
                    </label>
                </li>
               
                <div th:each="facetDto2 : ${facets}" th:remove="tag">
                    <input type="hidden"
                        th:each="facetValue : ${facetDto2.facetValues}"
                        th:if="${facetValue.active}"
                        th:name="${facetDto2.facet.field.abbreviation}"
                        th:value="${facetValue.valueKey}" />
                </div>
                <input type="hidden" th:if="${originalQuery}" name="q" th:value="${originalQuery}" />
                <input type="hidden" name="facetField" th:value="${facetDto.facet.field.abbreviation}" />
                <input type="submit" class="medium red" />
            </blc:form>
        </div>
    </div>
</div>


Thanks again,
Mota_nginya

Re: Featured Products

Posted: Wed Mar 06, 2013 8:10 pm
by mota_nginya
Where art thou?