I am using a Python if statement within a script to set whether a product is available or not.
However, an out of stock statement that falls under certain circumstances is causing this to show as in stock when it is not.
Do I need to integrate a != type of logic or use something in the else statement, or even perhaps an else if?
Here is the code:
if is_prime == "Yes" or ("in stock" in stock_status.lower() and offered_by == "Offered by Amazon.") or ("in stock" in stock_status.lower() and is_addon == "Yes"):
usable_product = "Yes"
else:
usable_product = "No"
with this stock statement showing the item as In Stock when it is not
I need to preserve the in stock in lower case as other text can show such as "Only 6 left in stock--order soon" but perhaps add an exception for "Not in stock" or the text "deliver when available"
Aucun commentaire:
Enregistrer un commentaire