Want to show a Magento block in PDF based on a variable
In the PDF you want to show a Magento block element, if the value of a specific variable is something. Below is the code that shall be put into the text element in you PDF template.
First we test if a variable (order_payment_data_method
) is equal a text (installment
), if it is do nothing, if it is not print something (<span style="display: none;">
). Then we reference the block that we want to show (Magento style). Last we test again and prints something if not equal (</span>
)
##strstr({{order_payment_data_method}}, 'installment') ? '' : '
'##
Related product:
HTML2PDF extension