View Single Post
  #10  
Old 07-01-2009, 10:49 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Subscription Status If/Then

Hi again -

I suspect this mod will not be in the "easy" category - you're going to have to dig around. I'll help best I can - but remember - I am speculating a lot - I don't have experience with subscriptions. I also don't have time to run test cases and figure this out, so you will have to do the heavy lifting. If it looks too hairy - you can just write up exactly what you want accomplished and post to the Professional Help Services Request forum or to QT.

First - I doubt there is an equivalent to the membership variable in the database for subscriptions. You can look in the tables in the database to see if something is there. Compare it to how membership id is handled. in the _customers table - you can see that every customer has an entry so you can see what membership id is associated with a customer. Look at the database for how information is stored for subscriptions. See how you can tell how to associate a particular subscription with a particular customer.

Since a subscription is probably not like a membership - it is associated with a product and an order - which is then associated with a customer - you are going to have to understand how all this is organized in the db in order to write a query to get the information. Once you understand how it is organized - write a query that pulls the data that you need. Get the query working independent of XCART.

You also have to consider in your query how you know the identity of the customer. I assume the customer has to be logged in. You will have to look through the php variables in XCART to see how this is done and use that in your query.

Once your query is ready - figure out what pages in the cart you will want this data. Add your query to the php file associated with those pages. You can look at examples from other mods to see how people have added queries to the php files. Store the results of your query to a smarty variable or array. Now - the smarty variable is available to your template for your if/than statements.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote