Last active
August 29, 2015 14:08
-
-
Save ferencbeutel4711/4fcf54c2457189f604b1 to your computer and use it in GitHub Desktop.
Erste Schritte
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
<% | |
require 'aboutyou-sdk' | |
shopApi = Ay.new(100, '3ed93394c2b5ebd12c104b177b928ad0') | |
%> | |
<head> | |
<%=shopApi.javaScriptTag%> | |
<script type="text/javascript"> | |
window.ayAsyncInit = function() { | |
// do stuff here with AY object | |
} | |
</script> | |
</head> | |
<body> | |
<button onclick="AY.openProductLayer( <%=shopApi.sessionId%>, 508247, <%=shopApi.appId%>)"> | |
Artikel anzeigen | |
</button> | |
</body> | |
</html> |
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
<% #Die Klasse AY stellt alle Methoden Verfügung, die du für deine App benötigst. | |
require 'aboutyou-sdk' | |
shopApi = AY.new(100, '3ed93394c2b5ebd12c104b177b928ad0') | |
productResult = shopApi.fetchProductsByIds( | |
[552223, 551937], | |
[AboutYou::SDK::Criteria::ProductFields::DEFAULT_IMAGE] | |
) | |
products = productResult.products | |
products.each do |id, product|%> | |
<%=puts product.name%> | |
<%if (product.defaultImage)%> | |
<%=product.defaultImage.url%> | |
<%end | |
end%> |
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
Das SDK liegt als RubyGem vor. | |
Dafür muss zuerst einmal RubyGems installiert werden: | |
https://rubygems.org/pages/download | |
Danach das SDK und alle abhängigen Pakete installieren. | |
gem install aboutyou-sdk |
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
<% | |
require 'aboutyou-sdk' | |
shopApi = Ay.new(100, '3ed93394c2b5ebd12c104b177b928ad0') | |
%> | |
<head> | |
<%=shopApi.javaScriptTag%> | |
<script type="text/javascript"> | |
window.ayAsyncInit = function() { | |
// do stuff here with AY object | |
} | |
</script> | |
</head> | |
<body> | |
... | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment