How to hide some buttons on print view?

  • Posts: 1119
  • Thank you received: 114
8 years 11 months ago #224884

Hi,

I have added print on product page. It does work but I would like to hide add to cart, wishlist, ask question buttons on print view if possible.
I have searched forum but couldn't find what I need.
If anyone could tell me from where I should start, I would be thankful.

Here is the code I used to add print:

</div>
                    <div class="moreicons">
                    <div class="icons">
                    <a class="print_button" onclick="return window.hikashop.openBox(this,null,false);" rel="{handler: 'iframe', size: {x: 580, y: 890}}" href="<?php echo JURI::current(); ?>?tmpl=component" title="<?php echo JText::_('HIKA_PRINT');?>"><i class='fa fa-print'></i></a> 
                    <div class="clear"></div>
                </div>
                        </div>

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
8 years 11 months ago #224885

Hi,

Your question is not really related to HikaShop but to general display and CSS.
In your template or using media queries, you can specify CSS rules which will just be applied in the "print" context.
There you can hide or display specific elements.

www.hikashop.com/support/support/documen...ize-the-display.html

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 1119
  • Thank you received: 114
8 years 11 months ago #225007

Hi,

Thanks for answer. I do have print.css file in my template but i dont know how can i link it to print view?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #225008

Hi,

So adding css properties in this css file will potentially hide the add to cart and add to wishlist buttons only in "print" context.
That means that the css will be used when trying to print the page, using the print tool of the browser.

If you want to hide the buttons directly in the popup, so you need to have a css file called only in the "tmpl=component" context, and this is handled (or not) by your template, we can't really give you the exact solution as it really depends on your template.
The best would be to contact your template provider directly to know on which file apply the css.

Then the css will be really simple, it only needs to be something like:

.hikashop_cart_button{ display: none;}

If you only need the print context, so buttons displayed in the popup but no when printing, so in any css file of your template you case use a media query: developer.mozilla.org/en-US/docs/Web/CSS/@media

Please Log in or Create an account to join the conversation.

Time to create page: 0.070 seconds
Powered by Kunena Forum