Skip to main content

Category Listing

Deprecation Notice

Vue-based themes will soon be deprecated. Please switch to React-based themes, as all future updates and support will focus exclusively on React.

The category listing page display all the product in any particular category.

QG11


Arguments to be passed

ContexttypeDescription
is_logged_inBooleanUser is logged in user or not
favourite_idsArrayids of products that are added in the wishlist
compare_slugsArraypreviously compared product slugs
app_featuresObjectApplication specific configurations
pageObjectPagination object consist details like has_next, has_previous, `item_total which can be useful to display pagination```
product_countNumberTotal number of products that are live
itemsArrayFirst 12 products that are live
filtersArrayList of filters by which displayed products can be filter out
sort_onArrayOptions to sort products like Ratings, Discounts or price
page_errorObjectIt will have error details so that you can handle errors gracefully on theme side
loadingBooleanWhile products are being fetched from backend you can indicate progress bar on theme side

Example of category listing in infinite.

theme/templates/pages/category-listing.vue
 <fdk-infinite-loading class="plp-container">
<template slot-scope="infiniteLoaderData">
<div class="product-container">
<div
v-for="(product, index) in getProducts"
:key="index + '-product.uid'"
>
<fdk-link
:link="product.url"
:target="hrefTarget"
class="product-wrapper"
>
<fy-product-card
:product="product"
:context="context"
:active-product-id="active_product_uid"
@slide-up="slideUpEventListener($event)"
@slide-down="slideDownEventListener($event)"
:global_config="global_config"
:listing_price_config="listingPriceConfig"
></fy-product-card>
</fdk-link>
</div>
<fdk-loader
id="loader"
class="loader-center"
v-if="infiniteLoaderData.hasNext"
></fdk-loader>
</div>
</template>
</fdk-infinite-loading>

Was this section helpful?