Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / All Other Contributions/Addons / Product Attribute Grid

Product Attribute Grid

Started by absolute on 15 Jan 2008, 5:01 PM · Views: 139,578

Results 481 to 500 of 546
31 Oct 2016, 12:19 AM
#481
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Product Attribute Grid

Does anybody read this attribute grid posts? hope so :-)

I am using Attribute Grid plugin on my 1.5.5 Zencart. All working fine.

Since I want to use the attrib grid format for all my products including with only one single price option (to show layout and look uniform) , I have come across that if you do only have one grid option it is displaying and 'Option' (round) button without the quantity box. If I add another grid option then it display the both options as grid format with both showing quantity boxes.

What do I need to change in order to get using ONE Attribute Grid Option showing QUANTITY (with price option) box?

Downunder QLD

31 Oct 2016, 1:00 AM
#482
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product Attribute Grid

Absolutely is still read. Previous question regarding display of add-to-cart quantity was already addressed and could have been accomplished in other ways as well.

As to this issue, I've looked through the code and nothing stands out as the cause, but still need to try to replicate the issue.

If I understand correctly the setup is: product has a single option name and that option name has a single option value. The option name is setup to use the PAG option.

In the above configuration, you're saying that only a radio button is presented and not the PAG option.

Come to think of it, the way that the attributes.php file is setup, this seems like a ZC overrides the currently considered action situation. And the goal would be to override that "natural" action and allow operation to then continue back to show the PAG option.

For your store, could modify your includes/modules/YOUR_TEMPLATE/attributes.php and remove this entire section:

// dropdown menu auto switch to selected radio button display
                  case ($products_options->RecordCount() == 1):
                  if ($show_attributes_qty_prices_icon == 'true') {
                    $options_name[] = '<label class="switchedLabel ONE" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'] . '</label>';
                  } else {
                    $options_name[] = $products_options_names->fields['products_options_name'];
                  }
                  $options_html_id[] = 'drprad-attrib-' . $products_options_names->fields['products_options_id'];
                  $options_menu[] = zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, 'selected', 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<label class="attribsRadioButton" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_details . '</label>' . "\n";
                  $options_comment[] = $products_options_names->fields['products_options_comment'];
                  $options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
                  break;

At least until a more suitable standard solution is developed. It's a bit of a "hack", but would directly accomplish the desired task.

