die musterdenker

Musterdenker twittern 2009-02-23

Tags:

Modul Avatarbilder für OXID eShop

Tags: , , , , , ,

Das Modul Avatarbilder für OXID eShop (mude_avatar) ist heute soweit fertig das wir es hier und bei google code veröffentlichen. Das Modul ist Open Source (GPL V3) und erweitert den OXID eShop (> 4.0.1.0) um Nutzerbilder neben den Kommentaren/Lieblingslisten. Jeder angemeldete Nutzer kann sein eigenes Avatarbild hochladen oder seinen Gravatar Account nutzen. Alles weitere auf der Projektseite.

Update auf Wordpress 2.7 und neues Design

TAGS: None

Nachdem wir mit »deineschokoladen« auf dem Wordcamp 2009 in Jena waren und uns von den Qualitäten von Wordpress 2.7 selbst überzeugen konnten, erfolgt nun nach und nach die Umstellung unserer Blogs auf die neue Version.

Einen kleine Bericht könnt ihr auf dem Deineschokoladen-Blog nachlesen. Der ist dann als nächstes dran mit einem Update.

Neben der neuen Version von Wordpress werden wir auch unserer Aktivitäten und Inhalte in diesem Blog erweitern. Wir werden einen Projektbereich einführen in dem wir unsere Projekte vorstellen. Weiterhin werden wir auch die Möglichkeiten verbessen um mit uns in Kontakt zu treten.

So viel zu einem ersten Status Update der Musterdenker.

Musterdenker twittern 2009-02-18

Tags:

  • der Musterdenker Blog läuft nun auf Wordpress 2.7 #nice #
  • morgen gehts los #megacoding #

Paypal Checkout with 3rd party shopping cart and discounts

Tags: ,

Problem:
I’m using paypals checkout by submitting a form to paypal that contains
all the articles, prices and quantities from my shopping card to
paypal. In fact thats a really nice and easy way to integrate paypal,
BUT I recently made a mistake. I wanted to add absolute discounts,
which is not possible! With relative discounts like 10% I could reduce
all prices of the articles in the my shopping card by 10% manually, but
when it comes to an absolute discount like 5€ for the whole basket
there is no way to do it. There is no special field for discount nor
could I add an article called “discount” with an negative price.
Another way to reduce the price of the articles one by one till the
discount is “dead” is a very ugly and user unfriendly solution as no
article is allowed to have a price of 0 (0.01 is minimum).

Solution:
The only easy and user friendly solution I could imagine was to build
in a fall back and pass the aggregated cart amount to paypal instead of
all articles. So deineschokoladen.com now shows all card items on
paypal checkout page only when no discount (voucher) is applied. In
case a user cashes a voucher the user only sees the aggregated sum on
paypal checkout page.

Deutschland on Rails

TAGS: None

Immer schon hatte ich nach einer Übersicht gesucht welche Seiten aus dem deutschen Sprachraum mit Ruby on Rails umgesetzt sind. Hauptgrund dafür war wohl sich nicht so alleine zu fühlen ….

Jedenfalls gibt es mit dem Startup Portal von yeebase dafür jetzt eine schöne Möglichkeit indem man unter dem Punkt Technologie nach dem Tag “ruby on rails” filtert und voila : http://startups.yeebase.com/techtag/ruby%20on%20rails es gibt immerhin schon 40 Treffer. Also sofort eintragen wenn Ihr hier noch nicht gelistet seid.

Google Product Search aka Froogle with Rails

TAGS: None

Yesterday I wanted to put all my articles (from deineschokoladen.com) from my Ruby on Rails application into the google product search formally knows as Froogle and again I was surprised how easy it was! Nevertheless I couldn’t find a tutorial about that topic, so I had to look up the facts at different places. So I’ll just put everything here at one place:

1. You need to trust big G and get a google account with which you can login into google base, There you can create articles (or nearly anything else like job adds, events, …) manually, or you can upload a data feed. As I wanted to put more then 1500 products online I choose the data feed.

2. Create the data feed in your rails app: Of course this depends on your application but it should be very easy to adapt the following code to your needs. First you need a controller action like this:

def froogle
@products = Products.find(:all)
xml_string = render_to_string :layout => false, :content_type => “application/xml”
send_data xml_string, :filename => “my.xml”
end

As we use xml builder (build in in Rails) the only thing we need now is a view called froogle.xml.builder which looks like this (this is with german attributes, for oterh countries have a look at google base for correct attribute names):

xml.instruct!( :x ml, :version => “1.0″, :encoding => “UTF-8″)
xml << ‘<rss version =”2.0″ xmlns:g=”http://base.google.com/ns/1.0″>’

xml.channel {
xml.title(”YOUR TITLE”)
xml.Link(”LINK TO PRODUCTS”)
xml.description(”A SHORT DESCRIPTION”)
for product in @products do
xml.item{
xml.title(product.title)
xml.description(product.description)
xml.link(”http://www.YOURAPP.com/products/” + product.id.to_s)
xml.tag!(”g:id”, product.id)
xml.tag!(”g:preis”, product.price)
xml.tag!(”g_mpn”, product.id)
xml.tag!(”g:bild_url”, product.image_url)
xml.tag!(”g:marke”, product.brand)
xml.tag!(”g:gewicht”, product.weitgh)
xml.tag!(”g:preisart”, “ab”)
xml.tag!(”g:hersteller”, product.manufacturer)
xml.tag!(”g:zustand”, “neu”)
xml.tag!(”g:produktart”, “PRODUCT_TYPE”)
}
end
}

xml << ‘</rss>’

Thats already all! just open you action like this YOURAPP.com/CONTROLLER/froogle?fromat=xml and you can download the XML file and afterwards upload it to google base.

As you need to renew the product data in google base frequently to be up to date, an automatic upload would be more convenient. So lets add a few more lines to our controller:

def froogle
@products = Product.find(:all)

xml_string = render_to_string :layout => false, :content_type => “application/xml”

my_file = File.new(”tmp/my.xml”, “w”)
my_file.puts xml_string

ftp = Net::FTP.new(’uploads.google.com’)
ftp.login(”FTPUSERNAME”, “FTPPASSWORD”)
ftp.putbinaryfile(”tmp/my.xml”, “my.xml” )
ftp.quit()

render :text => “done”

end

Be aware that ftp user/password has to be set up separately at google base and it can take more then 2h till they are working. Now when you invoke the “froogle” action your xml will be automatically transfered to and processed by google base.

Any hints and/or questions? Please leave a comment

© 2009 die musterdenker. All Rights Reserved.

This blog is powered by Wordpress and Magatheme by Bryan Helmig.