|
|
#1 |
|
Junior Member
Join Date: Dec 2007
Posts: 15
Rep Power: 7 ![]() |
Is it possible to set the price for an add to a maximum.
I have a site where users can place an add but the price they ask for the object can not exceed 1000 Euro's. If this is possible where can i change it?
|
|
|
|
|
|
#2 |
|
Coder
Join Date: Mar 2006
Posts: 4,564
Rep Power: 111 ![]() ![]() |
There is no option to set the maximum price. You would likely have to use modify the checkout template and apply some logic to the field and if its > 1000 set the value to 1000.
|
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Dec 2007
Posts: 15
Rep Power: 7 ![]() |
can you be more specific? I would like to set a maximum price too. What code and where? (i'm still learning php)
|
|
|
|
|
|
#4 |
|
Coder
Join Date: Mar 2006
Posts: 4,564
Rep Power: 111 ![]() ![]() |
Cant be more specific without knowing what version your using, if its developer or designer and what template your using.
|
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Dec 2007
Posts: 15
Rep Power: 7 ![]() |
I am using the developer edition with the default template. V3.1
|
|
|
|
|
|
#6 |
|
Coder
Join Date: Mar 2006
Posts: 4,564
Rep Power: 111 ![]() ![]() |
This can be done at the script level or the template level. For ease I would probably recommend doing it at the template level and what you would do, in a nutshell, is let the ad poster enter any dollar amount they like which gets stored in the database BUT when the ad is displayed to the public, the template chekcs the value entered for the price. If its more than your sites guidelines allow then simply display the max allowable price.
To do this you will need to make note of each template where your site is displaying a price. I cant tell you exactly where because this can be changed in admin not only for the pages but the user level that can see the price as well. You can see the script in use by appending "debug=1" to the URL when you are viewing a page on your site and this will cause a popup window which will contain caraible details including the template being shown. Then, as an example of how to incorporate logic to check for the pice. Open your viewlisting.tpl.php template and look for the section that displays the price, should looks something like this.... Code:
{if $viewprice=="Y"}
<tr>
<td><strong>{$smarty.const.LANG_PRICE}:</strong></td>
<td>{$listingprice}</td>
</tr>
{/if}
To do that we can use the smarty function REPLACE example below replaces the dollar sign in the value with nothing so in essence removes it which gives us a numeric value we can use to evaluate. {$listingprice|replace:'$':''} Next we need to create logic to evaluate the price against our desired max value so we can use some logic like this..... Code:
{if $viewprice=="Y"}
<tr>
<td><strong>{$smarty.const.LANG_PRICE}:</strong></td>
{if $listingprice|replace:'$':'' > "1000"}
<td>$1000</td>
{else}
<td>{$listingprice}</td>
{/if}
</tr>
{/if}
This will be the way is has to be done for the designer version since you dont have access to the code if you own that version. To make changes to the scripts your going to have to modify the usercheckout.php and membercheckout as well as the modify ad scripts. In usercheckout.php if you look at step four you will see this section where it collects post data from the html form. PHP Code:
PHP Code:
|
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MOD: Price Descriptor | Chaslie | v3.1 Modules & Modifications | 7 | 02-27-2008 03:23 PM |
| Price checking by Listing Package | Bucketman | v3.0 Questions & Support | 25 | 12-03-2007 04:48 AM |
| How can i remove the price fields? | comcoach | v3.1 Questions & Support | 6 | 10-03-2007 09:50 AM |
| Removing Price entirely | Metacraft | v3.1 Questions & Support | 4 | 07-24-2007 12:47 PM |
| Not show price | garysmith | v3.1 Modules & Modifications | 10 | 05-30-2006 05:44 AM |