Kelcett
Forum Replies Created
Viewing 1 replies (of 1 total)
-
Not sure why I didn’t think of doing this. Moved my ‘print membership card’ javascript to body of page on its own page. There it doesn’t interfere with accept=”paypal” function on subscription page.
Here is code I am playing with in body of page. I know it needs to be cleaned up, but its working and I am no coder. Maybe this will help someone else.
My image is around 300 x 180 which is close to business card size when I print it. Formatting of table rows etc is so that words end up in clear space of image of card.
Please feel free to critique this or offer suggestions. I maybe doing something I shouldn’t.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> <script type="text/javascript"> function printthis() { var w = window.open('', '', 'width=800,height=600,resizeable,scrollbars'); w.document.write($("#printthis").html()); w.document.close(); // needed for chrome and safari javascript:w.print(); w.close(); return false; } </script> <div id="dontprintthis"> <h4>Welcome <strong>[s2Get constant="S2MEMBER_CURRENT_USER_DISPLAY_NAME" /]</strong><em>!</em></h4> <h4>~ Print Your Membership Card ~ <br> </div> <div id="printthis"> <table cellpadding=0px cellspacing=0px width="300px" height="180px" background="http://my image url.jpg"> <tr> <td width="35%"></td> <td style="vertical-align:bottom;" width="65%"><em>Name: [s2Get constant="S2MEMBER_CURRENT_USER_FIRST_NAME" /] [s2Get constant="S2MEMBER_CURRENT_USER_LAST_NAME" /] Status: [s2Get constant="S2MEMBER_CURRENT_USER_ACCESS_LABEL" /] .[php] if ($s2member_auto_eot_time = get_user_field ("s2member_auto_eot_time") ) {echo date("F j, Y", $s2member_auto_eot_time);} [/php] </td> </tr> </table> Image missing on print? ~ There is a little known setting in browsers print properties "Print Background Graphics" that must be on/checked to print image with this card. </div> Click <a href="printpage" onClick="printthis(); return false;">PRINT HERE</a> for a print copy of your membership card. Membership Cards are only physically issued at ********. Please print your membership card or login to this page to show anyone who requests to see your Membership Status.
Viewing 1 replies (of 1 total)