Advertisement:

Author Topic: Moving listings from unpaid categories to paid categories without PAYING  (Read 1400 times)

Timholder

  • Newbie
  • *
  • Posts: 9
Dear all,

Problem: I have paid and unpaid categories on my classified site for example paid category Real Estate, unpaid category Services, what i notice is that users can post a listing in the unpaid category, edit it and move it to the paid category without paying anything....

How can i solved this MAJOR problem..

Version Osclass 3.3.2, I try different themes, same issue.

regards
Tim 
« Last Edit: March 26, 2014, 10:10:08 pm by Timholder »

Timholder

  • Newbie
  • *
  • Posts: 9
Hi All,

Someone have to know how to fix this issue...this is a major issue..

Tim

fog

  • Hero Member
  • *****
  • Posts: 1062
Hi,

One possible solution is to make a clone function categories in your file funções.php

Then call this new function in the file item-edit.php, and replace the previous function.

What changes in this function is the css style that will hide the dropdown list of the main categories, and will keep the subcategories of selected category (which is hidden).

Test this method, it may work well for what you want to do.

example the theme repurpose I tested right now:

in functions.php
Code: [Select]
    function item_category_selected($default_option) {
        $categories = Category::newInstance()->findRootCategories() ; ?>
        <?php if( count($categories) > ) { ?>
        <select class="category"style="display:none">
            <option><?php echo $default_option ?></option>
            <?php foreach($categories as $c) { ?>
            <option value="<?php echo $c['pk_i_id'] ; ?>"><?php echo $c['s_name'] ; ?></option>
            <?php ?>
        </select>
        <?php ?>
        <select class="subcategory" name="catId" style="display:none"></select>
        <?php
    
}

Now in item-edit.php call the new function with "display:none" added

Code: [Select]
    <!-- category input -->
    <div class="clearfix"style="margin-top:20px;">
<div id="wrappercategory">
    <label><?php _e('Category''cocktail') ; ?></label>
    <div class="input">
    <?php item_category_selected__('Select a category...''cocktail') ) ; ?>
    </div>
<p class="text-info-category"><?php _e('Please select a main category''cocktail') ; ?></p>
    </div>
    </div>
    <!-- category input end -->

Regards