Author Topic: [SOLVED] How to hide "Ask a Question about this product" from registered users?  (Read 2330 times)

kjogiste

  • Beginner
  • *
  • Posts: 11
    • Deffex Media - Your idea, our realization!
Hello everyone,

I have one issue, to be more specific then my problem is that i dont know how to hide button "Ask question about this product" from registered users, but show to guests?

I have one solution for hiding "Order" function from guests:

Add little script for flypage.tpl.php file:

<?php if ($_SESSION['auth']['user_id'] < 1) { ?>
<style type="text/css" media="screen">
   .addtocart_button, .inputboxquantity, .quantity_box_button, .quantity_box_button_down, .quantity_box_up, .quantity_box, .details-bottom-section { display:none;}
</style>
<?php } ?>


Maybe someone can help me (A)? - would be really thankful if someone could figure it out.

Maybe i can use this same little script to hide button from registered users - some hints?

Best regards,
Kristjan Jogiste
www.deffex.com
Deffex Media - Your idea, our realization! (www.deffex.com)

kjogiste

  • Beginner
  • *
  • Posts: 11
    • Deffex Media - Your idea, our realization!
Please, nobody dont know?

Best regards,
Kristjan Jogiste
www.deffex.com
Deffex Media - Your idea, our realization! (www.deffex.com)

Svetlio

  • Jr. Member
  • **
  • Posts: 141
In order to hide the Ask question about this product button from the logged in web site users you should edit the components/com_virtuemart/themes/YOUR_THEME/templates/product_details/flypage.tpl.php file.

In the above path replace the YOUR_THEME string with your actual VirtueMart theme name.

Find the following line:

<td colspan="2"><?php echo $ask_seller ?></td>

and replace it with:

<td colspan="2"><?php if ($_SESSION['auth']['user_id'] < 1) echo $ask_seller ?></td>

In this way the corresponding button will be visible only for the non-registered users.
SiteGround Technical Support Team Member. Check out our special VirtueMart hosting package

kjogiste

  • Beginner
  • *
  • Posts: 11
    • Deffex Media - Your idea, our realization!
Thank you very much Svetlio, but I still dont know how to make this button visible only for non-registered uses and hide from registered users? - maybe you can give me some hints for this option?

Best regards,
Kristjan Jogiste
www.deffex.com
Deffex Media - Your idea, our realization! (www.deffex.com)

kjogiste

  • Beginner
  • *
  • Posts: 11
    • Deffex Media - Your idea, our realization!
If it is possible for someone to help me out with this, i would be really happy.

Thank you,
Kristjan Jõgiste
www.deffex.com
Deffex Media - Your idea, our realization! (www.deffex.com)

kjogiste

  • Beginner
  • *
  • Posts: 11
    • Deffex Media - Your idea, our realization!
I got it work thank you verymuch Svetlio - maybe i can donate you for your help :)?

Please give me your PayPal account - i will send you just money for beer for helping me out with this :)

My solution: in my flypage.tpl.php

<div class="ask-seller">
<?php if ($_SESSION['auth']['user_id'] < 1) echo $ask_seller ?>
         </div>


Best regards and thank you very much for this,
Kristjan Jogiste
www.deffex.com
Deffex Media - Your idea, our realization! (www.deffex.com)