big changes, sorry
This commit is contained in:
@@ -214,11 +214,16 @@ class RobotVacuumYMLGenerator:
|
||||
if not list(self.categories):
|
||||
raise ValueError("No categories added to the YML feed.")
|
||||
|
||||
# Add offers for each product
|
||||
for product in products:
|
||||
# ✅ Фильтрация товаров дороже 300 злотых
|
||||
filtered_products = [
|
||||
product
|
||||
for product in products
|
||||
if product.get("prices", {}).get("mainPrice", 0) > 300
|
||||
]
|
||||
|
||||
for product in filtered_products:
|
||||
self.add_offer(product)
|
||||
|
||||
# Write the XML tree
|
||||
tree = ET.ElementTree(self.root)
|
||||
tree.write(output_yml, encoding="UTF-8", xml_declaration=True)
|
||||
print(f"YML feed generated: {output_yml}")
|
||||
|
||||
Reference in New Issue
Block a user