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 461 to 480 of 546
14 Apr 2016, 9:19 PM
#461
mc12345678 avatar

mc12345678

Totally Zenned

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

Product Attribute Grid

Dream9Studios:

Yes, it's there and in the correctly named folder. I even tried re-uploading it (just in case it was corrupted during transfer) just now and tried again to load the product page, etc. I'm still getting nothing.
Well, to get over the first hump and possibly see if the rest of the software works (assuming that the includes/classes/observers file is loaded), I have a slightly odd request because I do not have immediate access to the fileset.

Could you please post the code that is in the observers function: updateNotifyAttributesModuleStartOption?

It should contain a check for a constant like if(!defined('PRODUCTS_TYPE_OPTION_GRID'))
Or similar. Before pasting the code please press the # symbol in the message box toolbar.

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

14 Apr 2016, 9:26 PM
#462
dream9studios avatar

dream9studios

New Zenner

Join Date:
Sep 2012
Location:
Illinois
Posts:
24
Plugin Contributions:
0

Re: Product Attribute Grid

I don't see updateNotifyAttributesModuleStartOption? but I do see updateNotifyAttributesModuleStartOptionsLoop
Is that what you mean? I'll post the code from it below.

function updateNotifyAttributesModuleStartOptionsLoop(&$callingClass, $notifier, $i, &$products_options_fields){
    global $db, $options_menu_images, $products_options_array, $products_options_names,
           $PWA_STOCK_QTY;

    $this->_products_options_names_current++;

    if ($this->_products_options_names_current == 1) {
      global $currencies;

      $show_attribute_stock_left = true;

      /****************************************************
      /* Absolute-Solutions.co.uk Edit
      /*
      /* Attributes Grid format
      /* 1 of 2
      /****************************************************/
// PRODUCTS_OPTIONS_TYPE_GRID is the ID for the GRID option
      if (!defined('PRODUCTS_OPTIONS_TYPE_GRID')) {// || !defined('CONFIG_ATTRIBUTE_OPTION_GRID_INSTALLED') || CONFIG_ATTRIBUTE_OPTION_GRID_INSTALLED != 'true') {
        $products_options_types_name = 'Grid';

        /*if (!defined('PRODUCTS_OPTIONS_TYPE_GRID'))*/ {

          $sql = "SELECT products_options_types_name, products_options_types_id FROM " . TABLE_PRODUCTS_OPTIONS_TYPES . " WHERE 
            products_options_types_name = :products_options_types_name: AND products_options_types_name != '';";
          $sql = $db->bindVars($sql, ':products_options_types_name:', $products_options_types_name, 'string');
          $result = $db->Execute($sql);

          if ($result !== false && $result->RecordCount() > 0) {
            // Is found, reassign $resultGID to found value.
            $resultGID = $result->fields['products_options_types_id'];
          } else {
            $sql = "SELECT pot.products_options_types_id, pot.products_options_types_name
          FROM ".TABLE_PRODUCTS_OPTIONS_TYPES." pot	
          order by pot.products_options_types_id desc limit 1";
            $result = $db->Execute($sql);

            $resultGID = $result->fields['products_options_types_id'] + 1;

            $sql = "INSERT INTO ".TABLE_PRODUCTS_OPTIONS_TYPES." (`products_options_types_id`, `products_options_types_name`) 
          VALUES (:resultGID:, :products_options_types_name:);";
            $sql = $db->bindVars($sql, ':resultGID:', $resultGID, 'integer');
            $sql = $db->bindVars($sql, ':products_options_types_name:', $products_options_types_name, 'string');

            $result = $db->Execute($sql);
          }

          if( $result !== false /*&& $result->fields['products_options_types_name'] !=  ''*/ ){
// PRODUCT_TYPE_ATTRIBUTE_OPTION_GRID was the "old" version.
            $configuration_title = 'Selection list product option type (Grid)';
            $configuration_key = 'PRODUCTS_OPTIONS_TYPE_GRID';
            $configuration_value = $resultGID;
            $configuration_description = 'Numeric value of the grid product option type used for SBA';
            $configuration_group_id = 6;
            $sort_order = 0;
            $last_modified = 'NULL';
            $date_added = 'now()';
            $use_function = 'NULL';
            $set_function = 'NULL';


            $sql = "INSERT INTO " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value,
      configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)
        
      VALUES
      (:configuration_title:, :configuration_key:, :configuration_value:, 
        :configuration_description:,
        :configuration_group_id:, :sort_order:, :last_modified:, :date_added:, :use_function:, :set_function:);";
            $sql = $db->bindVars($sql, ':configuration_title:', $configuration_title, 'string');
            $sql = $db->bindVars($sql, ':configuration_key:', $configuration_key, 'string');
            $sql = $db->bindVars($sql, ':configuration_value:', $configuration_value, 'integer');
            $sql = $db->bindVars($sql, ':configuration_description:', $configuration_description, 'string');
            $sql = $db->bindVars($sql, ':configuration_group_id:', $configuration_group_id, 'integer');
            $sql = $db->bindVars($sql, ':sort_order:', $sort_order, 'integer');
            $sql = $db->bindVars($sql, ':last_modified:', $last_modified, (($last_modified == 'now()' || $last_modified == 'NULL') ? 'noquotestring' : 'string'));
            $sql = $db->bindVars($sql, ':date_added:', $date_added, (($date_added == 'now()' || $date_added == 'NULL') ? 'noquotestring' : 'string'));
            $sql = $db->bindVars($sql, ':use_function:', $use_function, (($use_function == 'now()' || $use_function == 'NULL') ? 'noquotestring' : 'string'));
            $sql = $db->bindVars($sql, ':set_function:', $set_function, (($set_function == 'now()' || $set_function == 'NULL') ? 'noquotestring' : 'string'));

            $db->Execute($sql);
          }
          define('PRODUCTS_OPTIONS_TYPE_GRID', $resultGID);
        }
      }
14 Apr 2016, 9:33 PM
#463
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Product Attribute Grid

Thank you, yes that is the function in question. Now while I write out the sql code to get started, could you goto your option names manager, then view the html source code. Search for an option name type not currently used on screen, such as radio or file, should end up at a section that contains <options value="x" where x is a number. Please identify the largest number for the option values= that are present.

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

14 Apr 2016, 9:39 PM
#464
dream9studios avatar

dream9studios

New Zenner

Join Date:
Sep 2012
Location:
Illinois
Posts:
24
Plugin Contributions:
0

Re: Product Attribute Grid

Whoa, it just started working. I'm not quite sure what happened. There must have been a problem with my browser? To answer your question, the highest option value number was "5" for "read-only" but then I reloaded the html source code and "6" for "Grid" popped up. I'm using the latest version of Google Chrome. There must have been a browser cache error somewhere.

Thank you for your assistance. I appreciate it!

14 Apr 2016, 9:59 PM
#465
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Product Attribute Grid

Well glad it worked, but below is the SQL that would have added the option type to the store given the information provided. Sql to be pasted in tools->install sql patches. But unnecessary now that the option appears.

INSERT INTO products_options_types  (`products_options_types_id`, `products_options_types_name`) 
          VALUES (6, 'Grid');

 
INSERT INTO configuration (configuration_title, configuration_key, configuration_value,
      configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function)
        
      VALUES
      ( 'Selection list product option type (Grid)'
, 'PRODUCTS_OPTIONS_TYPE_GRID', 6, 
        'Numeric value of the grid product option type used for SBA',
        6, 0, NULL, NOW(), NULL, NULL);

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

16 Apr 2016, 2:18 PM
#466
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product Attribute Grid

Working with Zen Cart v1.5.4.

I'm sure this is something simple.. I just upgraded SBA (https://github.com/mc12345678/Stock_By_Attributes_Combined) and the latest version of this module.. On the product pages, the only attributes which render or display are the file selection type of attributes. No other attribute types render or display. What should I be looking for to correct this?

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

16 Apr 2016, 9:30 PM
#467
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Product Attribute Grid

While the install process of ZC 1.5.5 addresses/corrects the dropdown condition (removal of the infamous three values that were previously stored in gID=0 (and potentially erased by incorrectly formatted SQL statements) but have been moved to gID=6).

The instruction at the following link ought to resolve the issue with the dropdown. Instruction provided above to discover the current value for Grid (seeing as Grid was previously in existence within the store) ought to resolve the display of grid related attributes, although the code ought to have picked up that characteristic upon initial attempt to display a product that had attributes assuming that the existing option name string was that of 'Grid' per the original install of this plugin.

If the SQL above becomes necessary, then in the case(s) where a value of 6 other than for gID are used in the existing store, then they should be substituted with what is discovered by inspection of the option name page's html source code.

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

16 Apr 2016, 9:45 PM
#468
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Product Attribute Grid

Though, now that I see the revised message, would also want to look at any merge done to includes/templates/YOUR_TEMPLATE/templates/tpl_modules_attributes.php. Currently there is the use of the capital letter i ($I) where the original code used $i and incorrectly merging that portion of code could cause a problem as the $i variable is used in the images section of that same template file... I know wasn't a good plan. Works as written, but not merge friendly. Working on a rewrite of that to make the "merge" easier to understand where differences exist/matter.

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

17 Apr 2016, 12:26 AM
#470
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product Attribute Grid

mc12345678:

And thread link I forgot to paste two messages ago: https://www.zen-cart.com/showthread.php?219767-Done-v155-Dropdown-attributes-may-not-appear-after-database-upgrade&p=1306503#post1306503

Long day in the sun, sorry.
Okay.. rolled back for now to move forward.. Gonna take the concierge dog for a walk and go back to this later tonight or tomorrow..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

19 Apr 2016, 2:49 PM
#471
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Product Attribute Grid

DivaVocals:

Okay.. rolled back for now to move forward.. Gonna take the concierge dog for a walk and go back to this later tonight or tomorrow..

Update? Been looking at the code. Identified at least a boundary problem fix (if all option types have been removed from the database), but not sure if there is still a problem with installation onto a cart that had a previous version installed.

In testing after I had a functional product I had deleted the configuration key that is checked to initiate assignment to the existing 'Grid' option type and it was reassigned as expected. That said, the above issue was modified to identify that NO attributes were being displayed rather than just a problem with 'Grid'. That issue is different and not directly related to the initiation process but instead expected to be as stated either the absence of the definition for dropdowns and/or a problem with the tpl_modules_attributes.php file.

Some templates use a different template file to display/manage attributes requiring chasing down the code that does that display.

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

20 Apr 2016, 3:01 AM
#472
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: Product Attribute Grid

mc12345678:

Update? Been looking at the code. Identified at least a boundary problem fix (if all option types have been removed from the database), but not sure if there is still a problem with installation onto a cart that had a previous version installed.

In testing after I had a functional product I had deleted the configuration key that is checked to initiate assignment to the existing 'Grid' option type and it was reassigned as expected. That said, the above issue was modified to identify that NO attributes were being displayed rather than just a problem with 'Grid'. That issue is different and not directly related to the initiation process but instead expected to be as stated either the absence of the definition for dropdowns and/or a problem with the tpl_modules_attributes.php file.

Some templates use a different template file to display/manage attributes requiring chasing down the code that does that display.
No update.. chasing down other gremlins with other custom code that this site has that aren't playing nice with most of the appearance elements on the site.. sigh I haven't even tackled trying the upgrades again.. I can say this, the template doesn't use a different file to display/manage attributes.. I started out with Bare Bones and applied Raymond Barbours responsive framework to it.. so it's pretty much standard Zen Cart overrides..

My Site - Zen Cart & WordPress integration specialist
I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

30 Jul 2016, 4:12 PM
#473
tjalling avatar

tjalling

New Zenner

Join Date:
Jul 2016
Location:
Amsterdam
Posts:
5
Plugin Contributions:
0

Re: Product Attribute Grid

I'm still curious for the answer towards the question concerning displaying the price including tax.
This question is posted several times, but unfortunally still without a solution.
Is there someone who has solved this?

30 Jul 2016, 7:51 PM
#474
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Product Attribute Grid

Tjalling:

I'm still curious for the answer towards the question concerning displaying the price including tax.
This question is posted several times, but unfortunally still without a solution.
Is there someone who has solved this?

I don't have the code open to be able to piece it together, but where the price is collected, it doesn't have any of the typical ZC code to address taxes. I think it is missing almost everything related such as specials, etc...

Looking at how the price is put together in includes/modules/YOUR_TEMPLATE/attributes.php a similar/compressed sequence of the same thing/action. There is already some of that information calculated, but it is used within the attributes.php and if I read through the code properly it sort gets gobbled up early in the processing without a notifier made available to capture before cycling to the next piece of information.

I saw that missing aspect and unless someone else adds it is something I was going to add to the code. Trying to polish off SBA at the moment. Have come a long way with it.

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

21 Oct 2016, 6:25 AM
#475
oavs avatar

oavs

Totally Zenned

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

Re: Product Attribute Grid

Hi

I was wondering if someone please could help me here.

I am using the Product Attribute Grid plugin and works great.

My question is while I am using the plugin it displays individual quantity boxes as well as the standard Quantity field box next to the 'Add to Card' button.

I can hide this unwanted Quantity field box but I also have products do not use Product Attribute Grid plugin.

So questions is what do I need to do in order to display:

  1. Display Product Attribute Grid with individual QTY boxes with 'Add to Cart' Button (as it normally does) without showing the additional standard ZenCart QTY box .
  2. Remove the box where it says 'Starting at:' when using Product Attribute Grid plugin
    Example: http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=64&products_id=48

Also for other products

  1. Display other products not using Attributes with it's own standard ZenCart QTY box with 'Add to Cart' Button only.
    Example: http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=57&products_id=64 (which works here fine)

Downunder QLD

22 Oct 2016, 9:06 AM
#476
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

I was wondering if someone please could help me here.

I am using the Product Attribute Grid plugin and works great.

My question is while I am using the plugin it displays individual quantity boxes as well as the standard Quantity field box next to the 'Add to Card' button.

I can hide this unwanted Quantity field box but I also have products do not use Product Attribute Grid plugin.

So questions is what do I need to do in order to display:

  1. Display Product Attribute Grid with individual QTY boxes with 'Add to Cart' Button (as it normally does) without showing the additional standard ZenCart QTY box .
  2. Remove the box where it says 'Starting at:' when using Product Attribute Grid plugin
    Example: http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=64&products_id=48

Also for other products

  1. Display other products not using Attributes with it's own standard ZenCart QTY box with 'Add to Cart' Button only.
    Example: http://www.qbrands.com.au/qb/index.php?main_page=product_info&cPath=57&products_id=64 (which works here fine)

Basically I need something like this but I am not a coder

if tpl_modules_attributes.php (Product Attribute Grid plugin) exists
Hide ZenCart quantity box but leave 'Add to Cart' button

Downunder QLD

23 Oct 2016, 10:05 PM
#477
oavs avatar

oavs

Totally Zenned

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

Re: Product Attribute Grid

Finally I found the answer !!!

instructions at http://www.zen-cart.com/showthread.p...ox#post1188155

Downunder QLD

23 Oct 2016, 11:46 PM
#479
oavs avatar

oavs

Totally Zenned

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

Re: Product Attribute Grid

gilby:

That link appears to have been corrupted. You will need to post it again

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

Downunder QLD

25 Oct 2016, 4:31 AM
#480
oavs avatar

oavs

Totally Zenned

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

Re: Product Attribute Grid

DannyVarley:

I cant seem to find an answer to my problem, I have changed the store so the products display prices with the tax added. But sadly this doesnt seem to affect the prices on the grid, See here:

http://kitchenwarehouseltd.com/catalog/index.php?main_page=product_info&cPath=1_2&products_id=15

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

Downunder QLD