Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Set global default value for attribute dropdowns

    I am trying to find what file to edit so I can set the GLOBAL default for attribute dropdown menu's to:
    HTML Code:
    <option selected="selected" style="display:none;">Please Select...</option>
    Is this going to be a possibility?

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

    Default Re: Set global default value for attribute dropdowns

    On the Attributes are settings for Default and Display Only ... mark that on that particular Attribute so that it will show but not be able to be added to the cart ...
    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!]
    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
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: Set global default value for attribute dropdowns

    I know that I can set a certain value to display only and make it default for each and every attribute, I was hoping to be able to code it in so that I can set the style="display:none;" value as well. This way it won't show once the dropdown menu has been expanded.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Set global default value for attribute dropdowns

    Quote Originally Posted by mikestaps View Post
    I know that I can set a certain value to display only and make it default for each and every attribute, I was hoping to be able to code it in so that I can set the style="display:none;" value as well. This way it won't show once the dropdown menu has been expanded.
    So to understand, you have an attribute in your attribute list that you do not want shown n(and as a side result it can not be selected)... Why is it in the attribute list to begin with then?
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Set global default value for attribute dropdowns

    Quote Originally Posted by mc12345678 View Post
    So to understand, you have an attribute in your attribute list that you do not want shown n(and as a side result it can not be selected)... Why is it in the attribute list to begin with then?
    I think I understand now, I would say that would use javascript with an on(something) action to remove the "first" item from the dropdown... That would be something I think to add in the includes/modules/YOUR_TEMPLATE/attributes.php file when generating the dropdown information... (applying the on-click) but I could be wrong on the applicable file.)
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  6. #6
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: Set global default value for attribute dropdowns

    Quote Originally Posted by mc12345678 View Post
    So to understand, you have an attribute in your attribute list that you do not want shown n(and as a side result it can not be selected)... Why is it in the attribute list to begin with then?
    For the dropdown to say "Please Select..." when the page is loaded.

    We have an amazing amount of people that don't even look at the dropdowns, and just add the item to cart. They then complain because they either don't get what they expect, or what they want. This is after it is clearly stated in the product description to please select said option in the drop down menus below, I have also moved the add to cart button below the product description, and attribute dropdowns to "force" the customer to see the dropdowns.

    I'm just trying to save time in the long run by eliminating exchanges.
    Last edited by mikestaps; 31 Jul 2015 at 05:38 PM. Reason: typo

  7. #7
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Set global default value for attribute dropdowns

    Quote Originally Posted by mikestaps View Post
    For the dropdown to say "Please Select..." when the page is loaded.

    We have an amazing amount of people that don't even look at the dropdowns, and just add the item to cart. They then complain because they either don't get what they expect, or what they want. This is after it is clearly stated in the product description to please select said option in the drop down menus below, I have also moved the add to cart button below the product description, and attribute dropdowns to "force" the customer to see the dropdowns.

    I'm just trying to save time in the long run by eliminating exchanges.
    The solution that ajeh offered is the way to prevent these issues...

    I thought that there was a way to also copy the setting(s) (default/display only to an option value) to other places that option value is used (making the process quick) or of course a sql statement could be run to add that "feature" to all equivalent option values.

    What I described above would not solve your problem. It does sound like there is need to apply the default and display only option to your Please choose... option value (best to be sure that it is the lowest non-negative sort order so that no other option can be the default causing the problem above.)

    See this FAQ: https://www.zen-cart.com/content.php...to-my-products

    and take note of the section that says:

    It is also a good idea to make a Default Option Value that the Customer cannot add to the cart to force the Customer to make a proper choice
    And after that, take note of the author of the FAQ. :)
    Last edited by mc12345678; 31 Jul 2015 at 05:46 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  8. #8
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: Set global default value for attribute dropdowns

    Quote Originally Posted by mc12345678 View Post
    I think I understand now, I would say that would use javascript with an on(something) action to remove the "first" item from the dropdown... That would be something I think to add in the includes/modules/YOUR_TEMPLATE/attributes.php file when generating the dropdown information... (applying the on-click) but I could be wrong on the applicable file.)
    Hmmm, I have been looking at that file scratching my head on how to work out the change, javascript just may work...

  9. #9
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: Set global default value for attribute dropdowns

    Quote Originally Posted by mc12345678 View Post
    The solution that ajeh offered is the way to prevent these issues...

    I thought that there was a way to also copy the setting(s) (default/display only to an option value) to other places that option value is used (making the process quick) or of course a sql statement could be run to add that "feature" to all equivalent option values.

    What I described above would not solve your problem. It does sound like there is need to apply the default and display only option to your Please choose... option value (best to be sure that it is the lowest non-negative sort order so that no other option can be the default causing the problem above.)

    See this FAQ: https://www.zen-cart.com/content.php...to-my-products

    and take note of the section that says:
    I was afraid of that... not a major deal, but from a design standpoint I don't like the look of having "Please Select..." in the menu after it has ben "opened".

    My original idea was to run a check if the option was set to both default and display only to add the style="display:none;"
    Last edited by mikestaps; 31 Jul 2015 at 05:51 PM. Reason: add original idea

  10. #10
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Re: Set global default value for attribute dropdowns

    If I recall correctly (probably don't) such styling would not be recognized/acted upon, hence the need for the additional javascript or other coding option.

    One thing of note, remember you are out to make money... Be sure you are devotng your resources to that which is not necessarily in the bells and whistles...
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Set an attribute as automatic default selection?
    By LindeeG in forum Setting Up Categories, Products, Attributes
    Replies: 7
    Last Post: 22 Oct 2014, 05:25 PM
  2. Set up a default attribute?
    By suecalvi in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 28 Nov 2008, 05:46 AM
  3. How to set option value with a set image as default of an attribute?
    By PaulRiedel in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 16 Aug 2007, 04:21 AM
  4. set default value in cart to 1
    By usernamenone in forum Basic Configuration
    Replies: 5
    Last Post: 21 Sep 2006, 04:34 AM

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