*

san37

  • ***
  • 89 posts
Show premium ads on search page
« on: December 28, 2015, 10:15:35 AM »
When you make the ad premium it just shows that a label of luxury
How to make so that it is above the rest, always in search, and in searching the category in which the advertisement?

When adding a new ad premium goes down, but it should not be
« Last Edit: February 04, 2016, 01:48:08 PM by frosticek »

*

MB Themes

Re: Premium ads
« Reply #1 on: December 28, 2015, 10:21:05 AM »
@san4747
Premium means it has label, osclass has no other functionality for that.
You could be showing premium ads in extra block as on bender theme, but this will create duplicates in your listings and definitely does not look good.
You can check our Backoffice Manager Plugin that allows you to have premium listings at top of search.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Premium ads
« Reply #2 on: December 28, 2015, 10:52:18 AM »
In search of premium ads are always above the rest, this is premium to sell faster
« Last Edit: December 28, 2015, 10:54:01 AM by san4747 »

*

MB Themes

Re: Premium ads
« Reply #3 on: December 28, 2015, 11:33:13 AM »
@san4747
Can you show me example?
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Premium ads
« Reply #4 on: December 28, 2015, 12:08:54 PM »
Osclass modern theme 5.0.0 от OSClass team example
Premium in result of search in a category above others
And in the General search it is also above the rest

[attachment deleted by admin]

*

MB Themes

Re: Premium ads
« Reply #5 on: December 28, 2015, 12:14:28 PM »
@san4747
This create only duplicates.
You can duplicate content of search_list.php and search_gallery.php and replace:
Code: [Select]
osc_has_items()
with:
Code: [Select]
osc_has_premiums()
It will create duplicate listings where only premiums will be shown.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Premium ads
« Reply #6 on: December 28, 2015, 12:20:31 PM »
And luxury was always at the top?

[attachment deleted by admin]

*

MB Themes