Ps. If there are hashtags (#) in the above, I apologize in advance. The content was directly copied from github and sometimes spaces turn into hashtags when I do that. I don't have an option to paste any special way at the moment to possibly remove and it would take a while to correct them after posting.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Nov 2016, 2:13 AM
#483
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

oavs:

Hi Danny,

May I ask how you styled your Product Attribute Grid in http://kitchenwarehouseltd.com/ ? did you do it your self or a developer did. I want to achieve the same look and feel in regards to Product Attribute Grid only.

Looking forward to your reply

Please ignore this.

Downunder QLD

1 Nov 2016, 7:25 AM
#484
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Hi, Thanks for your help it is much appreciated.

I have commented the as you advised. It worked but now it will not display product option value (under the heading of '
Product / Item Code') . You can see it here http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=59&products_id=71

It supposed to display like this http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=64&products_id=48

Downunder QLD

1 Nov 2016, 4:55 PM
#485
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product Attribute Grid

oavs:

Hi, Thanks for your help it is much appreciated.

I have commented the as you advised. It worked but now it will not display product option value (under the heading of '
Product / Item Code') . You can see it here http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=59&products_id=71

It supposed to display like this http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=64&products_id=48

Found it.

Modification is needed to lines 285 and 314 of includes/classes/observers/class.attributes_grid_products.php

I will present each line and its modification as a group (285 orig, 285 mod then 314 same):

Line 285 from:

          if (($grh_size > 1) && zen_not_null($grid_records['H']['options'][$grh]['name'])) {

To:

          if (($grh_size >= 1) && zen_not_null($grid_records['H']['options'][$grh]['name'])) {

Line 314 from:

          if (($grv_size > 1) && zen_not_null($grid_records['V']['options'][$grv]['name'])) {

To:

          if (($grv_size >= 1) && zen_not_null($grid_records['V']['options'][$grv]['name'])) {

On other things, while reviewing the source code, I noticed something that seemed odd but can be corrected through casting of variables that use the ['id'] key to an integer value. If one of those is blank (guess should/could really be 0) then ids such as: attrib-grid-vHeader- could be generated instead of attrib-grid-vHeader-0.

So for example line 315 would change from:

            $this->_attrib_grid .= '  <td class="attrib-grid-vHeader" id="attrib-grid-vHeader-'.$grid_records['V']['options'][$grv]['id'].'">'.$grid_records['V']['options'][$grv]['name'];

to:

            $this->_attrib_grid .= '  <td class="attrib-grid-vHeader" id="attrib-grid-vHeader-'.(int)$grid_records['V']['options'][$grv]['id'].'">'.$grid_records['V']['options'][$grv]['name'];

Not a huge deal unless you are using some sort of "calculation" code to relate to the specific id. The logical thing would be to look for one with the 0 in it, but that's not how it is currently functioning. Will get those two updated as time permits. :) Seems to work on my demo site. Welcome feedback on the two above solutions as in if issues are caused by them.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

1 Nov 2016, 11:21 PM
#486
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Wow Iam speachless for the quality of support you are giving. Thanks a million.

Yes it works as you have ammended the code.

That is why I love Zencart, we get endless excellent SUPPORT SUPPORT SUPPORT from members and developes year in year out. Great bunch of guys and gals.

Cheers

Thanks you :-)

Downunder QLD

2 Nov 2016, 1:45 AM
#487
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

sorry I was having network problem and posted twice.

Downunder QLD

2 Nov 2016, 1:47 AM
#488
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Ok one last thing.

I am tring to sytle the 'Add to Cart' button here http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=64&products_id=48&number_of_uploads=0

to look and behave the same as here http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=53&products_id=56

At the moment Attribute Grid seems to be using an image of 'Add to Cart' button instead of CSS.

Downunder QLD

2 Nov 2016, 4:52 AM
#489
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product Attribute Grid

oavs:

Ok one last thing.

I am tring to sytle the 'Add to Cart' button here http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=64&products_id=48&number_of_uploads=0

to look and behave the same as here http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=53&products_id=56

At the moment Attribute Grid seems to be using an image of 'Add to Cart' button instead of CSS.

Considering that the add to cart button of the unmodified product information page appears to be displayed using javascript and that the difference between the two page is the commenting out of the box/or a section of code, I would say that the commenting out portion should be reviewed as it applies to your store.

BTW, found a better/improved solution to the single option value issue addressed above making the code removal/commenting out unnecessary.

in includes/classes/observers/class.attributes_grid_products.php
modify the function updateNotifyAttributesModuleOptionBuilt to be the following adding the code in red:

  function updateNotifyAttributesModuleOptionBuilt(&$callingClass, $notifier, $products_options_names_fields,
                                                   &$options_name, &$options_menu, &$options_comment,
                                                   &$options_comment_position, &$options_html_id,
                                                   &$options_attributes_image) {

    global $products_options; 

    if ($products_options->RecordCount() == 1 && $products_options_names_fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_GRID) {
      array_pop($options_name);
      array_pop($options_menu);
      array_pop($options_comment);
      array_pop($options_comment_position);
      array_pop($options_html_id);
      array_pop($options_attributes_image);

      $this->updateNotifyAttributesModuleDefaultSwitch($callingClass, $notifier, $products_options_names_fields, $options_name, $options_menu, $options_comment,  $options_comment_position, $options_html_id);
    }


    // if at the last option name, then no further processing above and want to reset the
    // counter so that on the next use on this session it is zero.
    if ($this->_products_options_names_current == $this->_products_options_names_count) {
      $this->_products_options_names_current = 0;
    }

  }

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

3 Nov 2016, 6:18 AM
#490
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Sorry I'm bit not clear.

You mean;
1: To fix the CSS 'Add to Cart ' issue is to do with the javascript that commenting out of the box/or a section of code in the Attribute_grid file should be investigated. Is that right?

2: I should revert back to the original code as an better option where my current ammendments are at the moment that you have advised and implement the "includes/classes/observers/class.attributes_grid_products.php
modify the function updateNotifyAttributesModuleOptionBuilt to be the following adding the code in red:" alternative medthod?

Downunder QLD

3 Nov 2016, 11:40 AM
#491
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product Attribute Grid

oavs:

Sorry I'm bit not clear.

You mean;
1: To fix the CSS 'Add to Cart ' issue is to do with the javascript that commenting out of the box/or a section of code in the Attribute_grid file should be investigated. Is that right?

2: I should revert back to the original code as an better option where my current ammendments are at the moment that you have advised and implement the "includes/classes/observers/class.attributes_grid_products.php
modify the function updateNotifyAttributesModuleOptionBuilt to be the following adding the code in red:" alternative medthod?

Okay, I'll try to make this a comprehensive answer to minimize searching around further.

Item 1:
The initial "concern" was that the fact that the add-to-cart button remained displayed while the PAG options also displayed a quantity. In order to remove the text box of a product that had PAG applied, the following was incorporated:

oavs:

Oh here is the content: zen-cart.com/showthread.php?85649-Product-Attribute-Grid&highlight=1188155

Quote Originally Posted by guyonthegoldcoast View Post
@ray-the-otter

I might have a solution for you that works for me.
I also had the same issue of confusion when I installed the module, so I made changes.

Template:
tpl_product_info_display.php ( copy to custom template folder, then make changes )

change :
Code:
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . '<span class="fright">'.zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT).'</span>';
}
to this:

Code:
if ($zv_display_select_option > 0) {
// bof MOD: hide the quantity box if attributes exists // only works with Attribute Grid Module.
$the_button = '' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . '<span class="fright">'.zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT).'</span>'; // eof
} elseif ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
// hide the quantity box and default to 1
$the_button = '<input type="hidden" name="cart_quantity" value="1" />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id']) . '<span class="fright">'.zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT).'</span>';
}
works for me for now, could be improved.
Any comments and changes please post them.

