spree / spree

An open source eCommerce platform giving you full control and customizability. Modular and API-first. Build any eCommerce solution that your business requires. Developed by @vendo-dev
https://spreecommerce.org
Other
12.85k stars 4.93k forks source link

Promotions are not working as expected #2187

Closed elneilios closed 11 years ago

elneilios commented 11 years ago

Hi,

I'm having a lot of trouble getting promotions to work in the demo sandbox that has been provisioned for me.

Just to set the scene, I have a customer who is using Spree and they would like to encourage new users to sign up so they would like to run a promotional campaign with a promo code.

I have setup a promotion to test this in the sandbox site as follows:

Event = Coupon code added No usage limit Start and Expiry are valid (1-11-2012 to 30-11-2012) Rule 1 = Must be customer's first order Action = Flat Percent (20%)

I am testing this by logging out of admin, adding a product to my cart, going to checkout and either registering a new user or using a guest checkout, enter all the details including the promo code in the payment screen. But every time I try it, I do not get a promotional discount.

I have tried other options too, such as the User sign-up event so that if a new user signs up when purchasing a product they will get the discount. Problem is that even if I use the guest checkout, I get the discount. I tried adding the User must be logged in rule so that only new sign ups get it but then nothing worked any more.

I can only guess I am doing something wrong because I find it hard to believe the system can be completely broken?

Regards, Neil Alderson

radar commented 11 years ago

Can you please provide some steps to reproduce this issue from a fresh install of Spree? Please include the version number for spree that you're using.

elneilios commented 11 years ago

I included steps for reproduction in the initial comment, these steps were carried on a demo sandbox provisioned by Spree via their website. Here's the URL: http://monster-showroom-5115.spree.mx/

I'm not sure how to tell what version this is but it was provisioned on 15/10/2012 and was the latest stable version from that date.

radar commented 11 years ago

Ok, thanks for the information. I'll look into it.

radar commented 11 years ago

I am unable to reproduce this issue on master. I tried these two different ways:

1) Logged in an existing user, no current order. Click "Add to Cart" on a product. Enter coupon code. Coupon code has been applied to order. 2) Not logged in as any user, no current order. Click "Add to Cart" on a product. Register a new user account using spree_auth_devise as the registration platform. Go back to checkout and enter coupon code. Coupon code has been applied to order.

If you can reproduce this issue on master yourself, then I would be more than welcome to look into it again. It seems to me that this problem, if it existed, has been fixed already. Nevertheless, we definitely appreciate you bringing it to our attention! The promotions engine is a fickle beast.

njc1 commented 11 years ago

Hi,

I work with elneilios and have followed the steps outlined by radar against the same test installation but the issue is still occurring. Our customer really needs this (or a similar form of promotion) to work as soon as possible so any assistance would be much appreciated.

Thanks.

njc1 commented 11 years ago

Can someone help with this please?

radar commented 11 years ago

@njc1: Which version are you trying it on?

elneilios commented 11 years ago

@radar We are testing this using the Personal Sandbox that is provided by Spree on this page: http://spreecommerce.com/demo

The sandbox site can be found here: http://monster-showroom-5115.spree.mx/ Username: spree@example.com Password: spree123

I'm not sure which version of Spree this is but it was created on 15-10-2012. Please feel free to login and take a look around.

radar commented 11 years ago

My concern is that this sandbox generated app isn't the latest and so could possibly not contain fixes from more recent versions of spree.

Are you at all able to try this out locally?

On 21/11/2012, at 20:24, Neil Alderson notifications@github.com wrote:

@radar We are testing this using the Personal Sandbox that is provided by Spree on this page: http://spreecommerce.com/demo

The sandbox site can be found here: http://monster-showroom-5115.spree.mx/ Username: spree@example.com Password: spree123

I'm not sure which version of Spree this is but it was created on 15-10-2012. Please feel free to login and take a look around.

— Reply to this email directly or view it on GitHub.

radar commented 11 years ago

What I am seeing locally is the message "Promotion applied to order", but then no visible adjustment on the order. Can you verify this is what you're seeing also?

elneilios commented 11 years ago

I don't see any message on the sandbox site. The coupon code input is located on the same page as the credit card input. I fill in the credit card section with the fake card and then add the coupon code, hit "Save and continue" and then I see the summary page with no indication that the code was applied anywhere.

emyl commented 11 years ago

Hi,

I've just stumbled upon a very similar issue (probably the same) while testing the spree_auth_devise dummy app:

$ bundle exec rspec -e 'adjustment if a user signs up as a real' spec
Run options: include {:full_description=>/(?-mix:adjustment\ if\ a\ user\ signs\ up\ as\ a\ real)/}
F

Failures:

  1) promotion adjustments provides a promotion for the first order for a new user with an order correctly applies the adjustment if a user signs up as a real user
     Failure/Error: page.should have_content("Promotion (Sign up)")
       expected there to be content "Promotion (Sign up)" in "ORDER SUMMARY Item Total: $40.00 Order Total: $40.00"
     # ./spec/requests/promotion_adjustment_spec.rb:74:in `block (5 levels) in <top (required)>'
     # ./spec/requests/promotion_adjustment_spec.rb:73:in `block (4 levels) in <top (required)>'

Finished in 25.51 seconds
1 example, 1 failure

In my case the issue seems to be related to "First order" rule: commenting out these 2 lines in the spec file:

      #select "First order", :from => "Add rule of type"
      #within("#rule_fields") { click_button "Add" }

The test pass successfully.

radar commented 11 years ago

I think you're right that this test issue is related. I am looking into it.

radar commented 11 years ago

Please try the latest master or 1-2-stable with Spree and see if this issue is still happening. The spree_auth_devise test has been fixed. The related commits are 8336293dd638c36ed2e0f7296005b57b5c799eea for 1-2-stable and 04584bbffceb557449ae2be80f387a293608ac4a for master.