View Single Post
  #9  
Old 06-30-2009, 07:18 PM
 
Momtreprenuer Momtreprenuer is offline
 

Member
  
Join Date: Jan 2008
Posts: 19
 

Default Re: Subscription Status If/Then

Thanks you guys for the help!! I'm referring to the subscription module that comes with 4.1.12. It's not an extra mod I purchased or anything, it comes already installed. I use it for access to paid areas of my site. I have subscriber only (static) pages that need to be protected as well as my custom links on the product detail page that allow instant download to a subscriber. I've set the subscriptions up as a product ($productid) that renews on a scheduled basis.

Quote:
I suspect that you are trying to do a simple if-then on variables that do not exist without a mod of the php file.
Yes, I think that this is where the problem is.
Quote:
The debug window that comes up displaying all the variables shows you everything that is available in smarty for that page.
What I found were variables that I had already tried to use for the if/then statement. Here's the last one I tried:

Code:
{if $subscriptionid eq '1'} please upgrade to download content free! {elseif $subscriptionid eq '2' or $subscriptionid eq '3'} download me! {else} We're sorry, you don't have the correct subscription type to access this content. Please make sure you are logged in correctly. {/if}

In the debug window (from the tip) I saw variables like:
Code:
{$sub_status} Array (3) 0 => "Active" 1 => "Unsubscribed" 2 => "Disabled" {$subscription_search} Array (3) search_productid => "" search_producttitle => "" search_customerlogin => "" {$subscriptions_info} Array (3) 0 => Array (10) productid => "9" pay_period_type => "Monthly" product => "Choice Plus Subscription" subscribers_num => "0" customers => false 1 => Array (10) productid => "12" pay_period_type => "Annually" {$subscription} Array (0) {$user_membership} "Platinum 6" {$user_subscription} "" {$users_online} Array (1) 0 => Array (3) usertype => "C" count => "2" is_registered => "Y" {$usertype} "C"
of course this is a shortened list. So what I meant by seeing variables I had already tried was that the variables shown ie: $subscription, $user_subscription, productid, pay_period_type, $subscriptions_info, $sub_status etc. where what I'd already tried with the code above in blue.

I'm familiar with php and queries, but only when the code is already written, meaning I can understand and move it around once it exists. I don't know how to write a brand new query.

Quote:
you need to update the php to query the database to make the variables available to you

This is EXACTLY what I think is missing in order for the request above to work. However, I don't know how to do so. I've tried imitating some of the membership queries (tags, smarty code or whatever they're called) but have had no luck. Shouldn't there be something I can add to include/check_useraccount.php or another php or tpl file? Something like this?
Code:
$subscription = $user_subscription['subscription'];

Or something similiar?

Thanks so much for the help, I really appreciate it. I'll keep trying.

Momtrepreneur
__________________
Version 4.1.12
Reply With Quote