Skip to content

Commit

Permalink
Merge pull request #68 from openlabs/sharoonthomas-patch-1
Browse files Browse the repository at this point in the history
Import products without store_view filter
  • Loading branch information
tarunbhardwaj committed Feb 18, 2015
2 parents d7a25da + 9c54834 commit a7fd73b
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions product.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,19 +743,9 @@ def import_products(self, website):
with magento.Product(
instance.url, instance.api_user, instance.api_key
) as product_api:
magento_products = []
products = []

# Products are linked to websites. But the magento api filters
# the products based on store views. The products available on
# website are always available on all of its store views.
# So we get one store view for each website in current instance.
magento_products.extend(
product_api.list(
store_view=website.stores[0].store_views[0].magento_id
)
)
magento_products = product_api.list()

products = []
for magento_product in magento_products:
products.append(
Product.find_or_create_using_magento_id(
Expand Down

0 comments on commit a7fd73b

Please sign in to comment.