close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Membership Renewals

Thread began 7/29/2009 6:37 am by info381905 | Last modified 7/30/2009 8:11 am by info381905 | 1608 views | 4 replies

Ray BorduinWebAssist

WebAssist tools are built with mySQL and PHP. You can already do anything you want with mySQL and PHP, so anything is possible. You can do anything you can imagine with them even without our tools.

It is kind of like asking if our tractor and basic construction tools can build your house if you have all of the raw materials necessary. It isn't going to build it for you, but it sure is easier that using your bare hands.

Our tools won't design your database, or tell you what you want to do... you will have to do at least some level of thought and work to get it done. I don't know if you can do it or not, but I can explain one way I could imagine doing it, but it won't be achieved by Webassist, it will have to be achieved by you:

In this case you can use powerstore for your store. Powerstore is already set up to keep track of the date of sale and user and include the userid with the sale.

You would have to decide the page(s) where you want your button to appear and add it. Start with that and get it working so that they can buy 12 month memberships constantly.

Then you would want to probably add a field to the order details table to include the "active date" because if someone ups their membership after 11 months you wouldn't want to expire 12 months after, but 12 months after the original membership was created.

This would mean adding a column like: "DetailActiveDate" to the orders table and setting it to the date when someone signs up for their first purchase for the original purchase and based on 12 months from the last ActiveDate on any renewal.

Since you will have a separate button for the renewal you can take advantage of that for the differentiation.... this means adding a column to the cart for the ActiveDate and setting it in the add to cart interface as I explain below.

On the page where the subscription is originally purchased you can set it to <?php echo(date('Y-m-d')); ?>

On the renewal page you would want to get it from the recordset. You will have to create a recordset with the user's most recent purchase in order to find out if it has been more than 12 months since that date, so you can use that same recordset to determine when to show the button as well as what to set the cart column to.

The SQL statement would be something like:

SELECT OrderActiveDate FROM orders INNER JOIN orderdetails WHERE OrderUserID = IDParam AND DATE_ADD(OrderActiveDate, INTERVAL 12 MONTH) > NOW() AND DATE_ADD(OrderActiveDate, INTERVAL 11 MONTH) < NOW() ORDER BY OrderActiveDate DESC LIMIT 1

This way you could get the order active date which is between the 11th and 12th month after activation, or an empty recordset.

Now you can highlight your renewal button and use the "Show if recordset is not empty" server behavior to only show that button when it has been more than 11 months since the last purchase.

Update your add to cart button and set your ActiveDate column to:
<?php echo(strtotime($row_rsname['OrderActiveDate']. ' + 12 months')); ?>

That way when the renew they will be renewing starting 12 months from the last renewal.

Then update your Store Cart Details In Database server behavior to store the renewal date in the orders table.

It is actually fairly simple if you know what you are doing... a lot like driving a wrecking ball truck.

Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...