Zen Cart Logo
Forums / General Questions / Determining if a checkbox is checked?

Determining if a checkbox is checked?

Locked

Views: 1,178

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
11 Jul 2006, 11:17 PM
#1
blaq avatar

blaq

New Zenner

Join Date:
Jul 2006
Posts:
2
Plugin Contributions:
0

Determining if a checkbox is checked?

In the admin Configuration/Stock window, I removed the garish Delete button, leaving only individual Delete checkboxes next to each item. Since these have no effect unless the customer then clicks the Update button, I wanted to add a helpful message (as a title attribute) to the checkbox, something like "Check to delete item(s), then click Update".

In tpl_shopping_cart_default.php , I need to edit the following code:

if ($product['checkBoxDelete'] ) {
echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
}

Using the $parameter parameter seems to be the preferred method to include extra output in generated HTML tags. I see that zen_draw_checkbox_field is defined this way:

function zen_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {

...and here's where my lack of PHP knowledge is showing. Seems I need to pass the checkbox's current checked status, as the 4th parameter, in order to be able to specify a 5th one. How would I modify the "echo zen_draw_checkbox_field" command, above, to pass the checkbox's current checked status?

Thanks!

(And to think 2 weeks ago, I hadn't ever worked in PHP, nor touched ZenCart. My customized store is really shaping up, a testament to the designers of bothPHP and Zencart.)

12 Jul 2006, 9:17 PM
#2
blaq avatar

blaq

New Zenner

Join Date:
Jul 2006
Posts:
2
Plugin Contributions:
0

Re: Determining if a checkbox is checked?

Oh, the embarrassment of being unable to delete a post. I posted while my head was spinning from an intense day of customization.

I later realized that the Stock area has no need to appear with pre-checked checkboxes; all boxes will be empty, waiting for the user to perhaps check them.

Please disregard the question above.