• Resolved Pynet

    (@pynet)


    Hi, we would like to know if there is an option that, with custom code, we can create our own point reward rules.
    We need to set a reward based on the total of an order (we work with Sliced Invoice). Although we can use the Invoice hook with custom type, we would like to award the points with a mathematical equation, such as, we award as many points as 1% of the invoice total and we ignore if with your plugin it is feasible.
    We can take care of the code ourselves, we just need to know if it can be done.
    Thank you very much.
    Best regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Dioni Sánchez

    (@dioni00)

    Hi @pynet

    Yes, you could do it if you know the specific hook that is launched when the order is registered in the Sliced ??Invoice plugin.

    GamiPress has the WC Points per Purchase Total add-on with which a percentage of points is awarded based on the total purchase price. It could serve as a reference

    https://gamipress.com/add-ons/wc-points-per-purchase-total/

    Also in the following links you can find information on how to create your personalized events.

    https://gamipress.com/snippets/tutorials/creating-a-custom-event/

    https://gamipress.com/snippets/tutorials/creating-a-custom-event-related-to-a-specific-post/

    Thread Starter Pynet

    (@pynet)

    <font style=”vertical-align: inherit;”><font style=”vertical-align: inherit;”>H</font></font>i,

    We got everything we wanted thanks to your tutorials, but we have one more question.
    As we only award 1% of the total invoice in points, it generates decimals, could these be cumulative or are they lost?
    I mean, 1% of 40,75€ would be 0.4575 points, would this mean that no points would be awarded to the user? And in future purchases would these decimals be lost?
    Thank you very much.
    Best regards

    Plugin Author Dioni Sánchez

    (@dioni00)

    Hi @pynet

    I’m sorry GamiPress points only support integers. In the example you show, no points would be earned since the rounding would be done to 0. The points obtained through the percentage must be equal to or greater than 1 to be taken into account.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Point Award’ is closed to new replies.