Okay
  Public Ticket #2266671
Coupons not saving
Closed

Comments

  • Matthew started the conversation

    Every time I try to add a new coupon and save, nothing happens. I just get the message "there are no results..."

  •  2,572
    Aleksandar replied

    Hello Matthew.

    Sorry for the inconvenience.

    Issues like this usually occur when there is a conflict either with the theme currently active on your website, or another plugin you have installed.

    Can you please change the theme and see if the issue is resolved? If not, then please deactivate all other plugins except for wpDataTables, refresh the page where the issue is, and see if it is resolved (it should be). If it is, then start activating other plugins one by one, and after each activation refresh the page to see if the issue reoccurred. Once it does reoccur, you will have found the plugin causing the issue.

    If that doesn't resolve the issue, there may be something wrong with the database.

    Please provide me a temporary WP-admin login for your site where this happens, so we could log in and take a look ‘from the inside’ as that’s the most efficient way to see and resolve the issue. We do not interfere with any data or anything else except for the plugin (in case that’s a production version of the site), and of course we do not provide login data to third party. You can write credentials here just check Private Reply so nobody can see them except us.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  •   Matthew replied privately
  •  2,572
    Aleksandar replied

    Hello again Matthew.

    Thanks for the credentials.

    I noticed that there's a console error when I access the "Finance page":

    3720623880.png

    And the response is:

    {"message":"Number '1.0E+15' must be greater than zero"}

    So, in file ../wp-content/plugins/ameliabooking/src/Application/Services/Reservation/AbstractReservationService.php

    I modified line 344, and changed this:

    if ($booking->getCoupon()) {
        $price -= $price / 100*
            ($booking->getCoupon()->getDiscount()->getValue() ?: 0) +
            ($booking->getCoupon()->getDeduction()->getValue() ?: 0);
        }
    return $price;
    }

    To this:

    if ($booking->getCoupon()) {
        $subtraction = $price / 100 *
            ($booking->getCoupon()->getDiscount()->getValue() ?: 0) +
            ($booking->getCoupon()->getDeduction()->getValue() ?: 0);
        return ((floor($price * 100) - floor($subtraction * 100)) / 100);
    }
    return $price;
    

    But the issue was still there, so I commented line 27 here: ../wp-content/plugins/ameliabooking/src/Domain/ValueObjects/Number/Integer/PositiveInteger.php

    and it returned the Coupons normally.

    The issue here is that you set the usage limit to be greater than what's allowed in the code (9999999999999999999). I lessened it to 99999, and it is working fine now.

    The issue has been forwarded to our developers, so they will add a limit at 1.000.000, and you shouldn't be facing this issue anymore.

    The commented line is now back (uncommented), and everything is up and running. Please check, and let me know.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables

  • Matthew replied

    Hi Aleksandar,

    That fixed it! Thanks so much for your help.

    Matthew

  •   Aleksandar replied privately