Post by adibranch » Wed Jul 11, 2018 9:26 pm

Hi, on the cart page, is there any way to have shipping estimator expanded by default?

New member

Posts

Joined
Tue Jul 11, 2017 12:48 am

Post by paulfeakins » Thu Jul 12, 2018 7:19 pm

One way to do it would be to trigger a click to this function when the page loads:
Image

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 adibranch » Wed Sep 11, 2024 5:53 pm

How Exactly? You've only given half the solution :)

New member

Posts

Joined
Tue Jul 11, 2017 12:48 am

Post by paulfeakins » Wed Sep 11, 2024 7:16 pm

adibranch wrote:
Wed Sep 11, 2024 5:53 pm
How Exactly? You've only given half the solution :)
Try something like this:

Code: Select all

$(document).ready(function() {
    // Trigger the click event on the shipping estimator button when the page loads.
    $('#button-shipping').trigger('click');
});

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 adibranch » Wed Sep 11, 2024 9:30 pm

Thanks :) This goes in the /catalog/controller/(theme)/checkout.php or /catalog/controller/checkout/cart.php ? Just trying to fathom where to slot it in.

New member

Posts

Joined
Tue Jul 11, 2017 12:48 am

Post by Joe1234 » Wed Sep 11, 2024 10:08 pm

no that's javascript, you put that in the twig file and put <script></script> around it, or imbed it in another script tag. I think you put it in
"catalog/view/theme/default/template/checkout/checkout.twig", at worst case in the footer or header twig in a $(document).ready() code snippet.

v3.0.3.9 php 8.1
I'm here for a reason, if your response is contact a/the developer, just don't reply.


Active Member

Posts

Joined
Sat Jan 01, 2022 5:47 am

Post by nonnedelectari » Thu Sep 12, 2024 8:10 am

adibranch wrote:
Wed Jul 11, 2018 9:26 pm
Hi, on the cart page, is there any way to have shipping estimator expanded by default?
Change the class from "panel-collapse collapse" to "panel-collapse collapse in" of id "collapse-shipping" in the twig file of that component

New member

Posts

Joined
Thu Mar 04, 2021 6:34 pm

Post by paulfeakins » Thu Sep 12, 2024 9:29 pm

nonnedelectari wrote:
Thu Sep 12, 2024 8:10 am
Change the class from "panel-collapse collapse" to "panel-collapse collapse in" of id "collapse-shipping" in the twig file of that component
This is a better solution if it works.

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 adibranch » Thu Sep 12, 2024 10:59 pm

excellent. Thank you both :) I'm using journal so the checkout file is different, so i'll have to find a workaround based on the info you gave.

New member

Posts

Joined
Tue Jul 11, 2017 12:48 am

Post by paulfeakins » Fri Sep 13, 2024 7:43 pm

adibranch wrote:
Thu Sep 12, 2024 10:59 pm
I'm using journal so the checkout file is different
Well that changes everything, you should have said that at the start.

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 adibranch » Fri Sep 13, 2024 10:53 pm

well, to be fair it wasn't me that started the thread :) But i eventually found the file. If anyone else using journal wants to do this it's in /catalog/view/theme/journal2/template/extension/total/shipping.twig . Change line 5 to <div id="collapse-shipping" class="panel-collapse collapse in" aria-expanded="true">

New member

Posts

Joined
Tue Jul 11, 2017 12:48 am

Post by paulfeakins » Mon Sep 16, 2024 7:04 pm

adibranch wrote:
Fri Sep 13, 2024 10:53 pm
well, to be fair it wasn't me that started the thread :) But i eventually found the file.
Ah right I see.

Great, marking [SOLVED].

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
Who is online

Users browsing this forum: Gpli, Majestic-12 [Bot] and 16 guests