Hide "Recalculate" if "No Shipping" for a product?

Questions and answers about ShopSite Custom Templates

Hide "Recalculate" if "No Shipping" for a product?

Postby shopsite_music » Tue Nov 23, 2010 1:15 pm

Hi Gurus - I'd like to hide the "Recalculate" button if there is no shipping for a product (i.e. Downloadable product)

I tried the following "IF" statement, but it didn't work - any ideas?

Thank you - David Sprunger

[-- IF SC_Tax_Shipping --]
[-- SC_Tax_Shipping --]
[-- BUTTON Recalculate--]
[-- END_IF --]
shopsite_music
 
Posts: 21
Joined: Mon Feb 12, 2007 6:49 pm

Re: Hide "Recalculate" if "No Shipping" for a product?

Postby Jim » Tue Nov 23, 2010 5:46 pm

There is no IF option for the [-- SC_Tax_Shipping --] tag so you can't do that type of check. I don't think it would be possible to not display the Recalculate in just certain situations.
Jim
Site Admin
 
Posts: 4953
Joined: Fri Aug 04, 2006 1:42 pm
Location: Utah

Re: Hide "Recalculate" if "No Shipping" for a product?

Postby BFChris » Wed Nov 24, 2010 8:06 pm

If the product name contained a unique identifier that it had no shipping (say, for example, the word "download"), then a little Javascript could probably check and alter the CSS to hide the "Recalculate" button.
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Re: Hide "Recalculate" if "No Shipping" for a product?

Postby shopsite_music » Wed Nov 24, 2010 10:41 pm

Again - Chris great suggestion. Can I either add cheesy bread sticks to the pizza I'm sending you or simply hire you to put together the javascript?
shopsite_music
 
Posts: 21
Joined: Mon Feb 12, 2007 6:49 pm

Re: Hide "Recalculate" if "No Shipping" for a product?

Postby BFChris » Fri Nov 26, 2010 8:11 am

You're welcome to hire me. I need to look at it more closely to figure the exact structure of things.

Send me a private message here or contact me via my website in the link below.
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Re: Hide "Recalculate" if "No Shipping" for a product?

Postby mjbrunelle » Tue Dec 07, 2010 7:24 pm

In your shopping cart you have javascript variables, shipping total is one of these variables and you can test this to display the button or not. Initially do not display the button, test if there are freight charges, and display button when necessary.

var ss_shiptotal = "0.00";

function showButton() {
if (ss_shiptotal != "0.00") { document.getElementById("recalculate").style.display = "block"; }
}

add to css: #recalculate { display: none; }

<div id="recalculate">[-- BUTTON Recalculate --]</div>
<script language="javascript">showButton();</script>
mjbrunelle
 
Posts: 147
Joined: Sun Jun 21, 2009 5:09 am


Return to Custom Template Questions

Who is online

Users browsing this forum: No registered users and 10 guests