Page 1 of 1
[SOLVED] Add custom message to "delivery details" in checkout
Posted: Tue Oct 06, 2020 7:11 am
by AlanARG
Hey guys, how are you?
I've made a change to "/catalog/view/theme/default/template/checkout/checkout.twig" file:
Code: Select all
<div class="panel-heading">
<h4 class="panel-title">{{ text_checkout_payment_address }}</h4>
</div>
<div class="panel-collapse collapse" id="collapse-payment-address">
<div class="panel-body"></div>
</div>
Added this:
Code: Select all
<div class="panel-heading">
<h4 class="panel-title">{{ text_checkout_payment_address }}</h4>
</div> <h4 class="panel-body">{{ text_checkout_shipping }}</h4>
<div class="panel-collapse collapse" id="collapse-payment-address">
<div class="panel-body"></div>
</div>
In "/catalog/language/es-es (spanish language)/checkout/checkout.php" I added the "text_checkout_shipping" text that should be there. But, for some reason, the message is not appearing in the "billing details".
What am I doing wrong?
Thanks!
Re: Add custom message to "delivery details" in checkout
Posted: Wed Oct 07, 2020 7:25 am
by AlanARG
I forgot to add it to "controller" as well, now it works.
Thing is, I don't know how to place it INSIDE the collapse menu. I've tried everything and it just breaks the whole menu or it appears in the wrong place.
Any ideas?
Re: Add custom message to "delivery details" in checkout
Posted: Wed Oct 07, 2020 7:58 am
by sw!tch
Where do you want it to appear?
If you want it in the shipping method section then look at:
Code: Select all
catalog/view/theme/default/template/checkout/shipping_method.twig
Re: Add custom message to "delivery details" in checkout
Posted: Wed Oct 07, 2020 9:22 am
by AlanARG
sw!tch wrote: ↑Wed Oct 07, 2020 7:58 am
Where do you want it to appear?
If you want it in the shipping method section then look at:
Code: Select all
catalog/view/theme/default/template/checkout/shipping_method.twig
You are completely right, I should edit that file lol. Thanks a lot for that.
I added a screenshot so you can see where I want the text.
This is the "shipping_method.twig" code, I have no clue where should I put it and I've tried different places and didn't work.
Code: Select all
{% if error_warning %}
<div class="alert alert-warning alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ error_warning }}</div>
{% endif %}
{% if shipping_methods %}
<p>{{ text_shipping_method }}</p>
{% for shipping_method in shipping_methods %}
<p><strong>{{ shipping_method.title }}</strong></p>
{% if not shipping_method.error %}
{% for quote in shipping_method.quote %}
<div class="radio">
<label> {% if quote.code == code or not code %}
{% set code = quote.code %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" checked="checked" />
{% else %}
<input type="radio" name="shipping_method" value="{{ quote.code }}" />
{% endif %}
{{ quote.title }} - {{ quote.text }}</label>
</div>
{% endfor %}
{% else %}
<div class="alert alert-danger alert-dismissible">{{ shipping_method.error }}</div>
{% endif %}
{% endfor %}
{% endif %}
<p><strong>{{ text_comments }}</strong></p>
<p>
<textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea>
</p>
<div class="buttons">
<div class="pull-right">
<input type="button" value="{{ button_continue }}" id="button-shipping-method" data-loading-text="{{ text_loading }}" class="btn btn-primary" />
</div>
</div>
Thanks again!
Re: Add custom message to "delivery details" in checkout
Posted: Wed Oct 07, 2020 9:51 am
by sw!tch
Your screenshot looks like the billing address section
So refer to:
Code: Select all
catalog/view/theme/default/template/checkout/payment_address.twig
or for shipping address
Code: Select all
catalog/view/theme/default/template/checkout/shipping_address.twig
Re: Add custom message to "delivery details" in checkout
Posted: Wed Oct 07, 2020 3:47 pm
by AlanARG
sw!tch wrote: ↑Wed Oct 07, 2020 9:51 am
Your screenshot looks like the billing address section
So refer to:
Code: Select all
catalog/view/theme/default/template/checkout/payment_address.twig
or for shipping address
Code: Select all
catalog/view/theme/default/template/checkout/shipping_address.twig
kudos to you! thanks a lot!