Post by SharonfromScotland » Mon Jan 13, 2020 3:47 pm

Hi,

I'm new to Opencart and this forum - I am using Version 3.0.3.1 and am trying to remove the 'Add Comments About Your Order' text box from the checkout.
I have tried commenting out:
<p><strong>{{ text_comments }}</strong></p>
<p>
<textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea>
</p>

in both:
shop/catalog/view/theme/default/template/checkout/shipping_method.twig and
shop/catalog/view/theme/default/template/checkout/payment_method.twig

but the text box is still there in my checkout - what am I doing wrong, please help!


Posts

Joined
Mon Jan 13, 2020 3:22 pm

Post by uksitebuilder » Mon Jan 13, 2020 4:45 pm

Make sure you have cleared caches - especially admin - Dashboard (click cog icon top-right) and clear both caches)

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by opencartmart » Mon Jan 13, 2020 6:04 pm

Also, refresh the ocmod list in admin -> Extensions -> Modifications

XForm - Opencart Form Builder
Xshippingpro - An advanced Shipping Module
Need Professional support? Skype: opencartmart


Active Member

Posts

Joined
Wed Oct 02, 2013 3:59 am

Post by thekrotek » Mon Jan 13, 2020 6:53 pm

Don't edit files, just add a simple CSS definition like this one:

textarea[name="comment"] {
display: none;
}


It will hide the text area only, but you can hide a header as well. Find a right selector and you're good to go.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by paulfeakins » Mon Jan 13, 2020 8:21 pm

thekrotek wrote:
Mon Jan 13, 2020 6:53 pm
Don't edit files, just add a simple CSS definition like this one:

textarea[name="comment"] {
display: none;
}


It will hide the text area only, but you can hide a header as well. Find a right selector and you're good to go.
I would also recommend this. Quick and simple, but it may need to be slightly different to the above to remove the message too.

UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk


User avatar
Guru Member
Online

Posts

Joined
Mon Aug 22, 2011 11:01 pm
Location - London Gatwick, United Kingdom

Post by CJC » Fri Feb 26, 2021 12:41 am

I'm also interested in removing the comments section, but only from the payment method area. I don't see the need to have it appear in both Delivery Method and Payment Method. I did the following in payment_method.twig:

Code: Select all

<!-- <textarea name="comment" rows="8" class="form-control">{{ comment }}</textarea> -->
But when clicking the Continue button I get the following error:
Image

OC 3.0.3.6
Default theme

CJC
Active Member

Posts

Joined
Wed Jun 03, 2020 5:51 am

Post by mikeinterserv » Fri Feb 26, 2021 12:55 am

The index is missing because the array is built from the form elements
in this case comments so if you remove it or change input type to hidden the comments will be missing from the array
Whether hiding it with css display:none causes the same error I haven't checked
Now I did check
adding inline it works fine so hiding with css should do what you require without the warning

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Fri Feb 26, 2021 2:54 am

This OCMod will remove the text area and the text - add a comment to your order
From the payment section of checkout.
Tested on 3..0.3.2 and 3.0.3.6

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by CJC » Fri Feb 26, 2021 4:36 am

I just saw your post now. I ended up doing this and it worked:

Code: Select all

<textarea name="comment" rows="4" class="form-control" style="display:none;">{{ comment }}</textarea>
Is that the same approach you applied in your mod?
mikeinterserv wrote:
Fri Feb 26, 2021 2:54 am
This OCMod will remove the text area and the text - add a comment to your order
From the payment section of checkout.
Tested on 3..0.3.2 and 3.0.3.6

CJC
Active Member

Posts

Joined
Wed Jun 03, 2020 5:51 am

Post by mikeinterserv » Fri Feb 26, 2021 5:17 am

Yes and removed the paragraph
Add comments to your order

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by CJC » Fri Feb 26, 2021 5:26 am

I would mark the thread a solved but I'm not the OP.
mikeinterserv wrote:
Fri Feb 26, 2021 5:17 am
Yes and removed the paragraph
Add comments to your order

CJC
Active Member

Posts

Joined
Wed Jun 03, 2020 5:51 am

Post by ru-lefthanded » Mon May 17, 2021 6:24 pm

Hi, I'd like to edit the Comment box in delivery method so it displays "Gift Message" or "Gift Message (plus some explanatory text after the title)" instead of Comments
What file(s) do I need to edit (and where are they!)?
Will that change need to be re-applied as / when the version is upgraded ? (currently 3.03)
Do you happen to know if that gift message will then be included in the email confirmation if I use https://www.opencart.com/index.php?rout ... n_id=35844
or
https://www.opencart.com/index.php?rout ... sort=price ??
Thanks in advance

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am

Post by ru-lefthanded » Thu Jun 17, 2021 11:29 pm

For the benefit of anyone else reading this thread, I tried using the solution here but, as yet, its not working properly as yet
viewtopic.php?f=20&t=203663&p=823243#p823243

New member

Posts

Joined
Tue Sep 03, 2013 3:39 am
Who is online

Users browsing this forum: Adminas99999, Semrush [Bot] and 92 guests