Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Templates, Stylesheets, Page Layout / How to remove the Update Cart button completely?

How to remove the Update Cart button completely?

Locked

Started by jdunique on 25 Apr 2008, 12:11 PM · Views: 1,785

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
25 Apr 2008, 12:11 PM
#1
jdunique avatar

jdunique

New Zenner

Join Date:
Apr 2008
Location:
Montreal, Quebec, Canada
Posts:
28
Plugin Contributions:
0

How to remove the Update Cart button completely?

Is there a way to remove the Update Cart (or Refresh Cart) button completely? :huh:?

I know that in
admin/configuration/stock/

You have the setting:
Show Shopping Cart - Update Cart Button Location

And then you have 3 choices, by radio buttons
1= Next to each Qty Box
2= Below all Products
3= Both Next to each Qty Box and Below all Products

With any of these choices, the Update Cart will apear somewhere, I cannot remove it from there.

All my products can only be ordered in quantities of 1, so there is never a need to "refresh" the cart in my case

Thanks in advance :blush:

25 Apr 2008, 12:17 PM
#2
jdunique avatar

jdunique

New Zenner

Join Date:
Apr 2008
Location:
Montreal, Quebec, Canada
Posts:
28
Plugin Contributions:
0

Re: How to remove the Update Cart button completely?

I do know that this button is called
**'button_update_cart.gif' **and that it is defined by the variable 'ICON_IMAGE_UPDATE'

and that this variable is mentionned in two files:

/includes/modules/pages/shopping_cart/header_php.php

Line #139 : $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);

/includes/templates/template_default/templates/tpl_shopping_cart_default.php

Line #137 : <div class="buttonRow back"><?php echo zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT); ?></div>

But I don't know what to do with this information!

25 Apr 2008, 2:26 PM
#3
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: How to remove the Update Cart button completely?

You'd want to remove or comment out the line 137 in **includes/templates/template_default/templates/tpl_shopping_cart_default.php **, then store the edited file in the proper override folder.

26 Apr 2008, 9:02 PM
#4
jdunique avatar

jdunique

New Zenner

Join Date:
Apr 2008
Location:
Montreal, Quebec, Canada
Posts:
28
Plugin Contributions:
0

Re: How to remove the Update Cart button completely?

For some reason (maybe because I have a custom template?) nothing happened when I remove the line in the file tpl_shopping_cart_default.php

What DID worked for me was to simply take this file:

/includes/modules/pages/shopping_cart/header_php.php

Line #139 : $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);

and change the 1 for a 0

Line #139 : $buttonUpdate = ((SHOW_SHOPPING_CART_UPDATE == 1 or SHOW_SHOPPING_CART_UPDATE == 3) ? zen_image_submit(ICON_IMAGE_UPDATE, ICON_UPDATE_ALT) : '') . zen_draw_hidden_field('products_id[]', $products[$i]['id']);

since the positioning parameter is set at 1 in admin/config/stock ... when the code read that line, there's no 1, so I get no button

I dont know if this has over implications that I haven thought of yet but everything seems to be working great :)