Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Nov 22, 2012 @ 09:08
    Rasmus Fjord
    0

    Teacommerce and "coupon codes". how to ?

    Hey :D

    So i wanna code some coupon codes for our customer, so far i have an idea on how to just wanna throw it out there to hear if you have done anything like it or have another solution.

    Im thinking about creating an area inside "content" where they can create new Coupon codes as nodes. On a "coupon" code there is a boolean if it should be a percentage or fixed reduction. Then also the value. 

    Along with it there will be a checkbox if it should debricate it self after use or if its persistent. And ofc a field for the "code" it self :)

     

    I was thinking about putting a inputfield inside the flow that throws an ajax call to a /base func where we go in and check if the code exists and reduces the current orders price. When the ajax call is done it would reload the current page to update the basket or something like that.

     

    Will this work ? Have anyone done something similar ?

     

     

  • Jan Højriis Dragsbæk 12 posts 63 karma points
    Nov 22, 2012 @ 09:41
    Jan Højriis Dragsbæk
    1

    Hi Ramus,

    We have internally done almost exactly this for a client.

    Handling price reductions like this is pretty simple. The way we handled this, was simply to check for a valid code in the respective nodes and if a valid code exists, we added a price-reduction product with an initial price of 0 and adjusted the price of this to some negative value, so it would show the correct reduction. In our case we only used percentages, but doing it with fixed prices and your checkbox is a perfectly valid way to do it.

    Regarding calling the base with an ajax call - it is a perfectly valid way to do it, as it is currently not possible to adjust prices with our javascript api, so you would need to manipulate this serverside somehow. 

    Another way to calculate this, is simply to add a xslt extension (if you use xslt) just before the prices are shown in step 4, that does the adding and calculating of the price reduction.

    - Jan

  • Rasmus Fjord 675 posts 1566 karma points c-trib
    Nov 22, 2012 @ 09:45
    Rasmus Fjord
    0

    Arh okay good with some approvel for my way of handling this feature :)

    I wouldnt want to do it through JS since price changes are supposed to happen on the server(imo) :) 

    And since ill be using a umbraco /base func thats the way it will work :)

Please Sign in or register to post replies

Write your reply to:

Draft