• Resolved Nitrat

    (@nitrat)


    I made a custom template, but the table is broken. Maybe, the wrong code?

    [ redundant link removed ]

    <style>
    	@page {
       margin-left: 4mm;
       margin-top: 3mm;
       margin-right: 4mm;
       margin-bottom: 4mm;
       }
    
    .faximile {position: absolute; bottom: 0.4cm; left: 143; z-index: 9;}
    .faximile2 {position: absolute; bottom: 1.3cm; left: 47; z-index: 9;}
      
    .tg  {border-spacing:0;border-color:#fff;}
    .ta  {border:none;line-height: 0.75em; padding-top:3px;}
    .tg td{font-size:10.4px;padding:1px 1px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#000000;line-height: 1em;}
    .tg .tg-baqh{text-align:center;vertical-align:top;font-size:12px;padding:3px 3px;line-height:0.75;}
    .tg .tg-baqh2{text-align:center;vertical-align:top;font-size:12px;}
    </style>
    
    <table class="tg">
      <tr>
        <td width="29%" class="tg-baqh">Боровицкое страховое общество<br><img style="padding-left: -10px;" src="<?php echo ABSPATH; ?>/wp-content/uploads/2017/07/logo_mini.png" width="71" height="75"><br><br><font size="1">ТРАДИЦИИ БЕЗУПРЕЧНОЙ ЗАЩИТЫ<br></td>
        <td width="48%" class="tg-baqh"><strong>АО "БОРОВИЦКОЕ СТРАХОВОЕ ОБЩЕСТВО"</strong><br>Лицензия CЛ № 3064 от 30.10.2015г.; ИНН7714034590<br>Р/с 40701810001300000161 в АО "АЛЬФА-БАНК"<br>К/с 30101810200000000593 БИК 044525593<br>101000, Москва, Покровский б-р, д. 4/17, стр. 3<br>Тел./Факс (495) 540-51-10, для обращений по страховым случаям: 8 800 200 4208 (круглосуточно)<br>Email: [email protected], www.bsoinsur.ru.<br></td>
        <td width="23%" class="tg-baqh"><br>СПОРТ - ЭТО <br><br>БИЕНИЕ ТВОЕГО СЕРДЦА,<br><br> ТВОЁ ДЫХАНИЕ,<br> <br>ЭТО РИТМ ТВОЕЙ ЖИЗНИ</td>
      </tr>
      <tr>
        <td class="tg-baqh2" rowspan="2"><br>Добровольное страхование от несчастных случаев и болезней</td>
        <td class="tg-baqh" rowspan="2">ПОЛИС ?НС-ДЕТИ В РИТМЕ СПОРТА?<br><br><strong>№ <?php $this->custom_field('_wcpdf_invoice_number');?></strong><br></td>
        <td class="tg-baqh"><br><strong>Дата выдачи Полиса<br><?php $this->order_date(); ?></strong><br></td> 
      </tr>
    </table>
    
    

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Can you remove the rowspan to see if that resolves the issue? It may not work because there is no extra row to span across.

    Thread Starter Nitrat

    (@nitrat)

    Thanks, it helped!

    Thread Starter Nitrat

    (@nitrat)

    It is possible to insert conditional logic in the custom template?

    Plugin Contributor Ewout

    (@pomegranate)

    yes, you can use all the PHP you want ??

    Thread Starter Nitrat

    (@nitrat)

    So that’s it.)
    Such code in your plugin does not work-

    <?php if ($prog == 'Old'): ?>
      <tr>
        <td class="tg-e3zv">12. Final:</td>
    	<td class="tg-031e" colspan="3"><span style="line-height: 0.75em;">$final;</span></td>
        </tr>
    	<?php endif; ?>
    • This reply was modified 6 years, 6 months ago by Nitrat.
    Plugin Contributor Ewout

    (@pomegranate)

    Yes it does but $final; is not in PHP tags, so it’s treated as HTML ??
    Furthermore, make sure that the $prog variable is set in the template.

    also check the colspan attribute in relation to the total columns available – there may be other issues with the styling too. A more simple test outside of the <table> element (assuming you added that before and after this snippet) may be a good place to verify if the code is working correctly.

    If you need more help with this, I recommend hiring a PHP developer – this level of customization is beyond what we can offer as part of free support.

    Thread Starter Nitrat

    (@nitrat)

    Of course, this variable was defined earlier, I just showed that piece of code that is needed for conditional logic

    Plugin Contributor Ewout

    (@pomegranate)

    Very glad to hear that’s resolved, Алексей!

    Thread Starter Nitrat

    (@nitrat)

    I say that the variable is defined, and the logic does not work)
    Okay, I found another solution

    Plugin Contributor Ewout

    (@pomegranate)

    I see – if the logic does not work, there’s an error in the PHP code itself or an error in the HTML output that is generated that breaks the PDF (like the colspan/rowspan issue mentioned above). This is basic PHP.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Custom template’ is closed to new replies.