Created
November 12, 2011 19:43
-
-
Save pbonnell/1361007 to your computer and use it in GitHub Desktop.
Stub for SIRCLE Suggest Product
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.post_product_suggestion(user, data) | |
#TODO: STUBBED HERE UNTIl SIRCLE implements | |
action_id = nil | |
return_data = post('/Actions', user) do |xml| | |
xml.TrackingActionRecommendation(:xmlns => SIRCLE_XML_NS) { | |
xml.ActionID action_id # SIRCLE will tell us! | |
xml.CategoryName 'Products' | |
# brand_id would be INT of existing Brand , brand_name would be User input String of New brand | |
xml.Brand = data['brand_name'] || data['brand_id'] | |
xml.ProductName = data['product_name'] # User input String of product name | |
# subcategory_id would be INT of existing Subcategory , brand_name would be User input String of New subcat | |
xml.SubcategoryID = data['subcategory_id'] || data['subcategory_name'] | |
} | |
end | |
return_data['ProductID'] # the SIRCLE ID of the new Product | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment