home page design
This commit is contained in:
parent
9786252c78
commit
3272450dd7
34
app/src/main/java/me/gilo/wc/adapter/HomeProductAdapter.java
Normal file
34
app/src/main/java/me/gilo/wc/adapter/HomeProductAdapter.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
package me.gilo.wc.adapter;
|
||||||
|
|
||||||
|
import android.support.v7.widget.RecyclerView;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import me.gilo.wc.R;
|
||||||
|
import me.gilo.wc.adapter.viewholder.ProductViewHolder;
|
||||||
|
import me.gilo.woodroid.models.Product;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class HomeProductAdapter extends RecyclerView.Adapter<ProductViewHolder> {
|
||||||
|
private List<Product> products;
|
||||||
|
|
||||||
|
public HomeProductAdapter(List<Product> products) {
|
||||||
|
this.products = products;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ProductViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
||||||
|
return new ProductViewHolder(parent.getContext(), LayoutInflater.from(parent.getContext()).inflate(R.layout.single_home_product_item, parent, false));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(ProductViewHolder holder, int position) {
|
||||||
|
holder.renderView(products.get(position));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return products.size() == 0 ? 0 : products.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,13 @@
|
|||||||
package me.gilo.wc.adapter.viewholder
|
package me.gilo.wc.adapter.viewholder
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
import android.support.v7.widget.RecyclerView
|
import android.support.v7.widget.RecyclerView
|
||||||
import android.text.Html
|
import android.text.Html
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import me.gilo.wc.R
|
import me.gilo.wc.R
|
||||||
|
import me.gilo.wc.ui.product.ShopActivity
|
||||||
import me.gilo.woodroid.models.Category
|
import me.gilo.woodroid.models.Category
|
||||||
|
|
||||||
class CategoryViewHolder(val context: Context, itemView: View) :
|
class CategoryViewHolder(val context: Context, itemView: View) :
|
||||||
@ -18,12 +20,13 @@ class CategoryViewHolder(val context: Context, itemView: View) :
|
|||||||
tvTitle.text = category.name
|
tvTitle.text = category.name
|
||||||
tvDescription.text = Html.fromHtml(category.description)
|
tvDescription.text = Html.fromHtml(category.description)
|
||||||
|
|
||||||
// itemView.setOnClickListener{
|
itemView.setOnClickListener{
|
||||||
// val intent = Intent(context, CouponActivity::class.java)
|
val intent = Intent(context, ShopActivity::class.java)
|
||||||
// intent.putExtra("couponId", coupon.id)
|
intent.putExtra("categoryId",category.id)
|
||||||
//
|
intent.putExtra("name",category.name)
|
||||||
// context.startActivity(intent)
|
|
||||||
// }
|
context.startActivity(intent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,8 @@ class CategoryFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun categories() {
|
private fun categories() {
|
||||||
|
|
||||||
|
//TODO ('Exclude the uncategorized category')
|
||||||
viewModel.categories().observe(this, android.arch.lifecycle.Observer { response ->
|
viewModel.categories().observe(this, android.arch.lifecycle.Observer { response ->
|
||||||
when (response!!.status()) {
|
when (response!!.status()) {
|
||||||
Status.LOADING -> {
|
Status.LOADING -> {
|
||||||
|
|||||||
@ -2,11 +2,18 @@ package me.gilo.wc.ui.home
|
|||||||
|
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v4.app.Fragment
|
import android.support.v4.app.Fragment
|
||||||
|
import android.support.v7.widget.LinearLayoutManager
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.view.View
|
import android.view.View
|
||||||
import android.view.ViewGroup
|
import android.view.ViewGroup
|
||||||
|
import kotlinx.android.synthetic.main.fragment_home.*
|
||||||
import me.gilo.wc.R
|
import me.gilo.wc.R
|
||||||
|
import me.gilo.wc.adapter.HomeProductAdapter
|
||||||
|
import me.gilo.wc.common.Status
|
||||||
import me.gilo.wc.viewmodels.ProductViewModel
|
import me.gilo.wc.viewmodels.ProductViewModel
|
||||||
|
import me.gilo.woodroid.models.Product
|
||||||
|
import me.gilo.woodroid.models.filters.ProductFilter
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
|
|
||||||
class HomeFragment : Fragment() {
|
class HomeFragment : Fragment() {
|
||||||
@ -15,6 +22,12 @@ class HomeFragment : Fragment() {
|
|||||||
lateinit var viewModel: ProductViewModel
|
lateinit var viewModel: ProductViewModel
|
||||||
val TAG = "HomeFragment"
|
val TAG = "HomeFragment"
|
||||||
|
|
||||||
|
lateinit var adapter: HomeProductAdapter
|
||||||
|
private lateinit var products: ArrayList<Product>
|
||||||
|
|
||||||
|
lateinit var hoodieAdapter: HomeProductAdapter
|
||||||
|
private lateinit var hoodieProducts: ArrayList<Product>
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
arguments?.let {
|
arguments?.let {
|
||||||
@ -22,9 +35,11 @@ class HomeFragment : Fragment() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreateView(inflater: LayoutInflater,
|
override fun onCreateView(
|
||||||
container: ViewGroup?,
|
inflater: LayoutInflater,
|
||||||
savedInstanceState: Bundle?): View {
|
container: ViewGroup?,
|
||||||
|
savedInstanceState: Bundle?
|
||||||
|
): View {
|
||||||
|
|
||||||
return inflater.inflate(R.layout.fragment_home, container, false)
|
return inflater.inflate(R.layout.fragment_home, container, false)
|
||||||
}
|
}
|
||||||
@ -32,17 +47,115 @@ class HomeFragment : Fragment() {
|
|||||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
|
|
||||||
|
viewModel = (activity as HomeActivity).getViewModel(ProductViewModel::class.java)
|
||||||
|
|
||||||
|
setUpProducts()
|
||||||
|
setUpHoodies()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun setUpProducts() {
|
||||||
|
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
rvShop.layoutManager = layoutManager
|
||||||
|
rvShop.isNestedScrollingEnabled = false
|
||||||
|
|
||||||
|
products = ArrayList()
|
||||||
|
|
||||||
|
adapter = HomeProductAdapter(products)
|
||||||
|
rvShop.adapter = adapter
|
||||||
|
|
||||||
|
products()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private fun setUpHoodies() {
|
||||||
|
val layoutManager = LinearLayoutManager(activity, LinearLayoutManager.HORIZONTAL, false)
|
||||||
|
|
||||||
|
rvHoodies.layoutManager = layoutManager
|
||||||
|
rvHoodies.isNestedScrollingEnabled = false
|
||||||
|
|
||||||
|
hoodieProducts = ArrayList()
|
||||||
|
|
||||||
|
hoodieAdapter = HomeProductAdapter(hoodieProducts)
|
||||||
|
rvHoodies.adapter = hoodieAdapter
|
||||||
|
|
||||||
|
|
||||||
|
val filter = ProductFilter()
|
||||||
|
filter.category = 21
|
||||||
|
products(filter)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun newInstance() =
|
fun newInstance() =
|
||||||
HomeFragment().apply {
|
HomeFragment().apply {
|
||||||
arguments = Bundle().apply {
|
arguments = Bundle().apply {
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun products() {
|
||||||
|
viewModel.products().observe(this, android.arch.lifecycle.Observer { response ->
|
||||||
|
when (response!!.status()) {
|
||||||
|
Status.LOADING -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.SUCCESS -> {
|
||||||
|
products.clear()
|
||||||
|
val productsResponse = response.data()
|
||||||
|
for (product in productsResponse) {
|
||||||
|
products.add(product)
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter.notifyDataSetChanged()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.ERROR -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.EMPTY -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun products(filter: ProductFilter) {
|
||||||
|
viewModel.products(filter).observe(this, android.arch.lifecycle.Observer { response ->
|
||||||
|
when (response!!.status()) {
|
||||||
|
Status.LOADING -> {
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.SUCCESS -> {
|
||||||
|
hoodieProducts.clear()
|
||||||
|
|
||||||
|
val productsResponse = response.data()
|
||||||
|
for (product in productsResponse) {
|
||||||
|
hoodieProducts.add(product)
|
||||||
|
}
|
||||||
|
|
||||||
|
hoodieAdapter.notifyDataSetChanged()
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.ERROR -> {
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Status.EMPTY -> {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,13 +3,11 @@ package me.gilo.wc.ui.product
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.support.v4.view.GravityCompat
|
import android.support.v4.view.GravityCompat
|
||||||
import android.support.v7.widget.GridLayoutManager
|
|
||||||
import android.view.Menu
|
import android.view.Menu
|
||||||
import android.view.MenuItem
|
import android.view.MenuItem
|
||||||
import android.widget.Toast
|
import android.widget.Toast
|
||||||
import io.github.inflationx.viewpump.ViewPumpContextWrapper
|
import io.github.inflationx.viewpump.ViewPumpContextWrapper
|
||||||
import kotlinx.android.synthetic.main.activity_shop.*
|
import kotlinx.android.synthetic.main.activity_shop.*
|
||||||
import kotlinx.android.synthetic.main.content_shop.*
|
|
||||||
import kotlinx.android.synthetic.main.drawer_filter.*
|
import kotlinx.android.synthetic.main.drawer_filter.*
|
||||||
import me.gilo.wc.R
|
import me.gilo.wc.R
|
||||||
import me.gilo.wc.adapter.ProductAdapter
|
import me.gilo.wc.adapter.ProductAdapter
|
||||||
@ -43,19 +41,22 @@ class ShopActivity : BaseActivity() {
|
|||||||
|
|
||||||
title = "Shop"
|
title = "Shop"
|
||||||
|
|
||||||
val layoutManager = GridLayoutManager(baseContext, 2)
|
|
||||||
rvShop.layoutManager = layoutManager
|
|
||||||
rvShop.isNestedScrollingEnabled = false
|
|
||||||
|
|
||||||
products = ArrayList()
|
|
||||||
|
|
||||||
adapter = ProductAdapter(products)
|
|
||||||
rvShop.adapter = adapter
|
|
||||||
|
|
||||||
products()
|
|
||||||
cart()
|
cart()
|
||||||
|
|
||||||
bFilter.setOnClickListener{filter()}
|
bFilter.setOnClickListener{filter()}
|
||||||
|
|
||||||
|
if(intent.hasExtra("categoryId")){
|
||||||
|
val filter = ProductFilter()
|
||||||
|
filter.category = intent.getIntExtra("categoryId", 0)
|
||||||
|
products(filter)
|
||||||
|
|
||||||
|
title = intent.getStringExtra("name")
|
||||||
|
}else{
|
||||||
|
products()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun filter() {
|
private fun filter() {
|
||||||
@ -125,7 +126,6 @@ class ShopActivity : BaseActivity() {
|
|||||||
|
|
||||||
Status.SUCCESS -> {
|
Status.SUCCESS -> {
|
||||||
val cartResponse = response.data()
|
val cartResponse = response.data()
|
||||||
toast("Cart items are " + cartResponse.size)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Status.ERROR -> {
|
Status.ERROR -> {
|
||||||
|
|||||||
@ -12,59 +12,77 @@
|
|||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:padding="16dp"
|
android:orientation="vertical"
|
||||||
>
|
>
|
||||||
|
|
||||||
<LinearLayout
|
<TextView
|
||||||
android:layout_width="match_parent"
|
fontPath="@string/font_medium"
|
||||||
android:layout_height="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:background="@drawable/rect_white"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:gravity="left"
|
||||||
>
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:text="Some of our popular products"
|
||||||
|
android:textColor="@color/text_black_2"
|
||||||
|
android:textSize="20sp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tvTitle"
|
fontPath="@string/font_regular"
|
||||||
fontPath="@string/font_medium"
|
android:layout_width="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:gravity="left"
|
||||||
android:layout_marginLeft="16dp"
|
android:layout_marginLeft="16dp"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginRight="16dp"
|
||||||
android:layout_marginRight="16dp"
|
android:text="We have a feeling you will like these"
|
||||||
android:gravity="left"
|
android:maxLines="6"
|
||||||
android:text="This is an example of a title"
|
android:lineSpacingMultiplier="1.2"
|
||||||
android:textColor="@color/text"
|
android:textColor="@color/text_black_9"
|
||||||
android:textSize="18sp"/>
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tvDescription"
|
|
||||||
fontPath="@string/font_regular"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginLeft="16dp"
|
|
||||||
android:layout_marginTop="8dp"
|
|
||||||
android:layout_marginRight="16dp"
|
|
||||||
android:gravity="left"
|
|
||||||
android:text="@string/lorem"
|
|
||||||
android:maxLines="6"
|
|
||||||
android:lineSpacingMultiplier="1.2"
|
|
||||||
android:textColor="@color/text_black_5"
|
|
||||||
android:textSize="14sp"/>
|
|
||||||
|
|
||||||
<TextView
|
<android.support.v7.widget.RecyclerView
|
||||||
android:id="@+id/tvCallToAction"
|
android:layout_width="match_parent"
|
||||||
fontPath="@string/font_regular"
|
android:layout_height="wrap_content"
|
||||||
android:layout_width="wrap_content"
|
android:id="@+id/rvShop"
|
||||||
android:layout_height="wrap_content"
|
android:layout_marginTop="16dp"
|
||||||
android:layout_gravity="right"
|
></android.support.v7.widget.RecyclerView>
|
||||||
android:layout_marginRight="0dp"
|
|
||||||
android:layout_marginBottom="0dp"
|
|
||||||
android:gravity="left"
|
<TextView
|
||||||
android:padding="16dp"
|
fontPath="@string/font_medium"
|
||||||
android:text="Call to Action"
|
android:layout_width="wrap_content"
|
||||||
android:textColor="#1c5c9a"
|
android:layout_height="wrap_content"
|
||||||
android:textSize="14sp"/>
|
android:gravity="left"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:text="Check out our hoodies"
|
||||||
|
android:textColor="@color/text_black_2"
|
||||||
|
android:textSize="20sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="left"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:text="Classic pullover silhouette in a durable reverse weave cotton fleece"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:maxLines="6"
|
||||||
|
android:lineSpacingMultiplier="1.2"
|
||||||
|
android:textColor="@color/text_black_9"
|
||||||
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:id="@+id/rvHoodies"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
></android.support.v7.widget.RecyclerView>
|
||||||
|
|
||||||
|
|
||||||
</LinearLayout>
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
82
app/src/main/res/layout/single_home_product_item.xml
Normal file
82
app/src/main/res/layout/single_home_product_item.xml
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:layout_width="200dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:layout_marginRight="8dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginBottom="8dp"
|
||||||
|
android:background="@drawable/rect_white"
|
||||||
|
android:elevation="2dp"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:ignore="MissingPrefix">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="160dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/ivImage"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:scaleType="centerCrop"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvOnSale"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="top|left"
|
||||||
|
android:background="@color/colorPrimary"
|
||||||
|
android:textColor="#ffffff"
|
||||||
|
android:text="SALE!"
|
||||||
|
fontPath="@string/font_medium"
|
||||||
|
android:padding="8dp"
|
||||||
|
/>
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvTitle"
|
||||||
|
fontPath="@string/font_medium"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="16dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:textColor="@color/text"
|
||||||
|
android:textSize="18sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvDescription"
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="16dp"
|
||||||
|
android:layout_marginTop="8dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:maxLines="2"
|
||||||
|
android:lineSpacingMultiplier="1.2"
|
||||||
|
android:textColor="@color/text_black_5"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tvCallToAction"
|
||||||
|
fontPath="@string/font_regular"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="right"
|
||||||
|
android:layout_marginRight="0dp"
|
||||||
|
android:layout_marginBottom="0dp"
|
||||||
|
android:gravity="left"
|
||||||
|
android:padding="16dp"
|
||||||
|
android:textColor="#1c5c9a"
|
||||||
|
android:textSize="14sp"/>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
@ -1,8 +1,5 @@
|
|||||||
package me.gilo.woodroid.models.filters;
|
package me.gilo.woodroid.models.filters;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class ProductFilter extends ListFilter{
|
public class ProductFilter extends ListFilter{
|
||||||
private int[] parent;
|
private int[] parent;
|
||||||
private int[] parent_exclude;
|
private int[] parent_exclude;
|
||||||
@ -11,7 +8,7 @@ public class ProductFilter extends ListFilter{
|
|||||||
private String type;
|
private String type;
|
||||||
private String sku;
|
private String sku;
|
||||||
private boolean featured;
|
private boolean featured;
|
||||||
private String category;
|
private int category;
|
||||||
private String tag;
|
private String tag;
|
||||||
private String shipping_class;
|
private String shipping_class;
|
||||||
private String attribute;
|
private String attribute;
|
||||||
@ -96,11 +93,11 @@ public class ProductFilter extends ListFilter{
|
|||||||
addFilter("featured", featured);
|
addFilter("featured", featured);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getCategory() {
|
public int getCategory() {
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setCategory(String category) {
|
public void setCategory(int category) {
|
||||||
this.category = category;
|
this.category = category;
|
||||||
|
|
||||||
addFilter("category", category);
|
addFilter("category", category);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user