This topic contains a post which is marked as Best Answer. Press here if you would like to see it.
*

oscman

  • ****
  • 227 posts
Leave feedback button on mobile?
« on: March 24, 2017, 12:34:16 PM »
Hello, i have placed leave feedback button like this in veronika theme
Code: [Select]
<?php if(function_exists('show_feedback_overall')) { ?>
                  <div class="elem feedback"><?php echo show_feedback_overall(); ?></div>
  <?php echo leave_feedback(); ?>
                <?php ?>

but its not showing in mobile so i placed the same inside <div id="seller-data" class="is767"> div
now its showing on both mobile and desktop. The problem is that now when you click on desktop leave feedback nothing happens, and on mobile it works.
if i remove from mobile div then it works again on desktop

*

MB Themes

Re: Leave feedback button on mobile?
« Reply #1 on: March 25, 2017, 07:21:16 AM »
@oscman
You have probably placed it in section that is not shown on mobile/desktop.
I recommend to place this in area that is shown on mobile & desktop, so you have it just once here.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

oscman

  • ****
  • 227 posts
Re: Leave feedback button on mobile?
« Reply #2 on: March 25, 2017, 02:03:27 PM »
Obviously i want it to show in listing under profile name and picture but there are 2 codes in veronika for that for mobile and desktop so what is the solution here?

Marked as best answer by oscman on March 25, 2017, 11:14:49 PM
*

MB Themes

Re: Leave feedback button on mobile?
« Reply #3 on: March 25, 2017, 08:29:08 PM »
@oscman
Problem is that you want to show same rating twice.
Go to file:
oc-content/plugins/backoffice_manager/function/feedback.php

And replace function show_feedback_overall with:
Code: [Select]
function show_feedback_overall( $user_id = NULL ) {
  if($user_id == '') { $user_id = osc_item_user_id(); }
  if($user_id == '') { $user_id = osc_user_id(); }
  if(($user_id == '' or $user_id == 0) and osc_get_osclass_location() == 'user') { $user_id = Params::getParam('id'); }

  $i = rand(1,1000);

  $feedback = ModelFB::newInstance()->getFeedbackScoreByUserId( $user_id, 1 );

  if($user_id <> '' and $user_id <> 0) {
    $avg = $feedback['score_overall'];
    $avg = round($avg*2)/2;

    $text  = '';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="0.5"' . ($avg == 0.5 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="1"' . ($avg == 1 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="1.5"' . ($avg == 1.5 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="2"' . ($avg == 2 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="2.5"' . ($avg == 2.5 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="3"' . ($avg == 3 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="3.5"' . ($avg == 3.5 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="4"' . ($avg == 4 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="4.5"' . ($avg == 4.5 ? 'checked' : '') . ' disabled="disabled"/>';
    $text .= '<input name="rating-total' . $i . '" type="radio" class="star {split:2}" value="5"' . ($avg == 5 ? 'checked' : '') . ' disabled="disabled"/>';

    return $text;
  }
}

It will add unique modifier to each rating.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots