def execute():
    if not is_shopify_enabled():
        return

    sync_fixtures("erpnext_shopify")

    fieldnames = frappe.db.sql("select fieldname from `tabCustom Field`", as_dict=1)

    if not any(field["fieldname"] == "shopify_supplier_id" for field in fieldnames):
        return

    frappe.db.sql("""update tabSupplier set shopify_supplier_id=supplier_name """)
    frappe.db.commit()
def execute():
	if not is_shopify_enabled():
		return

	sync_fixtures('erpnext_shopify')
	
	for index, shopify_item in enumerate(get_shopify_items(ignore_filter_conditions=True)):
		name = frappe.db.get_value("Item", {"shopify_product_id": shopify_item.get("id")}, "name")
		supplier = get_supplier(shopify_item)
	
		if name and supplier:
			frappe.db.set_value("Item", name, "default_supplier", supplier, update_modified=False)
					
		if (index+1) % 100 == 0:
			frappe.db.commit()