Re: Premium ads
« Reply #7 on: December 28, 2015, 12:22:36 PM »
@san4747
It will be on top and also between normal listings as well.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Premium ads
« Reply #8 on: December 28, 2015, 01:19:24 PM »
So the premium is not fixed at the top
I thought to ask first terms of the amount of the premium in the search, for example
<?php
   

     osc_get_premiums($max = 4);
    if(osc_count_premiums() > 0) {
?>
But it is not suitable

*

MB Themes

Re: Premium ads
« Reply #9 on: December 28, 2015, 02:01:56 PM »
@san4747
If you place this block before loop, you can define how many premiums you want to show on top
Code: [Select]
osc_get_premiums(XY);
XY - number of listings (i.e. 5)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Premium ads
« Reply #10 on: December 30, 2015, 12:12:27 PM »
Did so but not showing at all, please help find the error
Code: [Select]
<?php
  
     osc_get_premiums
($max 4);
    
?>

<div id="list-view">
<?php $class "even"?>
  <?php while(osc_has_premiums()) { ?>
    <div class="list-prod" id="<?php if(function_exists('rbc_get_class_color')){echo rbc_get_class_color(osc_premium_id ());}?>">
      <?php if(function_exists('fi_make_favorite')) { echo fi_make_favorite(); } ?>

      <div class="left">
        <h3 class="resp-title"><a href="<?php echo osc_premium_url(); ?>"><?php echo osc_highlight(osc_premium_title(), 80); ?></a></h3>

        <?php if(osc_images_enabled_at_items() and osc_count_premium_resources() > 0) { ?>
          <a class="big-img" href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_premium_title(); ?>" alt="<?php echo osc_premium_title(); ?>" /></a>

          <div class="img-bar">
            <?php osc_reset_resources(); ?>
            <?php for ( $i 0osc_has_premium_resources(); $i++ ) { ?>
              <?php if($i 3) { ?>
                <span class="small-img" id="bar_img_<?php echo $i?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_premium_title(); ?>" alt="<?php echo osc_premium_title(); ?>" <?php echo ($i=='class="selected"' ''); ?> /></span>
              <?php ?>
            <?php ?>
          </div>
        <?php } else { ?>
          <a class="big-img no-img" href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_premium_title(); ?>" /></a>
        <?php ?>
      </div>

      <div class="middle">
       

        <h3><a href="<?php echo osc_premium_url(); ?>"><?php echo osc_highlight(osc_premium_title(), 80); ?></a></h3>
        <div class="desc <?php if(osc_count_premium_resources() > 0) { ?>has_images<?php ?>"><?php echo osc_highlight(osc_premium_description(), 300); ?></div>
        <div class="loc"><i class="fa fa-map-marker"></i><?php echo zara_location_format(osc_premium_country(), osc_premium_region(), osc_premium_city()); ?></div>
        <div class="author">
          <i class="fa fa-pencil"></i><?php _e('Published by''zara'); ?>
          <?php if(osc_item_user_id() <> 0) { ?>
            <a href="<?php echo osc_user_public_profile_url(osc_premium_user_id()); ?>"><?php echo osc_premium_contact_name(); ?></a>
          <?php } else { ?>
            <?php echo (osc_premium_contact_name() <> '' osc_premium_contact_name() : __('Anonymous''zara')); ?>
          <?php ?>
        </div>
      </div>

      <div class="right">
        <?php if( osc_price_enabled_at_items() ) { ?>
          <div class="price"><?php echo osc_premium_formated_price(); ?></div>
        <?php ?>

        <a class="view round2" href="<?php echo osc_premium_url(); ?>"><?php _e('Посмотреть''zara'); ?></a>
        <a class="category" href="<?php echo osc_search_url(array('sCategory' => osc_premium_category_id())); ?>"><?php echo osc_premium_category(); ?></a>
       
<?php $class "even"$i 0?>
<?php while(osc_has_items()) { $i++; ?>
    <div class="list-pro" id="<?php if(function_exists('rbc_get_class_color')){echo rbc_get_class_color(osc_item_id ());}?>">
      <?php if(function_exists('fi_make_favorite')) { echo fi_make_favorite(); } ?>

      <div class="left">
        <h3 class="resp-title"><a href="<?php echo osc_item_url(); ?>"><?php echo osc_highlight(osc_item_title(), 80); ?></a></h3>

        <?php if(osc_images_enabled_at_items() and osc_count_item_resources() > 0) { ?>
          <a class="big-img" href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>

          <div class="img-bar">
            <?php osc_reset_resources(); ?>
            <?php for ( $i 0osc_has_item_resources(); $i++ ) { ?>
              <?php if($i 3) { ?>
                <span class="small-img" id="bar_img_<?php echo $i?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" <?php echo ($i=='class="selected"' ''); ?> /></span>
              <?php ?>
            <?php ?>
          </div>
        <?php } else { ?>
          <a class="big-img no-img" href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" title="<?php echo osc_item_title(); ?>" alt="<?php echo osc_item_title(); ?>" /></a>
        <?php ?>
      </div>

      <div class="middle">
       

        <h3><a href="<?php echo osc_item_url(); ?>"><?php echo osc_highlight(osc_item_title(), 80); ?></a></h3>
        <div class="desc <?php if(osc_count_item_resources() > 0) { ?>has_images<?php ?>"><?php echo osc_highlight(osc_item_description(), 300); ?></div>
        <div class="loc"><i class="fa fa-map-marker"></i><?php echo zara_location_format(osc_item_country(), osc_item_region(), osc_item_city()); ?></div>
        <div class="author">
          <i class="fa fa-pencil"></i><?php _e('Published by''zara'); ?>
          <?php if(osc_item_user_id() <> 0) { ?>
            <a href="<?php echo osc_user_public_profile_url(osc_item_user_id()); ?>"><?php echo osc_item_contact_name(); ?></a>
          <?php } else { ?>
            <?php echo (osc_item_contact_name() <> '' osc_item_contact_name() : __('Anonymous''zara')); ?>
          <?php ?>
        </div>
      </div>

      <div class="right">
        <?php if( osc_price_enabled_at_items() ) { ?>
          <div class="price"><?php echo osc_item_formated_price(); ?></div>
        <?php ?>

        <a class="view round2" href="<?php echo osc_item_url(); ?>"><?php _e('Посмотреть''zara'); ?></a>
        <a class="category" href="<?php echo osc_search_url(array('sCategory' => osc_item_category_id())); ?>"><?php echo osc_item_category(); ?></a>

*

MB Themes

Re: Premium ads
« Reply #11 on: December 30, 2015, 12:37:52 PM »
@san474
Correct code for search_list.php that should show 4 premium listings first is:

Code: [Select]
<div id="list-view">

  <!-- PREMIUM ITEMS, DISABLED BY DEFAULT -->
  <?php if(1==1) { ?>
  <?php osc_get_premiums(4); ?>
  <?php while(osc_has_premiums()) { ?>
    <div class="list-prod">
      <?php if(function_exists('fi_make_favorite')) { echo fi_make_favorite(); } ?>

      <div class="left">
        <h3 class="resp-title"><a href="<?php echo osc_premium_url(); ?>"><?php echo osc_highlight(osc_premium_title(), 80); ?></a></h3>

        <?php if(osc_images_enabled_at_items() and osc_count_premium_resources() > 0) { ?>
          <a class="big-img" href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_premium_title()); ?>" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" /></a>

          <div class="img-bar">
            <?php osc_reset_resources(); ?>
            <?php for ( $i 0osc_has_premium_resources(); $i++ ) { ?>
              <?php if($i 3) { ?>
                <span class="small-img" id="bar_img_<?php echo $i?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_premium_title()); ?>" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" <?php echo ($i=='class="selected"' ''); ?> /></span>
              <?php ?>
            <?php ?>
          </div>
        <?php } else { ?>
          <a class="big-img no-img" href="<?php echo osc_premium_url(); ?>"><img src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" title="<?php echo osc_esc_html(osc_premium_title()); ?>" alt="<?php echo osc_esc_html(osc_premium_title()); ?>" /></a>
        <?php ?>
      </div>

      <div class="middle">
        <div class="flag"><?php _e('top''zara'); ?></div>

        <h3><a href="<?php echo osc_premium_url(); ?>"><?php echo osc_highlight(osc_premium_title(), 80); ?></a></h3>
        <div class="desc <?php if(osc_count_premium_resources() > 0) { ?>has_images<?php ?>"><?php echo osc_highlight(osc_premium_description(), 300); ?></div>
        <div class="loc"><i class="fa fa-map-marker"></i><?php echo zara_location_format(osc_premium_country(), osc_premium_region(), osc_premium_city()); ?></div>
        <div class="author">
          <i class="fa fa-pencil"></i><?php _e('Published by''zara'); ?>
          <?php if(osc_premium_user_id() <> 0) { ?>
            <a href="<?php echo osc_user_public_profile_url(osc_premium_user_id()); ?>"><?php echo osc_premium_contact_name(); ?></a>
          <?php } else { ?>
            <?php echo (osc_premium_contact_name() <> '' osc_premium_contact_name() : __('Anonymous''zara')); ?>
          <?php ?>
        </div>
      </div>

      <div class="right">
        <?php if( osc_price_enabled_at_items() ) { ?>
          <div class="price"><?php echo osc_premium_formated_price(); ?></div>
        <?php ?>

        <a class="view round2" href="<?php echo osc_premium_url(); ?>"><?php _e('view''zara'); ?></a>
        <a class="category" href="<?php echo osc_search_url(array('sCategory' => osc_premium_category_id())); ?>"><?php echo osc_premium_category(); ?></a>

        <?php
          $now 
time();
          
$your_date strtotime(osc_item_pub_date());
          
$datediff $now $your_date;
          
$item_d floor($datediff/(60*60*24));

          if(
$item_d == 0) {
            
$item_date __('today''zara');
          } else if(
$item_d == 1) {
            
$item_date __('yesterday''zara');
          } else {
            
$item_date date(osc_get_preference('date_format''zara_theme'), $your_date);
          }
        
?>

        <span class="date">
          <?php 
            
if($item_d == or $item_d  == 1) {
              echo 
__('published''zara') . ' <span>' $item_date '</span>'
            } else {
              echo 
__('published on''zara') . ' <span>' $item_date '</span>'
            }
          
?>

        </span>

        <span class="viewed">
          <?php echo __('viewed''zara') . ' <span>' osc_premium_views() . 'x' '</span>'?>
        </span>
      </div>

    </div>
  <?php ?>
  <?php ?>
  <!-- END PREMIUM ITEMS -->


  <?php while(osc_has_items()) { ?>
    <div class="list-prod">
      <?php if(function_exists('fi_make_favorite')) { echo fi_make_favorite(); } ?>

      <div class="left">
        <h3 class="resp-title"><a href="<?php echo osc_item_url(); ?>"><?php echo osc_highlight(osc_item_title(), 80); ?></a></h3>

        <?php if(osc_images_enabled_at_items() and osc_count_item_resources() > 0) { ?>
          <a class="big-img" href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" /></a>

          <div class="img-bar">
            <?php osc_reset_resources(); ?>
            <?php for ( $i 0osc_has_item_resources(); $i++ ) { ?>
              <?php if($i 3) { ?>
                <span class="small-img" id="bar_img_<?php echo $i?>"><img src="<?php echo osc_resource_thumbnail_url(); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" <?php echo ($i=='class="selected"' ''); ?> /></span>
              <?php ?>
            <?php ?>
          </div>
        <?php } else { ?>
          <a class="big-img no-img" href="<?php echo osc_item_url(); ?>"><img src="<?php echo osc_current_web_theme_url('images/no-image.png'); ?>" title="<?php echo osc_esc_html(osc_item_title()); ?>" alt="<?php echo osc_esc_html(osc_item_title()); ?>" /></a>
        <?php ?>
      </div>

      <div class="middle">
        <?php if(osc_item_is_premium()) { ?>
          <div class="flag"><?php _e('top''zara'); ?></div>
        <?php ?>

        <h3><a href="<?php echo osc_item_url(); ?>"><?php echo osc_highlight(osc_item_title(), 80); ?></a></h3>
        <div class="desc <?php if(osc_count_item_resources() > 0) { ?>has_images<?php ?>"><?php echo osc_highlight(osc_item_description(), 300); ?></div>
        <div class="loc"><i class="fa fa-map-marker"></i><?php echo zara_location_format(osc_item_country(), osc_item_region(), osc_item_city()); ?></div>
        <div class="author">
          <i class="fa fa-pencil"></i><?php _e('Published by''zara'); ?>
          <?php if(osc_item_user_id() <> 0) { ?>
            <a href="<?php echo osc_user_public_profile_url(osc_item_user_id()); ?>"><?php echo osc_item_contact_name(); ?></a>
          <?php } else { ?>
            <?php echo (osc_item_contact_name() <> '' osc_item_contact_name() : __('Anonymous''zara')); ?>
          <?php ?>
        </div>
      </div>

      <div class="right">
        <?php if( osc_price_enabled_at_items() ) { ?>
          <div class="price"><?php echo osc_item_formated_price(); ?></div>
        <?php ?>

        <a class="view round2" href="<?php echo osc_item_url(); ?>"><?php _e('view''zara'); ?></a>
        <a class="category" href="<?php echo osc_search_url(array('sCategory' => osc_item_category_id())); ?>"><?php echo osc_item_category(); ?></a>

        <?php
          $now 
time();
          
$your_date strtotime(osc_item_pub_date());
          
$datediff $now $your_date;
          
$item_d floor($datediff/(60*60*24));

          if(
$item_d == 0) {
            
$item_date __('today''zara');
          } else if(
$item_d == 1) {
            
$item_date __('yesterday''zara');
          } else {
            
$item_date date(osc_get_preference('date_format''zara_theme'), $your_date);
          }
        
?>

        <span class="date">
          <?php 
            
if($item_d == or $item_d  == 1) {
              echo 
__('published''zara') . ' <span>' $item_date '</span>'
            } else {
              echo 
__('published on''zara') . ' <span>' $item_date '</span>'
            }
          
?>

        </span>

        <span class="viewed">
          <?php echo __('viewed''zara') . ' <span>' osc_item_views() . 'x' '</span>'?>
        </span>
      </div>

    </div>
  <?php ?>
</div>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Premium ads
« Reply #12 on: December 30, 2015, 01:21:05 PM »
Thank you!!!

*

MB Themes

Re: Premium ads
« Reply #13 on: December 30, 2015, 01:31:20 PM »
@san4747
Welcome
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots