Okay
  Public Ticket #3108862
Creating a Coupon code with a time frame.
Closed

Comments

  •  4
    Richard Arto started the conversation

    Is there a way to create a coupon code with an expiration date, or I should say an effective start and end date for the coupon code? I'm not seeing it in Amelia. So I am assuming no.  Could that be added anytime soon? This is pretty critical for my business. 

    I see you can limit it by only the number of times a customer uses the coupon, but that doesn't completely solve my problem below.

    For example,

    We have a coupon code for October only to give a one time $ 40 massage. So the problem is if a client books an appointment now in August for November they still are getting the $40 discount. It should only apply to October bookings. 

    If there isn't a way in Amelia's front-end, I see in Woocommerce I am able to do it on products, but the problem is there is no link between the product and the Amelia appointment data and time. I need a PHP function with a hook in Wordpress to connect that Amelia appointment and to the Woocommerce coupon code I can create in Woocommerce.  Do you have any PHP functions for this I can put in my Wordpress?

  •  1,617
    Marko replied

    Hello Richard,

    This is how you can connect the product to the services

    7067572915.png

    But this option that what you want, which is related to the date and time, unfortunately, currently, this feature is not built-in in Amelia.

    Even if we were to add the function when the coupon expires, it would mean that the coupon can be used until that date, which further implies that the customer could still book now in January if your period available for booking in advance is long enough to book so much in the future.

    We are not sure that this can help you but you can try to achieve this with Amelia's hooks. Amelia currently has the following hooks:

    <script>
    window.ameliaActions = {
      ViewContent: function (success = null, error = null, data) {
        //triggered when the form loads
        console.log('ViewContent HOOK')
        console.log(data)
        console.log('------------')
      },
      SelectService: function (success = null, error = null, data) {
        //triggered when the service is selected/changed in the form
        console.log('SelectService HOOK')
        console.log(data)
        console.log('------------')
      },
      SelectEmployee: function (success = null, error = null, data) {
        //triggered when the employee is selected/changed in the form
        console.log('SelectEmployee HOOK')
        console.log(data)
        console.log('------------')
      },
      SelectLocation: function (success = null, error = null, data) {
        //triggered when the location is selected/changed in the form
        console.log('SelectLocation HOOK')
        console.log(data)
        console.log('------------')
      },
      SelectCategory: function (success = null, error = null, data) {
        //triggered when the category is selected/changed in the form
        console.log('SelectCategory HOOK')
        console.log(data)
        console.log('------------')
      },
      SelectPackage: function (success = null, error = null, data) {
        //triggered when the package is selected/changed in the form
        console.log('SelectPackage HOOK')
        console.log(data)
        console.log('------------')
      },
      InitiateCheckout: function (success = null, error = null, data) {
        //triggered once the customer lands on the "info" page where they fill in their details
        console.log('InitiateCheckout HOOK')
        console.log(data)
        console.log('------------')
      },
      Schedule: function (success = null, error = null, data) {
        //triggered once the 'on-site' booking is completed
        console.log('Schedule HOOK')
        console.log(data)
        console.log('------------')
      },
      Purchased: function (success = null, error = null, data) {
        //triggered once an online booking is completed
        console.log('Purchased HOOK')
        console.log(data)
        console.log('------------')
      },
      beforeBooking: function (success = null, error = null, data) {
        //triggered when the "Confirm" button is clicked but before the booking is completed.
        //This hook currently doesn't work for Mollie and WooCommerce payments
        console.log('Before booking is created HOOK')
        console.log(data)
        console.log('------------')
      },
    }
    </script>

    These are the same hooks used in Google Analytics and Facebook Pixel integrations, but if you need some other hooks added, please let us know which ones and explain what they would contain and when they should be triggered.

    We're not sure you'll be able to do that because WooCommerce sells products, not appointments. Amelia uses it only as a payment gateway and has nothing to do with the functionality of WooCommerce.

    I'll kindly ask you to add it as a feature suggestion on this page

    Features are pushed up on our "to-do" list when there are a lot of customers requesting those features, so having your vote as a customer can be beneficial to this feature being developed sooner.

    Hope this helps.

    We wish you all the best.

    Kind Regards, 

    Marko Davidovic [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

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

    Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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

  •  4
    Richard Arto replied

    Thank you Marko for the reply. 

    I've never really worked with web hooks before. 

    I'm new to php. Are these webhooks below PHP and would they be inserted in the functions.php file in Wordpress?

  •  1,617
    Marko replied

    Hello Richard,

    You are most welcome, but working with webhooks requires basic coding skills, and it's not included in the provided support for the plugin. Unfortunately, I will not be able to assist you with this any further.

    If you have any more questions please open another ticket and we will gladly help you there.

    We wish you all the best.

    Kind Regards, 

    Marko Davidovic [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

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

    Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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

  •  4
    Richard Arto replied

    I wasn't asking you to help me program these hooks, it was more of a question on what type of scripts these were  like Java Script or PHP? I am assuming PHP?

    Funny you mentioned basic programming skills, I am actually a database developer for 16 years and I do some web applications. I am new to PHP and MYSQL. I come from a Microsoft background and SAS. 


  •  1,617
    Marko replied

    Hello Richard,

    I have checked with my colleagues you will not be able to achieve this with JS hooks, you would have to change the code. We plan to add this in the future, and for now, you can only explain to us where you want to change the logic and we will try to help, but it will not be saved after the update.

    And since we are constantly improving Amelia and we will have several updates, then you would have to adjust it again every time after the update. An update would be necessary for the plugin to function properly and for you to have access to our support because we do not provide support for older versions because we cannot know what the exact issue is because the plugin does not use the latest version in that case.

    Looking forward to your reply.

    Kind Regards, 

    Marko Davidovic [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

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

    Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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

  •  4
    Richard Arto replied

    That makes sense. I ended up finding a work around for my coupon issue. I got it resloved. Thank you for getting back to me.

    Speaking of updates. After there was an Amelia version update a few days ago the appointments aren't even showing up in the application and the services aren't showing in the notifications. All my notifications got deleted too. I put in a separate ticket for this. Thanks 


  •  1,617
    Marko replied

    Hello Richard,

    We are glad to hear that you found a workaround. As for the second ticket, we are processing the tickets in the order they arrived, and as soon as my colleagues reach to that ticket, they will reply to you. In the meantime, try to purge the cache from the entire site and do F12, then right-click on the refresh arrow in browser and empty cache and hard reload. It is very possible that it is just a caching issue.

    If you have any more questions please open another ticket and we will gladly help you there.

    We wish you all the best.

    Kind Regards, 

    Marko Davidovic [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps, floor plans, choropleth maps, and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

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

    Amelia: FAQ | Facebook | Twitter | Instagram | Amelia 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