I'm considering doing the macworld indie spotlight:
http://www.macworldexpo.com/indiespotlight
But the way they handle the 20% discount is via a special 'link' --
I'm wondering if there is some way to form a url to a potion store to
auto-fill the coupon code (so I can provide them a link like
http://mystore.com/?coupon=macworld)
I took a peek through but I didn't see anything obvious (but honestly
my Ruby skills are pretty weak and I haven't touched it in a long
time)
Thanks
-john
Not the cleanest code, inline styles and all, but works for me.
And you can see it in action here:
https://store.madebyrocket.com/store?c=MWEXPODISCOUNT
hope that helps.
Best,
Brian
> --
> You received this message because you are subscribed to the Google Groups "Potion Store Discussions" group.
> To post to this group, send email to potion...@googlegroups.com.
> To unsubscribe from this group, send email to potion-store...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/potion-store?hl=en.
>
>
1. I'm trying to get the same thing set up, integrated your code, and
it works *except* that the "coupon code" field is not automatically
filled with the coupon. You can go here to see:
https://secure.wanderingmango.com/?c=MW2010
Now, "MW2010" should appear in the coupon field, but it doesn't. (If
the user fills it in manually, everything works as expected.) Any
ideas?
2. I discovered that I can use a global "percentage off" coupon by
going into the database and editing percentage to 20, and then
replacing this line in Brian's new.rhtml:
<%= number_to_currency product.price - @coupon.amount %>
with this line:
<%= number_to_currency (product.price - product.price *
@coupon.percentage/100) %>
> I'm considering doing the macworld indie spotlight:
>
> http://www.macworldexpo.com/indiespotlight
>
> But the way they handle the 20% discount is via a special 'link' --
> I'm wondering if there is some way to form a url to a potion store to
> auto-fill the coupon code (so I can provide them a link like
> http://mystore.com/?coupon=macworld)
I made a quick and dirty patch to enable URLs like http://my-store-url.com/?coupon=ABCDEF01234567890. The patch consists of 2 parts:
http://gist.github.com/295073 -- enables pre-filling coupon code when a store URL like above is clicked;
http://gist.github.com/295075 -- makes coupon code from URL take priority over any session-stored coupon code.
--
Gleb Dolgich
http://pixelespressoapps.com
One thing is that I also look for a cookie. Instead of having my store be the landing page, I give an URL to my main product page. It looks at the param and sets a cookie such that when the user does get around to going to the store, they get the discount. Here's my simple patch to your patch to order_controller.rb:
The part where you set the cookie I leave as an exercise to the reader.
paul
--- a/app/views/store/order/new.rhtml
+++ b/app/views/store/order/new.rhtml
@@ -36,7 +36,9 @@ $(document).ready(function(){
<%= text_field "items", product.id, :size => "3", :value => @qty[product.code], :autocomplete => "off", :class => "qty" -%>
@
<strong id="item_<%=product.id %>_price">
- <% if @coupon && !@coupon.expired? %>
+ <% if @coupon && !@coupon.expired?
+ session[:coupon_text] = @coupon.coupon if @coupon;
+ %>
<strike>
<%= number_to_currency product.price %>
</strike>
- Stefan
On Feb 4, 2010, at 6:05 AM, Brian Cooke wrote:
Thanks for the great responses -- It was much more than I was
expecting! I'm happy to say my store is now auto-fillable!
-john