Page 50 of 55 FirstFirst ... 404849505152 ... LastLast
Results 491 to 500 of 544
  1. #491
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Product Attribute Grid

    Quote Originally Posted by oavs View Post
    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:
    Quote Originally Posted by oavs View Post
    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:
    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 ($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.

    Quote Originally Posted by oavs View Post
    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:
    Quote Originally Posted by mc12345678 View Post
    Found it.
    Quote Originally Posted by mc12345678 View Post
    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:
    Code:
              if (($grh_size > 1) && zen_not_null($grid_records['H']['options'][$grh]['name'])) {
    To:
    Code:
              if (($grh_size >= 1) && zen_not_null($grid_records['H']['options'][$grh]['name'])) {
    Line 314 from:
    Code:
              if (($grv_size > 1) && zen_not_null($grid_records['V']['options'][$grv]['name'])) {
    To:
    Code:
              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):
    Code:
      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...

  2. #492
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default 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.p...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.p...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.p...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
    Attached Files Attached Files
    Downunder QLD

  3. #493
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

    Default 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

  4. #494
    Join Date
    Oct 2006
    Location
    Alberta, Canada
    Posts
    4,571
    Plugin Contributions
    1

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

  5. #495
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

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

  6. #496
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default 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?
    Attached Files Attached Files
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  7. #497
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default 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

  8. #498
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default 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

  9. #499
    Join Date
    Jul 2012
    Posts
    16,733
    Plugin Contributions
    17

    Default Re: Product Attribute Grid

    Quote Originally Posted by oavs View Post
    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...

  10. #500
    Join Date
    Jan 2006
    Location
    Downunder - QLD - Gold Coast
    Posts
    964
    Plugin Contributions
    0

    Default 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

 

 
Page 50 of 55 FirstFirst ... 404849505152 ... LastLast

Similar Threads

  1. Product Attribute Grid Help - Willing to Pay
    By MM_Dude in forum General Questions
    Replies: 0
    Last Post: 26 Nov 2014, 08:19 PM
  2. Quick Order & Product Attribute Grid...Possible?
    By laurenjj in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 2 Jul 2010, 02:02 AM
  3. Product Attribute Grid!!!
    By runoka in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 5 Apr 2010, 05:50 PM
  4. Product Attribute Grid Instructions Possible Paragraph Missing
    By printchic in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 8 Aug 2009, 05:54 AM
  5. Help Uninstalling Product Attribute Grid
    By Dr Tweak in forum All Other Contributions/Addons
    Replies: 7
    Last Post: 20 May 2008, 05:01 PM

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