Page 1 of 3 123 LastLast
Results 1 to 10 of 29
  1. #1
    Join Date
    Jun 2007
    Posts
    21
    Plugin Contributions
    0

    Default the download radio button

    Hello
    I wonder if anyone could point me in the right direction - I feel this is a look and feel issue-
    I'm very happy to have got my downloads working, but is it possible to hide the words 'Please Choose', 'Download Zip' and the radio button? It seems silly to ask the customer to make a choice when there is no choice to be made and may just lead to confusion. Doubly so when all my products are downloadable assets anyway. I arrived at this by following tutorials on how to get downloads working.
    TIA for any help
    Egg


  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: the download radio button

    Just rewrite it to figure out when the radiobutton is in fact an attribute with a download and the only possible choice and whether it should always be selected or not and when it should set it as a hidden selected data that more or less does what the selected radio button does when it is showing ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Jun 2007
    Posts
    6
    Plugin Contributions
    0

    Default Re: the download radio button

    ajeh: i totally didn't understand your answer, but is there any way to hide the "please choose" along with the radiobutton from the customer?

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: the download radio button

    sure ... you have to re-write all of the code for this and not break the existing code ...

    It is on the list of things to do ... but no idea when we will get around to it as it is not at the moment a high priority ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Jun 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: the download radio button

    Thank you for the reply Ajeh. Alas I am not in a position to write or re-write any kind of code so I'm afraid I didn't understand it either (or rather I understood it but not how to go away and do it!) :)
    Lol, I'd hoped there would be some attribute choices I can switch off to achieve this or perhaps a few lines in the manual I could follow :)
    Cheers anyway.
    Egg

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: the download radio button

    Afraid there isn't anything built into Zen Cart at this time to make this easy for you ...

    At some point we will get to it on the famous list of things to do ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Jun 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: the download radio button

    OK thanks for the reply Ajeh. Look forward to seeing that to do list go down (lol, I doubt the to do list ever goes down for software developers!)

  8. #8
    Join Date
    Jun 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: the download radio button

    Quote Originally Posted by egghed View Post
    OK thanks for the reply Ajeh. Look forward to seeing that to do list go down (lol, I doubt the to do list ever goes down for software developers!)
    Hi Egghed,

    I'm going to have to make the same modification. It will be a couple of days before I have a chance to do so but when I do, I'll share the code with you.

    stage

  9. #9
    Join Date
    Jun 2007
    Posts
    21
    Plugin Contributions
    0

    Default Re: the download radio button

    Stage you're a star, thank you very much!
    Egg

  10. #10
    Join Date
    Jun 2007
    Posts
    54
    Plugin Contributions
    0

    Default Re: the download radio button

    Please be aware that I am relatively new to ZC but I do have a lot of experience with PHP and working on opensource applications. I make that disclaimer because in case this code is contrary to ZC coding standards, they are due to novice error. Also this changes some core code, so absolutely before you do anything make sure you create a backup. Also when I identify line numbers, those are not exact but should be close. The intention is to get you in the right section of the code and necessarily the exact line. Pay close attention to the content of the lines of code rather than the line numbers I use.

    I've tested this and it appears to work as desired and does not appear to break anything in the process. My goal because our site is selling only downloads I wanted the cart to function so that if an attribute was a radio button and only had one option, not to display anything associated with attributes for the particular product. The value is still there but I modified it to pass as a hidden value rather than a radio button. Also make sure you have selected radio button as the type and not dropdown which will display as a radio button if there is only one option.

    To begin I had a to make some changes to my template. The default template has similiar code, so I'll use that for example. And you should be able to apply it to your own template.

    In the tpl_modules_attributes.php around line 29 find this code:

    Code:
    <?php if ($zv_display_select_option > 0) { ?>
    This code checks to see if there are ANY options and if so displays the text to "Choose Options". I changed that code to this:

    <?php if ($zv_display_select_option > 1) { ?>
    Now the text will display only if there are more than one option available.

    A little further down around line 61 find this code:

    Code:
    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
    This is the code that displays the option name. Since in my case the option is always there and always selected by default, I didn't want to display it. So I applied the same solution as I did for the "Choose Options" text. So I added a line both above and below that line of code. The whole thing looks like this:

    Code:
    <?php if ($zv_display_select_option > 1) { ?>
    <h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
    <?php } // show please select unless all are readonly ?>
    The next file I modified, and this is a core file, remember BACKUP, is attributes.php. If you look around line 451 you should find a line of code that looks like this:

    Code:
    switch ($products_options_names->fields['products_options_images_style']) {
    This switch statement determines how a radio button with be displayed based on your configuration. For example if you have an image with it, that sort of thing. It's a fairly long section of code, so you want to be care here that you make the modifications in the correct place. Since in the case of only a single option, I don't want to display a radio button at all, I checked to see if indeed there was only one option and if so, skip this whole section. I added an if statement above the line above like this:

    Code:
    //***  begin mod for single option radio button ***********
                        if($products_options->RecordCount() == 1){
                            $tmp_radio .= zen_draw_hidden_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') .'<br />' . "\n";
                        } else { 
                        //***  end mod for single option radio button *********
    To help clarify the positioning, this code shows its relationship to the switch statement:

    Code:
    //***  begin mod for single option radio button ***********
                        if($products_options->RecordCount() == 1){
                            $tmp_radio .= zen_draw_hidden_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') .'<br />' . "\n";
                        } else { 
                        //***  end mod for single option radio button *********
                            switch ($products_options_names->fields['products_options_images_style']) {
    It's almost done, the last thing to do is close the else condition at the end of the switch statement. This is the tricky part, so you want to be careful to get the closing brace in the correct place. I'm including a lot of extra code here to help finding the correct place. Starting at around line 562 find this code:

    Code:
    $tmp_attributes_image .= '<div class="attribImg">' . zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<br />' . '<label class="attribsRadioButton fiveA" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options->fields['products_options_values_name'] . ($products_options_details_noname != '' ? '<br />' . $products_options_details_noname : '') . '</label></div>';
    
                              }
    
                              break;
    
                            } // end of switch statement
                        
                      } // end of if radio button
    
    
    
                      // checkboxes
    I've added the comments for the closing brackets for both the switch statement and the whole section which is if its a radio button. So what I wanted to do here was add a closing brace after the closing switch statement brace and before the ending if statement brace. So my final code looks like this:

    Code:
    $tmp_attributes_image .= '<div class="attribImg">' . zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, $selected_attribute, 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<br />' . '<label class="attribsRadioButton fiveA" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options->fields['products_options_values_name'] . ($products_options_details_noname != '' ? '<br />' . $products_options_details_noname : '') . '</label></div>';
    
                              }
    
                              break;
    
                            } // end of switch statement
                        //***  begin mod for single option radio button ***********
                        } 
                        //***  end mod for single option radio button ***********
                      } // end of if radio button
    
    
    
                      // checkboxes
    And that's all there is to it. My suggestion is to take is slow and again make sure that you make a backup before making any changes at all. Also be aware that because there are changes to the core, if you apply an upgrade at some point in the future, you'll have to make these changes again to the new code. Hope this helps.

    stage

 

 
Page 1 of 3 123 LastLast

Similar Threads

  1. where to find the code that does the radio button?
    By denniszc in forum General Questions
    Replies: 9
    Last Post: 8 Apr 2013, 12:45 PM
  2. v139h Download Radio Button choice Showing Twice
    By budy in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 31 Jan 2013, 04:15 AM
  3. download product - radio button choice
    By betheone in forum Setting Up Categories, Products, Attributes
    Replies: 9
    Last Post: 28 Oct 2012, 07:12 PM
  4. Download troubles on Mac - How can I get the 'download' button to bring up 'save as'?
    By ThisSideOfTheCross in forum Managing Customers and Orders
    Replies: 2
    Last Post: 23 Apr 2010, 05:56 AM
  5. Can I hide the Download Radio Button?
    By elastic in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 21 Apr 2008, 05:45 AM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR