Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Require attributes to be selected if another one is

    I'm working on setting up a group of attributes for products that will add a monogram. The product can be purchased without the monogram but if the text for the monogram is entered then the customer must also select the style, monogram type, and color. I've set up 4 option names Monogram(text), Style(dropdown), Lettering(dropdown), and Color(dropdown). The dropdown type option names all have associated option values. I've run into a couple problems. First is that I need to restrict the number of characters that can be entered based on the lettering option. I can only limit the number of characters to the longest number. The next problem I'm having is that if the monogram text is entered I need to require the style, lettering, and color to be selected.
    Here's a link to the product so you can see what I'm talking about. poshplaymat dot com/index.php?main_page=product_info&cPath=1&products_id=31

    Before I start looking at how to modify code to do this I thought I'd check to see if there's a method in the stock cart that I'm not seeing.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,488
    Plugin Contributions
    88

    Default Re: Require attributes to be selected if another one is

    An attribute's data is gathered in the id[] array, where the array index is the options_id value (e.g. Style = 1, Lettering = 2, Color = 3). The Monogram, being a text attribute, should be present in array index txt_4 but it's currently showing as TEXT_PREFIX4 because you either installed or uninstalled a plugin that killed your configuration table's configuration_group_id = 0 (there's a post by Ajeh somewhere that identifies the SQL patch to put things back).

    Knowing the attributes' names, you can write some site-specific javascript/jQuery that will hide/display the dependent attributes based on the absence/presence of the Monogram value.

  3. #3
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Require attributes to be selected if another one is

    Thanks Lat. I think I remember that post was related to the printable price list mod. I'll hunt that fix up. I was hoping there was a built in way to get around it but the coding shouldn't be ugly.

    On a more personal note I see you were an STSM. I had 31 years at IBM starting in 77 also. We probably bumped into each other at some point.

  4. #4
    Join Date
    Aug 2009
    Location
    Longs, SC
    Posts
    626
    Plugin Contributions
    2

    Default Re: Require attributes to be selected if another one is

    Here's a link to the fix for the problem Lat mentioned. http://www.zen-cart.com/showthread.p...517#post973517

 

 

Similar Threads

  1. Add attributes only once shopper has selected another attribute
    By AmandaS in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 14 Sep 2012, 04:37 PM
  2. import attributes from one store to another?
    By thomaswhiteeagle in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 18 May 2011, 02:04 AM
  3. How to Make Attributes Dependant on One Another?
    By coldfirepromotions in forum Setting Up Categories, Products, Attributes
    Replies: 5
    Last Post: 3 Dec 2010, 05:29 PM
  4. Only offer certain attributes if another attribute is selected first
    By Sushigal in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 4 May 2010, 10:22 AM
  5. Activate one product when another is selected
    By SimplyJoe in forum General Questions
    Replies: 7
    Last Post: 13 Jan 2009, 04:44 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