Regards
guyonthegoldcoast

I haven't had an opportunity to fully review your site, but you could confirm something for me which would make the following edit functional for your store.

Create a test product or modify one that doesn't use PAG so that the quantity order max is 1 or the quantity box status is 0. Verify that your CSS button still appears as desired. If it does, then the above code should be applied as shown below which is based off of a default version of the file, not as it has been modified in your store:

Find and change the following:

if ($products_qty_box_status == 0 or $products_quantity_order_max== 1)  {$the_button = '<input type="hidden" name="cart_quantity" value="1"  />' . zen_draw_hidden_field('products_id', (int)$_GET['products_id'])  . '<span class="fright">'.zen_image_submit(BUTTON_IMAGE_IN_CART,  BUTTON_IN_CART_ALT).'</span>';
                }

to this:

                if ($products_qty_box_status == 0 or $products_quantity_order_max== 1 or $zv_display_select_option > 0) { // bof MOD: hide the quantity box if attributes exists // only works with Attribute Grid Module.
                  // hide the quantity box and default to 1
                  $the_button = '<input type="hidden"  name="cart_quantity" value="1" />' .  zen_draw_hidden_field('products_id', (int)$_GET['products_id']) .  '<span class="fright">'.zen_image_submit(BUTTON_IMAGE_IN_CART,  BUTTON_IN_CART_ALT).'</span>';
                }

If the above test is successful, then it would provide indication that your javascript is in fact looking for an input field with the name cart_quantity in order to modify the button because that is the only difference in the code originally added and this code.

Now, regarding item 2 (which was identified as an issue in the next quoted posted) and the primary point of my previous message.

oavs:

Does anybody read this attribute grid posts? hope so :-)

I am using Attribute Grid plugin on my 1.5.5 Zencart. All working fine.

Since I want to use the attrib grid format for all my products including with only one single price option (to show layout and look uniform) , I have come across that if you do only have one grid option it is displaying and 'Option' (round) button without the quantity box. If I add another grid option then it display the both options as grid format with both showing quantity boxes.

What do I need to change in order to get using ONE Attribute Grid Option showing QUANTITY (with price option) box?

In order for PAG to display properly when only a single option value is presented (in the column, the row, or both) then the following edits are necessary and when PAG is updated here as a download, they will be incorporated. The difference in this and what has been discussed above is that the includes/modules/YOUR_TEMPLATE/attributes.php file does not need modification as suggested before and should be restored to permit it to handle the special case of $products_options->RecordCount() == 1.

So from the two posts "linked" here:

mc12345678:

Found it.
mc12345678:

BTW, found a better/improved solution to the single option value issue addressed above making the code removal/commenting out unnecessary.

The combined modification to make this all work out is:

Modification is needed to lines 285 and 314 of includes/classes/observers/class.attributes_grid_products.php

I will present each line and its modification as a group (285 orig, 285 mod then 314 same):

