Difference between revisions of "How to use custom variables"
(Created page with 'Custom Variables in PaidListings make it possible to charge for many other things that are not available by default. For example, you can charge for the [[How to add Inquiry For…') |
|||
Line 4: | Line 4: | ||
− | To make it available in | + | To make it available in your Listing Plan, add a variable in the '''Custom Variables''' text area like this: |
<source lang="php"> | <source lang="php"> |
Revision as of 19:57, 2 June 2010
Custom Variables in PaidListings make it possible to charge for many other things that are not available by default.
For example, you can charge for the Inquiry Form on listing detail page
To make it available in your Listing Plan, add a variable in the Custom Variables text area like this:
inquiry|enabled
In this example inquiry is the variable name and enabled is its value.
In the detail.thtml file if you followed instructions in the article linked above, you will have this code that outputs the inquiry form:
<?php echo $this->element('inquiry_widget');?>
To make the inquiry form enabled only if the listing plan is purchased, check the value of your custom variable like this:
<?php if ($Paid->getVar('inquiry',$listing) == 'enabled'): ?> <?php echo $this->element('inquiry_widget');?> <?php endif;?>
If the listing plan is not purchased, the variable will have no value and the inquiry form will not be displayed.
This way you can charge for any part of the listing detail page.