Results 1 to 2 of 2

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    2
    Plugin Contributions
    0

    Default 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:

    [FONT="Courier New"] if ($product['checkBoxDelete'] ) {
    echo zen_draw_checkbox_field('cart_delete[]', $product['id']);
    }
    [/FONT]

    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:

    [FONT="Courier New"]function zen_draw_selection_field($name, $type, $value = '', $checked = false, $parameters = '') {
    [/FONT]

    ...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.)

  2. #2
    Join Date
    Jul 2006
    Posts
    2
    Plugin Contributions
    0

    Default 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.

 

 

Similar Threads

  1. newsletter checkbox default checked - legal in California?
    By fakeDecoy in forum General Questions
    Replies: 1
    Last Post: 14 Jun 2011, 08:36 PM
  2. Be sure that the Checkbox to enable IPN is checked
    By Javalin in forum General Questions
    Replies: 1
    Last Post: 1 Sep 2010, 08:04 AM
  3. Redio Checkbox not checked when copying attributes
    By Whale in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 22 Jul 2009, 10:08 PM
  4. Display checked newsletter subscription checkbox legal in U.K.?
    By OK Computer in forum General Questions
    Replies: 0
    Last Post: 20 Jun 2006, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg