Problems, need help? Have a tip or advice? Post it here.
22 posts Page 3 of 3
Thanks for the creds.
When I add the folder=k_folder_name I still see all of the products. I also need to hide this folder on other sections as well.

I had a look. We needed to supply the folder-name as a literal string (as your code was in a different template altogether and so the folder-name was not available as variable).

I've made the following changes in index.php -
1. Where only products of a particular folder were to be shown -
Code: Select all
<cms:pages masterpage='products.php' limit='1' folder='mini-resq-bag' >
    <form action=..
    ..
    <select id="p4" class="getselect">
    <cms:set current_page=k_page_name />
    <cms:pages masterpage='products.php' folder='mini-resq-bag'>
        <option value="<cms:show k_page_link />" <cms:if k_page_name=current_page>selected</cms:if>><cms:show k_page_title /></option>
    </cms:pages>
    </select>
    ..
</cms:pages>


2. where the products from the folder were to be hidden
Code: Select all
<cms:pages masterpage='products.php' limit='1' folder='NOT mini-resq-bag' >
    <form action=..
    ..
    <select id="p4" class="getselect">
    <cms:set current_page=k_page_name />
    <cms:pages masterpage='products.php' folder='NOT mini-resq-bag'>
        <option value="<cms:show k_page_link />" <cms:if k_page_name=current_page>selected</cms:if>><cms:show k_page_title /></option>
    </cms:pages>
    </select>
    ..
</cms:pages>

That done, you'll see that to begin with the products are listed as desired.
However, when you select any from the dropdown, a new form gets fetched via AJAX from products.php and that displays all the products.

You'll have to figure out to send an extra parameter through AJAX to products.php and make it list 'all/folder only/without folder' products.

I think you'll manage that.
Thank you so much KK!
22 posts Page 3 of 3