Promo Code bringing proce to 0 does not work

Home Forums Ticket Products Event Tickets Plus Promo Code bringing proce to 0 does not work

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #947542
    tuberb
    Participant

    We are using The Events Calendar Pro with EDD Tickets.

    We have some events that are free to members, and we have logic to adjust the price before the product hits the cart, and for those, checkout works fine.

    We have other events with special promo codes that are given to specific clients, which reduce the price of the event to 0. When an event like that is in the cart and the promo code is applied, clicking the submit button for checkout does not proceed, and the client is stuck.

    Is there a way to get this working, or is there a workaround?

    Thanks,

    Barry

    #947656
    Josh
    Participant

    Hey Barry,

    Thanks for reaching out to us!

    I tested out the discounts on an event ticket on my local install and was able to complete a purchase successfully. A couple of quick questions to ensure I’m testing the same thing you’re experiencing:

    • Are you solely using the built-in Discount functionality available within EDD to manage the discounts or is there an additionally add-on you’re using to add more flexibility to those discounts?
    • Is the discount a blanket discount or did you add parameters that required multiple items to be added to the cart or exclude any items from being used with this discount? https://cloudup.com/cF-4vkoxQQI

    Thanks!

    #947735
    tuberb
    Participant

    I did some more work on this, and actually posted another question here: https://easydigitaldownloads.com/support/topic/applying-discount-to-item-with-a-price-filter/ which provides more detail and screenshots. The issue seems to be the way the cart subtotal is being calculated, which seems to be circumventing our custom pricing logic, even though the logic is correctly being used to display the item price itself. There is nothing special about the way we are doing discounts, but we do have special functions to override pricing.

    I have not gotten a response back from the EDD folks yet, so if you can tell me anything, that would be great.

    Barry

    #947771
    tuberb
    Participant

    Figured this out. My custom pricing function has logic in there that checks is_admin() and returns the default price if true, which was put in to show the default price in the Events and Downloads admin pages. The discount code is applied, and the cart re-totaled via ajax, and I did not realize that ajax calls have is_admin() true in their context, and because of that my function was returning a different price than in non-ajax mode.

    I turned my test of is_admin() into if ( !defined( ‘DOING_AJAX’ ) && is_admin() ) and I am now getting the correct result.

    #948071
    Josh
    Participant

    Hey,

    Thanks for following up! I’m glad you were able to get this issue resolved.

    I’ll go ahead and close this ticket for now. If you have any further questions, please don’t hesitate to open a new ticket.

    Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Promo Code bringing proce to 0 does not work’ is closed to new replies.