Page 1 of 1
[SOLVED] shipping estimator expanded by default
Posted: Wed Jul 11, 2018 9:26 pm
by adibranch
Hi, on the cart page, is there any way to have shipping estimator expanded by default?
Re: shipping estimator expanded by default
Posted: Thu Jul 12, 2018 7:19 pm
by paulfeakins
One way to do it would be to trigger a click to this function when the page loads:

Re: shipping estimator expanded by default
Posted: Wed Sep 11, 2024 5:53 pm
by adibranch
How Exactly? You've only given half the solution

Re: shipping estimator expanded by default
Posted: Wed Sep 11, 2024 7:16 pm
by paulfeakins
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');
});
Re: shipping estimator expanded by default
Posted: Wed Sep 11, 2024 9:30 pm
by adibranch
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.
Re: shipping estimator expanded by default
Posted: Wed Sep 11, 2024 10:08 pm
by Joe1234
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.
Re: shipping estimator expanded by default
Posted: Thu Sep 12, 2024 8:10 am
by nonnedelectari
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
Re: shipping estimator expanded by default
Posted: Thu Sep 12, 2024 9:29 pm
by paulfeakins
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.
Re: shipping estimator expanded by default
Posted: Thu Sep 12, 2024 10:59 pm
by adibranch
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.
Re: shipping estimator expanded by default
Posted: Fri Sep 13, 2024 7:43 pm
by paulfeakins
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.
Re: shipping estimator expanded by default
Posted: Fri Sep 13, 2024 10:53 pm
by adibranch
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">
Re: shipping estimator expanded by default
Posted: Mon Sep 16, 2024 7:04 pm
by paulfeakins
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].