Line 285 from:

          if (($grh_size > 1) && zen_not_null($grid_records['H']['options'][$grh]['name'])) {

To:

          if (($grh_size >= 1) && zen_not_null($grid_records['H']['options'][$grh]['name'])) {

Line 314 from:

          if (($grv_size > 1) && zen_not_null($grid_records['V']['options'][$grv]['name'])) {

To:

          if (($grv_size >= 1) && zen_not_null($grid_records['V']['options'][$grv]['name'])) {

in includes/classes/observers/class.attributes_grid_products.php
modify the function updateNotifyAttributesModuleOptionBuilt to be the following adding the code in red (line numbers are not used here because of potential effects by applying the above):

  function updateNotifyAttributesModuleOptionBuilt(&$callingClass, $notifier, $products_options_names_fields,
                                                   &$options_name, &$options_menu, &$options_comment,
                                                   &$options_comment_position, &$options_html_id,
                                                   &$options_attributes_image) {

    global $products_options; 

    if ($products_options->RecordCount() == 1 && $products_options_names_fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_GRID) {
      array_pop($options_name);
      array_pop($options_menu);
      array_pop($options_comment);
      array_pop($options_comment_position);
      array_pop($options_html_id);
      array_pop($options_attributes_image);

      $this->updateNotifyAttributesModuleDefaultSwitch($callingClass, $notifier, $products_options_names_fields, $options_name, $options_menu, $options_comment,  $options_comment_position, $options_html_id);
    }


    // if at the last option name, then no further processing above and want to reset the
    // counter so that on the next use on this session it is zero.
    if ($this->_products_options_names_current == $this->_products_options_names_count) {
      $this->_products_options_names_current = 0;
    }

  }

So, hopefully that clears things up for you (item 1) and everyone (item 2).

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Nov 2016, 12:49 AM
#492
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Ok thanks again for all your help.

I have implemented all and did not see any difference in my current state. Infact if I use red colored code 'global $products_options; ' below no attributes is shown at all. So my current page I have not implemented this part of the code in includes/classes/observers/class.attributes_grid_products.php.

As a result meaning:

A.) This page using PAG displays : http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=56&products_id=61
1. Attribute grid qty boxes correctly
2. Listing items correctly
3. DOES NOT display 'Add to Cart' button correctly.

B.) This page using PAG displays with ONLY ONE item: http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=59&products_id=71
1. Attribute grid qty boxes correctly
2. Listing items correctly
3. DOES NOT display 'Add to Cart' button correctly.

C.) This page NOT using PAG displays : http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=53&products_id=56
1. No attributes used
2. Listing items correctly
3. DOES display 'Add to Cart' button correctly.

I have included my current two files (zipped) used on the site.
class.attributes_grid_products.php
tpl_product_info_display.php

My only issue is the #3 state in above examples.
A.) 'Add to Cart' button shows as an grey color image without hover over. > Not the desired look/style
B.) 'Add to Cart' button shows as an grey color image without hover over. > Not the desired look/style
C.) 'Add to Cart' button shows long CSS styled and when you hover over turns to blue. > Desired look/style

Downunder QLD

4 Nov 2016, 3:02 AM
#493
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Product Attribute Grid

Example A & B - Add to Cart button
<span class="fright">

Example C - Add to Cart button
<span class="buttonRow">

It would seem you need to change the Class for buttons A & B

The learning is in the doing.

Potent Products

4 Nov 2016, 3:12 AM
#494
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Product Attribute Grid

Sorry, just noticed you are only concerned with mouseover state.

Example A & B - Add to Cart
these are using JavaScript to determine mouseover state which doesn't seem to do anything.

Whereas Example C is using CSS.

<input class="btn btn-success" value="Add to Cart" type="submit">

stylesheet_custom.css #12715
.btn btn-success:hover
background: #16b8e2;
border-color: #1292b3;

The learning is in the doing.

Potent Products

4 Nov 2016, 4:58 AM
#495
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Thanks you lead me to trhe right direction.

You can see this is close as I have so far at http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=56&products_id=61

I had to change:

'<span class="fright">'.zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT).'</span>';

to - remove BUTTON_IMAGE_IN_CART and add span class="btn btn-success buttonRow

'<span class="btn btn-success buttonRow">'.zen_image_submit('', BUTTON_IN_CART_ALT).'</span>';

It is almost there.

  1. I need to remove the inner border
  2. Make button spread accross (full width)

Downunder QLD

4 Nov 2016, 5:13 AM
#496
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product Attribute Grid

