Jump to content

javascript dependent Buy buttons


Guest cherryaa

Recommended Posts

Guest cherryaa

I have a 'useability' bee in my bonnet - so the fact that users without javascript can't buy from CubeCart bothers me.

It's not simply a matter of people having javascript 'turned off': accessibility-enhanced browsers rarely implement javascript. Handhelds, currently, have it turned off by default. Estimates put javascript penetration at 89%, meaning that 11% of visitors potentially cannot buy from your store.

There have been threads on this before ... but not many. I'm working through the store code, replacing the javascripts one by one. For now, if anyone's interested, here are the "Buy" button modifications. It's very simple :)

In templates/content/viewProd.tpl, around line 65:

Find

<a href="java script:submitDoc('addtobasket');" class="txtButton">{BTN_ADDBASKET}</a>


Replace with 
<input name="submit" type="submit" value="{BTN_ADDBASKET}" class="txtButton" />






In templates/content/viewCat.tpl, around line 40:

Find 
<a href="java script:submitDoc('prod{PRODUCT_ID}');" target="_self" class="txtButton">{BTN_BUY}</a>


Replace with 
<input name="submit{PRODUCT_ID}" type="submit" value="{BTN_BUY}" class="txtButton" />






In templates/content/cart.tpl, around line 170:

Find 
<div style="float: left; line-height: 22px; margin-bottom: 3px;">

<a href="java script:submitDoc('cart');" class="txtUpdate">{LANG_UPDATE_CART}</a> {LANG_UPDATE_CART_DESC}</div>


<div style="text-align: right; margin-top: 4px; margin-bottom: 3px;">

<a href="{CONT_VAL}" class="txtCheckout">{LANG_CHECKOUT}</a>

</div>

Replace with 
<div style="float: left; line-height: 22px; margin-bottom: 3px;">

<input name="updatebn" type="submit" value="{LANG_UPDATE_CART}" class="txtUpdate" /> {LANG_UPDATE_CART_DESC}</div>

<div style="text-align: right; margin-top: 4px; margin-bottom: 3px;">

<input name="checkoutbn" type="submit" class="txtCheckout" value="{LANG_CHECKOUT}" />

</div>

* Update, 17th Sept 2008:

  • There is an error on the 'Save & Continue' button (crossed out above). It ought to redirect to steps. Milos: Have you done this?
  • Just finishing registration buttons.

Tested with v.3.0.17 and 3.0.18 but not guaranteed flawless or complete. Test site is here.

Please post any corrections, improvements, criticisms & comments :sourcerer:

Cherry.

Link to comment
Share on other sites

There are other parts of CubeCart that rely on JavaScript also. These have not been addressed in your suggestions. I'd say that far fewer than 11% of general internet users do not have JavaScript enabled. Nevertheless, it's always best to collect statistics from your site. This will be the best gauge!

Link to comment
Share on other sites

Guest cherryaa

There are other parts of CubeCart that rely on JavaScript also. These have not been addressed in your suggestions.

Absolutely, Homar. I'm working my way through! The 'buy' button functionality seemed most important, though - and very simply addressed - so I did that first.

I'd say that far fewer than 11% of general internet users do not have JavaScript enabled. Nevertheless, it's always best to collect statistics from your site. This will be the best gauge!

Server stats can only estimate client-side facilites like javascript. Even if you had perfect reporting, it's a safe guess that an online store, which cannot be used without javascript .... will have very few non-js visitors ;)

Just like a store that can only be accessed via a staircase - the owner might say "Oh, but none of my customers use wheelchairs or baby buggies." Well, of course they don't!! If they wanted to become customers: they couldn't get into the shop.

Actually that similie has wider relevance, as the DDA now applies to websites throughout Europe & Australia (not sure about US). CubeCart is pretty well useable - kudos to A.B. on that. The javascripts seem to be there mostly for fact-checks which, imo, aren't worth the sacrifice. Silly to have a text-navigable store that fails at the purchase point.

Ideally, I would have replaced the js functions with PHP ones. I'm lazy. I would buy a mod for it, though! (Hint ;) )

Cherry.

Link to comment
Share on other sites

Guest BazPlates

Cherry,

I am very interested in these codes as I am having problems with Javascript on my page too!

Have yu managed to edit the "Update Cart" and "Register" buttons yet?

Baz

Link to comment
Share on other sites

Guest cherryaa

Cherry,

I am very interested in these codes as I am having problems with Javascript on my page too!

Have yu managed to edit the "Update Cart" and "Register" buttons yet?

Baz

Hi, Baz

I did the update button (in the Cart file, third part of my post above). Haven't got around to Register yet .... feel free to post the answer here. Between us, we should make short work of it ;)

Cherry.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...