Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Allow to export available_for_purchase product field

IKarbowiakd389e44d01b3
diff --git a/saleor/csv/tests/export/products_data/test_get_products_data.py b/saleor/csv/tests/export/products_data/test_get_products_data.py
index ae5ec4cb60..2360ff609e 100644
--- a/saleor/csv/tests/export/products_data/test_get_products_data.py
+++ b/saleor/csv/tests/export/products_data/test_get_products_data.py
@@ -56,6 +56,7 @@ def test_get_products_data(product, product_with_image, collection, image):
"id": product.id,
"name": product.name,
"is_published": product.is_published,
+ "available_for_purchase": product.available_for_purchase,
"description": product.description,
"category__slug": product.category.slug,
"product_type__name": product.product_type.name,
diff --git a/saleor/csv/utils/products_data.py b/saleor/csv/utils/products_data.py
index 2eba96c957..a3d8239607 100644
--- a/saleor/csv/utils/products_data.py
+++ b/saleor/csv/utils/products_data.py
@@ -24,6 +24,7 @@ class ProductExportFields:
"name": "name",
"description": "description",
"visible": "is_published",
+ "available for purchase": "available_for_purchase",
"category": "category__slug",
"product type": "product_type__name",
"charge taxes": "charge_taxes",
diff --git a/saleor/graphql/csv/enums.py b/saleor/graphql/csv/enums.py
index f547fe044d..009eaf45f9 100644
--- a/saleor/graphql/csv/enums.py
+++ b/saleor/graphql/csv/enums.py
@@ -31,6 +31,7 @@ class ProductFieldEnum(graphene.Enum):
PRODUCT_TYPE = "product type"
CATEGORY = "category"
VISIBLE = "visible"
+ AVAILABLE_FOR_PURCHASE = "available for purchase"
PRODUCT_WEIGHT = "product weight"
COLLECTIONS = "collections"
CHARGE_TAXES = "charge taxes"
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 11e73507b1..529e0192b3 100644
--- a/saleor/graphql/schema.graphql
+++ b/saleor/graphql/schema.graphql
@@ -3761,6 +3761,7 @@ enum ProductFieldEnum {
PRODUCT_TYPE
CATEGORY
VISIBLE
+ AVAILABLE_FOR_PURCHASE
PRODUCT_WEIGHT
COLLECTIONS
CHARGE_TAXES