Here's what I did with the files. Apparently the line numbers provided earlier may have been wrong because changes were made to the incorrect area. Also included are the changes I made related to the integer values I was discussing earlier. The class file does contain the change you said you couldn't apply. Did you undo the change(s) you made to includes/modules/qbrands/attributes.php?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Nov 2016, 6:10 AM
#497
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

No I did not undo my changes on the includes/modules/qbrands/attributes.php

==part of the changes to the file is below======================

// READONLY
case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_READONLY):
$options_name[] = $products_options_names->fields['products_options_name'];
$options_html_id[] = 'ro-attrib-' . $products_options_names->fields['products_options_id'];
$options_menu[] = $tmp_html . "\n";
$options_comment[] = $products_options_names->fields['products_options_comment'];
$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
break;
// OAVS removed to avoid displaying Attribut Grid to display option selection without QTY box
// dropdown menu auto switch to selected radio button display
//case ($products_options->RecordCount() == 1):
//if ($show_attributes_qty_prices_icon == 'true') {
// $options_name[] = '<label class="switchedLabel ONE" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . ATTRIBUTES_QTY_PRICE_SYMBOL . $products_options_names->fields['products_options_name'] . '</label>';
//} /else {
//$options_name[] = $products_options_names->fields['products_options_name'];
//}
//$options_html_id[] = 'drprad-attrib-' . $products_options_names->fields['products_options_id'];
//$options_menu[] = zen_draw_radio_field('id[' . $products_options_names->fields['products_options_id'] . ']', $products_options_value_id, 'selected', 'id="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '"') . '<label class="attribsRadioButton" for="' . 'attrib-' . $products_options_names->fields['products_options_id'] . '-' . $products_options_value_id . '">' . $products_options_details . '</label>' . "\n";
//$options_comment[] = $products_options_names->fields['products_options_comment'];
//$options_comment_position[] = ($products_options_names->fields['products_options_comment_position'] == '1' ? '1' : '0');
//break;

              // previously this was default:
              case ($products_options_names->fields['products_options_type'] == PRODUCTS_OPTIONS_TYPE_SELECT):
              // normal dropdown "SELECT LIST" menu display
              if (isset($_SESSION['cart']->contents[$prod_id]['attributes'][$products_options_names->fields['products_options_id']])) {
                $selected_attribute = $_SESSION['cart']->contents[$prod_id]['attributes'][$products_options_names->fields['products_options_id']];
              } else {
                // use customer-selected values
                if ($_POST['id'] !='') {
                  reset($_POST['id']);
                  foreach ($_POST['id'] as $key => $value) {
                    if ($key == $products_options_names->fields['products_options_id']) {
                      $selected_attribute = $value;
                      break;
                    }
                  }
                } else {
                // use default selected set above
                }
              }

Downunder QLD

4 Nov 2016, 6:19 AM
#498
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Ok

Button Css works great now.

Only problem which was fixed before by you is when there is single attribute grid option, option row and qty field is not showing.

Downunder QLD

4 Nov 2016, 1:37 PM
#499
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Product Attribute Grid

oavs:

Ok

Button Css works great now.

Only problem which was fixed before by you is when there is single attribute grid option, option row and qty field is not showing.

Need to undo the change to the attributes.php file. Also did you use the revised class.attributes_grid_products.php file I included in the zip file? It's what I have on my development server that worked in all conditions of:
1 option name with one option value.
1 option name with multiple option values.
2 option names each with one option value.
2 option names 1 with one option value the other multiple
The one just above with the sort order reversed to force the opposing sequence
A third option name used with 2 option names each with one option value such that the sort order of the third was less than the first, between the first and second and afterwords that only had one option value to see if it would still display or get removed. With the code changes provided it worked as should be expected.

When I reviewed the provided modified version of the class file there were changes made to the wrong section at least in one case and the change did not have an effect on the presence or absence of an option value but instead on how many columns would be displayed. It may be that the tested product has a combination that didn't get operated upon because the code wasn't correct.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

5 Nov 2016, 1:07 AM
#500
oavs avatar

oavs

Totally Zenned

Join Date:
Jan 2006
Location:
Downunder - QLD - Gold Coast
Posts:
921
Plugin Contributions:
0

Re: Product Attribute Grid

Hi,

undo the change to the attributes.php file fixed the problem.
I couln't be happier :-)

Many many thanks for your time

Cheers

Downunder QLD