PDA

View Full Version : New Checkout Script Show / Hide Cart Contents


Darren B
17-Apr-2010, 10:07 AM
Does anyone know if and how you can change the default setting of the show / hide cart details.

Currently on the site im working on it defaults to show cart contents, on every page as you move through the checkout. Most of our orders consist of 10 or more lines so the invoice info is miles down the page.

So what i would like to do is have the script hide the cart details by default with the option to show it if the user / customer wants.

Thanks
Darren

Darren B
19-Apr-2010, 03:57 PM
Can anyone from Actinic off any help on this one?

Be much appreciated
Cheers
Darren

Benjamin Dyer
19-Apr-2010, 04:17 PM
Hi Darren,

Just looking into it for you.

Ben

Benjamin Dyer
19-Apr-2010, 04:21 PM
Darren, try this:

In Checkout Shopping Cart Grid:

Change the end from:
</div>
</Actinic:XMLTEMPLATE>

to:

<script type="text/javascript">
SetShoppingCartVisibility();
</script>
</div>
</Actinic:XMLTEMPLATE>

We should get this into the AUG.

Ben

TraceyHand
19-Apr-2010, 07:47 PM
Darren, try this:

In Checkout Shopping Cart Grid:

Change the end from:
</div>
</Actinic:XMLTEMPLATE>

to:

<script type="text/javascript">
SetShoppingCartVisibility();
</script>
</div>
</Actinic:XMLTEMPLATE>

We should get this into the AUG.

Ben

And onto the Renewals part of the Actinic site!
It's very untidy-looking, the renewals cart info and I found myself clicking 'hide cart contents' at EVERY page change (which was often!)

tbh, it'd have made sense to hide the contents by default on subsequent pages (if customer clicks to hide, on the first page) but I'm guessing that'd create more work

NormanRouxel
19-Apr-2010, 09:13 PM
You could store the cart visibility in a cookie and thus persist the state as the checkout progresses.

Here's how:

Edit layout Checkout Shopping Cart Grid:

A few lines down from the top there is a line containing the fragment:

onclick="SetShoppingCartVisibility();"

Amend this bit to be:

onclick="setCookie('ACTINIC_CARTVIZ', document.getElementById('idShowHide').innerHTML); SetShoppingCartVisibility();"


At the bottom you should see:

</div>
</Actinic:XMLTEMPLATE>

Immediately above it add:

<script type="text/javascript">
if ( getCookie('ACTINIC_CARTVIZ') == 'hide' )SetShoppingCartVisibility();
</script>

TraceyHand
19-Apr-2010, 09:26 PM
There's one for 10.0.1, I'd say!
Nice one, Norman

NormanRouxel
19-Apr-2010, 09:41 PM
Just amended the above so that you don't need to tinker with actinicextras.js and only have one layout to tweak.

Darren B
20-Apr-2010, 12:35 PM
Thanks Norman, just got back from london and your hack seems to work a treat

One for the AUG i think.

Sorry Ben i went for Normans fix as it seemed the best solution as it will remember your all stages of the checkout.

Darren

Darren B
20-Apr-2010, 02:01 PM
OK maybe this is not working as intended

It seems that the first time checking out it cleared the basket, the second time it picked up other details and the wrong addresses, as they were different to the ones entered. I have a feeling this is the cookie thing. somehow it picked up my previous address details when testing instead of the new details when someone else was testing?

OK going to try actinics hack now

Darren B
20-Apr-2010, 02:10 PM
Right testing the Actinic script and all seems to be good so far. I will continue to test and see if i get any problems with this

Cheers
Darren

skinnybloke
14-Sep-2010, 09:27 AM
Does anyone know if this still works under v10.0.2 as there is additional code in the template above this line:
</div>
</Actinic:XMLTEMPLATE>
which is:
<script language="javascript" type="text/javascript">
document.getElementById('idShowHideCart').style.display = '';
</script>
</div>
</Actinic:XMLTEMPLATE>

peblaco
07-Oct-2010, 10:57 AM
OK maybe this is not working as intended

It seems that the first time checking out it cleared the basket, the second time it picked up other details and the wrong addresses

Hi Darren, I was looking at using this, did you find it worked okay or did you still have problems with the cookie?. Which version did you opt for?.

JimboS
08-Oct-2010, 02:23 PM
I have used the 'Actinic' version on our site www.natorigin.co.uk and works fine.

I did create a new checkout layout for the summary page which shows the cart.

So stage one and two the cart is hidden by default to keep the page size small and then on the summary page the cart is expanded, works a treat.

James

peblaco
08-Oct-2010, 03:10 PM
I have used the 'Actinic' version on our site

Thanks for the input, I've used that one too and works well.