api.Products.count() doesn't work anymore?
Closed this issue · 2 comments
Expected behavior
api = bigcommerce.api.BigcommerceApi(
client_id=clientID,
store_hash=store_hash,
access_token=accessToken)
count = api.Products.count()
print(count)
prints count
Actual behavior
api = bigcommerce.api.BigcommerceApi(
client_id=clientID,
store_hash=store_hash,
access_token=accessToken)
count = api.Products.count()
AttributeError: type object 'Products' has no attribute 'count'
Steps to reproduce behavior
python 3 pip install bigcommerce-api
running in powershell terminal
still unable to use count to paginate however I was able to find a way around it to loop through pages
`
def allproducts():
onepage = 250
page = 1
while True:
products = api.Products.all(page=page,limit=onepage)
if str(products) != "{}":
print(str(products))
time.sleep(2)
page += 1
if str(products) == "{}":
print("finished")
break`
So I dug around in my system where the pip files are installed and realized that a bunch of bigcommerce was corrupt or missing so I reinstalled and it works fine the original way again.