def solid_update_images(sku, image_urls): solid_api = SolidAPI() solid_product = SolidProduct() solid_product.custom_sku = sku solid_product.main_image = image_urls[0] solid_product.alternate_images = image_urls[1:] print(solid_product.as_update_dict()) solid_api.update_insert_product( solid_product.as_update_product_xml_string())
def inventory_from_default_to_solid(self): try: inventory = self.get_distributor_inventory_for_solid( self.inventory_from_default) solid_api = SolidAPI() solid_api.upload_list_items( [product.as_dict_for_solid() for product in inventory]) except: print('error.')
def get_distributor_inventory_for_solid(self, inventory_method): solid_api = SolidAPI() products = solid_api.get_products_from_file_by_mfr( self.manufacturer_short_name) inventory_objects = [ self.productids_solid_csv_dict_as_inventory_object(product_dict) for product_dict in products ] inventory = inventory_method(inventory_objects) return inventory
def get_order_from_solid_by_ebay_number(po_number): search_filter = SolidCommerce.OrderSearchFilter() search_filter.search_type = 'MarketOrderNumber' search_filter.search_value = po_number search_filter.page = '1' search_filter.records_per_page_count = '1000' search_filter_element = search_filter.as_element() solid_api = SolidAPI() order = solid_api.search_orders_v6(search_filter_element) return order
def ebay_api_competitor_inquiry_for_brand_for_zip(self, zip_code): solid_api = SolidAPI() ebay_api = eBayAPI() filepath = (self.get_manufacturer_file_path_root() + '/data/' + self.get_time_year() + '/ebay_competitor_scrape' + self.get_time_to_minute() + '.csv') solid_products = solid_api.get_products_from_file_by_mfr( self.manufacturer_short_name) cleaned_results = [] for product in solid_products: try: cleaned_results.append( self.clean_ebay_search_result( ebay_api.search_item( self.manufacturer_long_name + ' ' + product['Model Number'], zip_code)['Item'])) except Exception as error: print(error) self.write_list_of_dicts_to_csv(cleaned_results, filepath)
def ebay_update_image_and_description_solid(updated_products): solid_api = SolidAPI() for updated_product in updated_products: solid_api.update_product(updated_product.as_product_xml_string)
def get_products_from_file_by_mfr(self): solid_api = SolidAPI() products = solid_api.get_products_from_file_by_mfr( self.manufacturer_short_name) return products