Project: Potion Store
Revision: 72
Author: andykim78
Date: 18 Mar 2008 19:26:56
Changes:* In the front page, show a @ character next to price to clarify that the input field is for quantity
* Round up floating point quantities
* Minor changes to README and LICENSE
Files:modified: /trunk/README (
try)
modified: /trunk/app/models/order.rb (
try)
modified: /trunk/LICENSE (
try)
modified: /trunk/app/views/admin/login.rhtml (
try)
modified: /trunk/app/views/store/order/new.rhtml (
try)
modified: /trunk/ChangeLog (
try)
modified: /trunk/app/models/line_item.rb (
try)
Diff:
| ... | ...@@ -5,7 +5,7 @@ |
| 5 | 5 | - PayPal Website Payments Pro support |
| 6 | 6 | - PayPal Express Checkout support |
| 7 | 7 | - Google Checkout support |
| 8 | | - Administration interface |
| 8 | - Administration interface with some simple sales charts |
| 9 | 9 | - Coupons |
| 10 | 10 | - Send lost license page (http://mycompany.com/store/lost_license) |
| 11 | 11 | - Google Analytics e-commerce transaction tracking support for PayPal and credit card orders |
| ... | ...@@ -13,8 +13,8 @@ |
| 13 | 13 | |
| 14 | 14 | == Dependencies |
| 15 | 15 | |
| 16 | | - Rails 1.2 or higher |
| 17 | | - Postgresql |
| 16 | - Rails 2.0 or higher |
| 17 | - Postgresql (a lot of people have gotten it to work with MySQL though) |
| 18 | 18 | - ruby-debug rubygem (I'm forcing this on you, but you really owe it |
| 19 | 19 | to yourself to try it out. It's way better than the built-in |
| 20 | 20 | breakpointer) |
| ... | ...@@ -54,4 +54,10 @@ |
| 54 | 54 | https://secure.potionfactory.com/store/notification/gcheckout |
| 55 | 55 | |
| 56 | 56 | That is the URL that Google uses to make callbacks. If you don't set this up, your customers will |
| 57 | | not get their orders delivered by email. |
| 58 | 57 | \ No newline at end of file |
| 58 | not get their orders delivered by email. |
| 59 | |
| 60 | |
| 61 | == Final Notes |
| 62 | |
| 63 | - I'd appreciate it if you kept the "Powered by Potion Store" link in the footer. It'll help more developers find the project. |
| 64 | |
| ... | ...@@ -253,7 +253,7 @@ |
| 253 | 253 | item.order |
| 254 | 254 | item.order = self |
| 255 | 255 | item.product_id = product_id |
| 256 | | item.quantity = Integer(items[product_id].sub(/^0+/, '')) # take care of leading zeroes so that the quantity does not get treated as an octal number |
| 256 | item.quantity = items[product_id] |
| 257 | 257 | next if item.quantity == 0 |
| 258 | 258 | if item.quantity < 0 |
| 259 | 259 | return false |
| ... | ...@@ -277,7 +277,7 @@ |
| 277 | 277 | if litem == nil |
| 278 | 278 | return false if not self.add_form_items({product_id => items[product_id]}) |
| 279 | 279 | else |
| 280 | | quantity = Integer(items[product_id]) |
| 280 | quantity = items[product_id] |
| 281 | 281 | # just ignore negative quantity |
| 282 | 282 | if quantity < 0 |
| 283 | 283 | next |
| ... | ...@@ -5,9 +5,6 @@ |
| 5 | 5 | |
| 6 | 6 | http://creativecommons.org/licenses/by-sa/3.0/ |
| 7 | 7 | |
| 8 | | Additionally, we ask that you credit and link to http://www.potionfactory.com/potionstore |
| 9 | | in the footer of your store. |
| 10 | | |
| 11 | 8 | ### |
| 12 | 9 | |
| 13 | 10 | Some software components bundled with this software are licensed to |
| ... | ...@@ -1,5 +1,5 @@ |
| 1 | 1 | <script type="text/javascript"> |
| 2 | | onload = function() { document.getElementById("username").focus(); }; |
| 2 | onload = function() { document.getElementById("username").focus(); } |
| 3 | 3 | </script> |
| 4 | 4 | |
| 5 | 5 | <h3>Magic Potion Required</h3> |
| ... | ...@@ -35,7 +35,7 @@ |
| 35 | 35 | </td> |
| 36 | 36 | <td> |
| 37 | 37 | <%= text_field "items", product.id, :size => "3", :value => @qty[product.code], :autocomplete => "off", :class => "qty" -%> |
| 38 | | <strong id="item_<%=product.id %>_price">$<%=product.price %></strong> each |
| 38 | @ <strong id="item_<%=product.id %>_price">$<%=product.price %></strong> each |
| 39 | 39 | </td> |
| 40 | 40 | </tr> |
| 41 | 41 | <% end -%> |
| ... | ...@@ -1,3 +1,8 @@ |
| 1 | 2008-03-18 Andy Kim <andy@potionfactory.com> |
| 2 | * In the front page, show a @ character next to price to clarify that the input field is for quantity |
| 3 | * Round up floating point quantities |
| 4 | * Minor changes to README and LICENSE |
| 5 | |
| 1 | 6 | 2008-02-29 Andy Kim <andy@potionfactory.com> |
| 2 | 7 | * Focus on the username field when loading the login page |
| 3 | 8 | * Admin side made a bit more iPhone friendly |
| ... | ...@@ -8,6 +8,11 @@ |
| 8 | 8 | validates_numericality_of :unit_price |
| 9 | 9 | |
| 10 | 10 | def quantity=(qty) |
| 11 | # take care of leading zeroes so that the quantity does not get treated as an octal number |
| 12 | qty = qty.strip.sub(/^0+/, '') |
| 13 | qty = 0 if qty == '' |
| 14 | qty = Integer(Float(qty).ceil) |
| 15 | |
| 11 | 16 | regenerate_keys = (self.quantity != qty) |
| 12 | 17 | write_attribute(:quantity, qty) |
| 13 | 18 | # Regenerate the license key if this is not a new record and the quantity changes |
To list