Skip to content

Instantly share code, notes, and snippets.

View ferencbeutel4711's full-sized avatar

Ferenc Beutel ferencbeutel4711

View GitHub Profile
@ferencbeutel4711
ferencbeutel4711 / 1.rb
Last active August 29, 2015 14:11
start_page
require 'aboutyou-sdk'
ay = AY.new('100', '3ed93394c2b5ebd12c104b177b928ad0')
criteria = ay.product_search_criteria.select_product_fields([
AboutYou::SDK::Criteria::ProductFields::DEFAULT_IMAGE
])
products = ay.fetch_product_search(criteria).products
products.each do |product|
puts 'Image Source:' + product.default_image.url(500, 500)
puts product.name
@ferencbeutel4711
ferencbeutel4711 / install
Last active August 29, 2015 14:10
Blog_code
gem install aboutyou-sdk
@ferencbeutel4711
ferencbeutel4711 / Bilder anzeigen.rb
Last active August 29, 2015 14:08
Produkte laden und Ausgeben
#Der Aufruf der Methode getUrl(250, 250) sorgt dafür, dass das Bild in der entsprechenden Größe angefordert und angezeigt wird.
require 'aboutyou-sdk'
shopApi = AY.new(100, '3ed93394c2b5ebd12c104b177b928ad0')
criteria = shopApi.productSearchCriteria.selectProductFields([
AboutYou::SDK::Criteria::ProductFields::DEFAULT_IMAGE
])
<%
require 'aboutyou-sdk'
shopApi = Ay.new(100, '3ed93394c2b5ebd12c104b177b928ad0')
%>
<head>
<%=shopApi.javaScriptTag%>
<script type="text/javascript">
window.ayAsyncInit = function() {
// do stuff here with AY object
}