Re: Product Attribute Grid
After several hours of troubleshooting, I've found this issue!
The latest SQL Injection patch (http://www.zen-cart.com/forum/showthread.php?t=108428) prevents this contribution from passing any data to the cart.
The contribution code probably needs to be re-written or modified to allow for the changes this patch makes.
So, we now know that anyone using this contribution on Zen Cart 1.3.8a is not patched! :blink:
I'll contact one of the Zen Cart team to find out if this is an issue with the contribution or the patch.
Re: Product Attribute Grid
Are you actually using the updated version of the patch posted on Sept 23? The filename still reflects Sept 19, but the content of the file is different. If you're using the Sept 19 version of the file, you're going to have problems.
Re: Product Attribute Grid
k,
I installed the attributes grid contribution on a stock 1.3.8 install with the most up to date Security patch file.
It does in fact stop this contribution from adding items to the cart.
The reason is, that the security patch uses a whitelist of characters that are allowed in the to be keys of the products_id array.
The attribute grid contribution uses extended product ids, as keys and these fail the whitelist test.
The fix is fairly simple.
In the security patch, there is a function called.
securityPatchSanitizePostVariableProductsId
and in this is the line
PHP Code:
if (ereg_replace('[0-9a-zA-z_]', '', $key) != '')
this should be changed to
PHP Code:
if (ereg_replace('[0-9a-zA-z_:]', '', $key) != '')
We will look to release an updated patch (probably this weekend)
Our apologies for the inconvenience, however we took the position that using a whitelist was more secure than relying on a simple blacklist.
Re: Product Attribute Grid
Quote:
Originally Posted by
DrByte
Are you actually using the updated version of the patch posted on Sept 23? The filename still reflects Sept 19, but the content of the file is different. If you're using the Sept 19 version of the file, you're going to have problems.
I was using the updated patch file.
However, wilt's fix above has sorted things. :smile:
Thanks for the fix wilt!
Also, thank you for taking the time to explain how the patch and contribution was conflicting.
Re: Product Attribute Grid
Quote:
Originally Posted by
jacdesigner
Supers have you by chance already tried the additional module for Attributes By Stock? I haven't been using it directly in conjunction with this grid module yet but I believe it will accomplish what your goal of hiding options that are unavailable.
I have the stock by attributes already installed (even prior to this module) and I wanted to know when the developer was going to release his update. He kinda mentioned earlier in the year about the integration of the stock by attributes and the product grid so to enable X in the grid as per his demo site. But the code and the update has never been posted (unless I am so blind that I have missed it).
Does anyone know how to exclude certain attribute combos from the add to cart by placing a x or image in the grid instead of a input box?
Re: Product Attribute Grid
I have installed this great add on.
I do have one question though, is there functionality built into this add on to allow more than two attributes (not a combo box or radio) not included in the grid?
For example, I have a grid of color and size, but I'd like to have a third checkbox not included in the grid.
The way it is now, when you add a third attribute it reverts back to the old style with radio buttons and no grid.
Thanks
Re: Product Attribute Grid
I have installed this great add on and it works great. Thank you very much.
I just want to know how can I remove or change the width of the frame of the grid.
See the link http://www.jojopet.com/swalc0073-p-373.html
the frame or the border of the grid is not nice. Can anyone tell me how to change or remove it? thanks in advance.
Joshua
Re: Product Attribute Grid
rkuel - having a third option outside of the grid isn't an option at present, due to the way in which the module passes the data into the add to cart function, however, with a little tweaking, this would be possible.
In terms of replacing the input boxes with a red cross image or similar, you would need to have "Stock by Attribute" module installed, and then use the following code:
In includes/modules/attributes.php, the FOR statement found around line 136 should be replaced with the following:
Code:
for($grh=0; $grh < $grh_size; $grh++) {
$attributes_ids = array( $grid_records['H']['id'] => $grid_records['H']['options'][$grh]['id'],
$grid_records['V']['id'] => $grid_records['V']['options'][$grv]['id']
);
$products_attribs_id = zen_get_uprid((int)$_GET['products_id'], $attributes_ids);
$stock_check_array = array();
if (zen_not_null($grid_records['H']['options'][$grh]['name'])) $stock_check_array[] = $grid_records['H']['options'][$grh]['id'];
if (zen_not_null($grid_records['V']['options'][$grv]['name'])) $stock_check_array[] = $grid_records['V']['options'][$grv]['id'];
$attrib_grid .= '<td class="attrib-grid-cell" id="attrib-grid-cell-'.$grid_records['H']['options'][$grh]['id'].'-'.$grid_records['V']['options'][$grv]['id'].'">'.
(zen_get_products_stock($_GET['products_id'], $stock_check_array) > 0 ?
zen_draw_input_field('products_id['.$products_attribs_id.']', '', 'size="3"').
zen_draw_hidden_field('attribs['.$products_attribs_id.']['.$grid_records['H']['id'].']', $grid_records['H']['options'][$grh]['id']).
zen_draw_hidden_field('attribs['.$products_attribs_id.']['.$grid_records['V']['id'].']', $grid_records['V']['options'][$grv]['id'])
: zen_image(DIR_WS_IMAGES.'item_out_stock.gif)).
'</td>';
}
Hope this helps.
Absolute
Re: Product Attribute Grid
Hi Absolute,
Here is a link to a product page using the attribute grid -- is there any way for me to have the "Size/Color" title show up at the top like "Quantity" instead of floating in the middle of the column?
BTW, this was the only way I could figure out how to have multiple sizes & colors with a qty box, if there's a better way I'd love to know what it is!
Re: Product Attribute Grid
Char - This whole module is designed as a grid, so along the top, you should have COLOUR, and down the side, you should have SIZE. Then you would end up with a 5 x 2 grid. To set this up, just setup 2 attributes - both RADIO fields. One is the SIZE, and the other is the COLOUR.
The rest is done for you.
As for moving the word SIZE to the top of the box, just add a tag to your stylesheet as follows:
Code:
#tab_attrib-grid-opt-nameV { vertical-align: top; }
That's it!
Absolute