Adding special offers to website - ruby-on-rails

I am new to web development. Currently I am designing a website where people can purchase different stuff. The website has got a number of special offers such as if you shop for more than $200, you get 20% off, if you shop for 3 similar items, you get a fourth one free.
Can anybody just point me in the right direction what is the best way to do this? Also if the offer changes, I donot have to change a lot of code.
thanks!

You can use various e-commerce and payment gems like the ones in Railscasts.
Some more gems for this purpose are here - The Ruby Toolbox and here too.
As mentioned in the comments, you can use the Saas products like Shopify but that's not free.

I'll point you to some code that should help you out.
For example, " if you shop for 3 similar items, you get a fourth one free. " in ror_ecommerce this is a "Deal". The code is here:
https://github.com/drhenner/ror_ecommerce/blob/master/app/models/deal.rb
This code is not straight forward but basically looks for the best deal an order qualifies for.
if you have buy 2 get one free you might want to implement buy 4 get 2 free and buy 6 get 3 free...
Similiarly ror-e has sales. The only thing you would need to add is a condition for order.total and pass that value into the Sale.for method.
I hope this helpss
DISCLAIMER: I wrote the code!

Related

Rails app for food truck, using twitter to update the google map.

So I am writing a rails application for my friends food truck business.
The functionality that I am trying to create with this specific application is the ability for him to update the google map by posting a Geo-location tag on twitter.
A lot of the ruby gems that deal with google maps seem to be depreciated so I'm a bit lost at the moment. If anyone could just point me in the correct direction I would appreciate it.
I realize that this feature is just a quality of life feature but id like to be able to do it with embedded ruby and not have to break out the JavaScript (ugh). Ideal this kind of automation would be great for this particular type of website because my friend won't always have access to the back-end of the website when he is on the move. (Already able to update a map from an admin backend but its not good enough for a business that moves multiple places in a given day.)
anyways, thanks in advance. (if anyone wants me to post any of my code I will.)
So after reading your question, I thought it would be fun to tinker with the Twitter API again since I haven't used it in a while.
I went ahead and created a sample application for you that basically does what you were asking for. It looks for recent tweets from a user, grabs the latest one, then updates a Google map with a marker on that location.
Keep in mind that this was quickly thrown together, so it's far from perfect. But all the concepts should be there!
Feel free to reach out if you have any questions about the app or anything else. I'm always happy to help.

Filghts Search Engine

I would like to integrate in my web site a flights search engine. I am wondering how can i do this. Who sells this kind of service? or there is an elegant and easy way to this?
ps: of course i need the possibility to books the flights.
FlightStats has an API that may serve your purposes, depending on your use case.
(If you want to do bookings and such it won't help you there, but it will show you flights for the next several days, as well as data for flights in the air).
If you need information for bookings, you're pretty much stuck going to Sabre.

Has anyone got any experience using Pfeed? I have several issues to build up a 'recent activity' log

I have started trying to use Pfeed plugin for my Rails app. Apart from four support pages of wiki on the Github, I only found this blog post helpful for me to start using.
I have managed to get the simple feeds working like "User bought 12 items about 1 minute ago" etc. But when it comes to customize the feed items, that's where I have having issues to proceed. Pfeed uses Model&View items for each feed configuration and I found out that models are working as it should be. Very frustrating.
Has anyone used this Plugin before? If so, please do let me know how it goes. Also if you have ever used any other good plugins for this sort of Recent Activity feature, please show me the way.
Many thanks.
Phyo
Not sure if it's the answer you're looking for, but I looked through a bunch of timeline generators and settled for timeline_fu
It's quite easy to use (I ended up forking it and making some edits so save some extra variables etc. but it was really easy to do).

Where I can find an engine like OFPS Open Feedback Publishing

I'd like to write a little book on personal topics together with two friends of mine, remotely located. Do you know of any FOSS content publishing system like the one from O'Reilly (OPFS)?
I saw the one that powers the django book but It seems that the code It's not released yet. I accept any kind of backend technology for this project.
I'd like to:
edit the book on the web and let my friend do the same after authentication.
anyone of us could comment other's entries.
You could use Google Wave. You get the benefit of watching where others are editing / you can roll back the whole doc or specific parts / comment on specific parts plus you can use it from any computer so you don't have to be home or carry a laptop to edit your book when inspiration hits you.
OK, I'm going to roll out my own solution following the direction written here. I like a lot thigs like bitesizeedits or leanpub. The base will be a multiuser platform: mu. I'm quite fond with wordpress and as version control I'm happy with GIT. The commenting system will be digress.it.

How to pull down bank transaction records?

I have noticed that some applications provide functionality allowing the user to pull down transaction records (usually for credit cards) from an online banking system. Usually specific banks are supported.
What is the general method to achieve this (i.e., using an API, or something else)? I have seen a web app that supports the bank that I want to pull down transaction records from (ANZ), so I know it's achievable - but have not been able to find any references to any kind of online banking API.
I intend to implement a solution in Ruby on Rails, but I imagine the underlying method would hold regardless of the language used.
Perhaps the bankjob gem might be useful:
http://bankjob.rubyforge.org/
Contact the bank in question and ask them for their API - most of the information you want relates to the security/automated logon issues. the actual data is usually just transferred as a CSV file.
I know easier said than done, but be persistent until you actually are talking to someone in the IT area who can answer questions and not just lawyers and front people. It helps to do some of this in person rather than by email or phone - banks are conservative organizations after all (and if your money is in that bank you want them to be).
EDIT:
Now when dealing with banks don't be surprised if you run into stuff like this:AMEX Security - what's behind this jaw dropping stupidity? - a legacy mainframe system that only accepts 6-8 character, lowercase, alphanumeric entries with no spaces and no special characters. This is why most banks are reluctant to let people know about any outward facing APIs.
Hi I know this is 6 years later but... I thought i would answer it so that future users(like me ) could come up with a solution.
Banks now have api's so you could use something like httparty gem to parse api data.
A simple option is yodlee and their api, or if using rails the Yodlee-icious gem.
hope that helps.

Resources