Post by feedermania » Thu Oct 10, 2019 2:56 am

This code is right? OC.3.0.3.1
Invoice - Different text for different customer groups.

order_invoice.twig

Code: Select all

{% for order in orders %}
	<div style="page-break-after: always;">
		{% if customer_group_id == '1' %}
		<h6 align="center" style="text-align:center;">{{ text_invoice }}</h6>
		{% endif %}

		{% if customer_group_id == '2' %}
		<h6 align="center" style="text-align:center;">{{ text_invoice_1 }}</h6>
		{% endif %}
    
Language sale/order.php

Code: Select all

$_['text_invoice']                            = 'Invoice';
$_['text_invoice_1']                          = 'Pre-Invoice';

New member

Posts

Joined
Mon Jul 30, 2018 2:48 am

Post by DigitCart » Thu Oct 10, 2019 3:33 am

Hi
use:

Code: Select all

{% if order.customer_group_id == '1' %}

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by feedermania » Thu Oct 10, 2019 3:50 am

doesnt work :/
DigitCart wrote:
Thu Oct 10, 2019 3:33 am
Hi
use:

Code: Select all

{% if order.customer_group_id == '1' %}

New member

Posts

Joined
Mon Jul 30, 2018 2:48 am

Post by DigitCart » Thu Oct 10, 2019 4:01 am

Maybe you have not customer_group_id there, try something like this:

Code: Select all

{% if order.customer_group_id is defined %}
it is defined
{% else %}
it is not defined
{% endif %}
if it is not defined, you need to add it in your controller file.

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by feedermania » Thu Oct 10, 2019 4:37 am

DigitCart wrote:
Thu Oct 10, 2019 4:01 am
Maybe you have not customer_group_id there, try something like this:

Code: Select all

{% if order.customer_group_id is defined %}
it is defined
{% else %}
it is not defined
{% endif %}
if it is not defined, you need to add it in your controller file.
i changed to this, now i see only text_invoice_1 for every customer group. :S
{% if order.customer_group_id == '1' %}
<h6 align="center" style="text-align:center;">{{ text_invoice }}</h6>
{% else %}

<h6 align="center" style="text-align:center;">{{ text_invoice_1 }}</h6>
{% endif %}

New member

Posts

Joined
Mon Jul 30, 2018 2:48 am
Who is online

Users browsing this forum: Baidu [Spider] and 386 guests