Subscription start date

pbuickpbuick Member
in Bugs & Feature Requests edited September 2007
Is there any way that I can set it up so a subscription will start either on the 15th of the month, or the last day of the month, depending on which is closer?

What I am trying to accomplish is a way to ship my subscription products only twice a month, opposed a a few every day. Once a month seems to spread out, then again maybe I am being nit picky.
Comments
  • brettbrett FoxyCart Team
    Not nit picky at all. Check the subscription section here:
    http://wiki.foxycart.com/docs:parameters#product_attributes

    You can easily set a start_date for subscriptions, and it should be pretty easy to create some code to check the current date, then set the start_date accordingly.

    You should also check out this thread: http://forum.foxycart.com/comments.php?DiscussionID=37&page=1#Item_6
    Seems like you'd be really interested in that discussion, and might have some valuable ideas/requests.
  • brettbrett FoxyCart Team
    Update: Are you using PHP? If you're able to code it on your end, please feel free to put it in our wiki. If you need help, we'll help you get something going.
  • lukeluke FoxyCart Team
    The main reason we didn't build something like this into our system is that we don't want to get involved with hindering your business process. For example, let's say you'd like to do monthly donations on the 3rd and the 18th of each month. What happens if it takes your gift processing department 3 days to process a new recurring gift? Your website would have to be programmed to factor that 3 days into your system. So if today's date is the 16th and someone wants to give on the 18th of each month, your system would have to setup a start date of the 18th of next month.

    Make sense?

    It may take a bit of coding to get what you want, but the key result will be it's what you want. We're sick and tired of systems that try to do things for you, but never do them right. We try hard to not do that and be Foxy instead.
  • Great info guys, I didn't even think of doing it this way. makes a lot of sense.

    I personally don't really know any server side languages, although I am trying to learn them. PHP just happens to be the one I have messed around with the most.

    it seems simple enough, check what todays date is, then based on what day of the month it is one of two start dates is passed to foxy cart via a link or form. Is it possible to do a site wide variable for this, or does this script need to run on each page?
  • lukeluke FoxyCart Team
    Do you have a site-wide include file in your php? That would be the place to put it. If you need help with the specifics, let us know and we'll whip out some php for ya.
  • pbuickpbuick Member
    edited September 2007
    Thought I would share this, seems far too simple.

    The PHP Code
    <?php
    $d = date('j'); //set variable $d to the day of the month
    
    if ($d < 16) $subStart = '15';
    else $subStart = '31';
    
    ?>
    

    For the Button:
    <form action="https://YOURDOMAIN.foxycart.com/cart"; class="foxycart" method="post"><input type="hidden" name="phpMyAdmin" value="fbc82b46d67e062279320c2d5bfa4a74" />
    	<input type="hidden" name="name" value="A great product" />
    	<input type="hidden" name="price" value="5.00" />
    	<input type="hidden" name="sub_startdate" value="<?php echo $subStart; ?>" />
    	<input type="hidden" name="sub_frequency" value="1m" />
    	<input type="submit" value="Buy It Now!" />
    </form>
    
  • To clarify (because this is an old thread) there currently isn't a native way to support setting the startdate variable X days out from the current date? We'd need to use JS/PHP to accomplish this?
  • brettbrett FoxyCart Team
    Hi Josiah.
    Currently, no. Could you vote for that?
    http://requests.foxycart.com/
    I imagine we could do a similar format to the sub_frequency, so 1m would be "next month on today's date", while 30d would be "30 days from today". Would definitely be handy.
Sign In or Register to comment.