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 201 to 220 of 546
1 May 2010, 1:10 PM
#201
xshaanx avatar

xshaanx

New Zenner

Join Date:
Apr 2010
Posts:
52
Plugin Contributions:
0

Product Attribute Grid

<?php switch($_GET['action']) { case 'add_product': if (is_array($_POST['products_id'])) { foreach($_POST['products_id'] as $prid => $qty) { $products_id = zen_get_prid($prid); if (is_array($_POST['id'])) { foreach($_POST['id'] as $option => $option_value) { $_POST['attribs'][$prid][$option] = $option_value; } } foreach($_POST['attribs'][$prid] as $option_id => $value_id) { if (substr($option_id, 0, strlen(TEXT_PREFIX)) == TEXT_PREFIX) { $option_id = substr($option_id, strlen(TEXT_PREFIX)); } $check_attrib = $db->Execute( "select pov.products_options_values_name from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov " . "where pa.options_values_id = pov.products_options_values_id " . "and pa.options_id = '".(int)$option_id . "' " . "and pa.products_id = '".(int)$products_id ."' " . "and pov.language_id = '".(int)$_SESSION['languages_id']."'"); if ($check_attrib->RecordCount() <= 1 && $check_attrib->fields['products_options_values_name'] == '') { unset($_POST['attribs'][$prid][$option_id]); } } if ((int)$qty > 0) { reset($_POST['attribs'][$prid]); $_SESSION['cart']->add_cart($products_id, $qty, $_POST['attribs'][$prid]); } } } $messageStack->reset(); unset($_SESSION['cart_errors']); $_SESSION['cart']->get_products(false); //Update all prices now we have added everything break; } ?>

that's the code

25 May 2010, 4:54 AM
#202
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Product Attribute Grid

Hello,

Thank you for a great module! It is very close to what I need... but just want a slight added functionality - maybe it is built into this mod and I don't know about it yet? :)

Here's a screenshot what I'm looking for. I want a combo dropdown and quantity box - so that I dont have quantity for every Option Value, but rather one for each Option Name.

Is it doable?

Jackie Taferner - JT Website Design
Custom Website Design and Ecommerce
Support the community. Don't Private Message, post your questions in the forum.

25 May 2010, 9:37 AM
#203
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Product Attribute Grid

It looks like you want to have 2 different products on the same page. One for the top, and one for the bottom. This isn't possible with this mondule, and you would also struggle to achieve this with custom Zen code, as the number of attributes has to match the number of products. For example, if you have red/green/blue and S/M/L, you can have 5 S red, or 3 M green, but you can't have 5 red and 3 green, as the attributes are tied together.

What you are look at doing is more along the lines of a different end category layout, where the category is the outfit, with one image. The products in this category are then the products you can see in the photo, and then showing the attribute options within this layout. This is possible, but outside the scope of this particular module.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

25 May 2010, 3:11 PM
#204
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Product Attribute Grid

Well, I'm utilizing the Top and Bottom as attributes. There's only going to be sizes, not colors here.

Attribute Top:
XS - S - M - L

Attribute Bottom:
XS - S - M - L

I already have what I need all setup in attributes, and your module almost gets what I need - but to have it more aesthetically pleasing I do not want it all in quantity boxes, just a simple dropdown and one quantity box per attribute.

I'm sure it's possible with this module, I was just wondering if you had a shortcut way to do it, or if I need to custom code.

Jackie Taferner - JT Website Design
Custom Website Design and Ecommerce
Support the community. Don't Private Message, post your questions in the forum.

25 May 2010, 7:13 PM
#205
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Product Attribute Grid

Oh... I'm seeing where the issue is here. This module actually cross-grids the two attributes together, instead of keeping them separate.

Well, back to the drawing board - but if you have any suggestions, please let me know :)

Jackie Taferner - JT Website Design
Custom Website Design and Ecommerce
Support the community. Don't Private Message, post your questions in the forum.

27 May 2010, 11:02 AM
#206
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Product Attribute Grid

The problem with what you are trying to achieve here is that actually you have 2 products - TOP and BOTTOM, and these then have a single attribute of SIZE for each product. For example, if a top is $5.00 and a bottom is $10.00, there is nothing to stop me from ordering 10 tops and 1 bottom. As you are trying to combine these products into one attriubte, the system would then add 10 "products" to the cart, and only assign one bottom price. This is going to land you in all kinds of trouble in the future if you ever try to install other modules, or upgrade your site.

Instead, I would recommend you thing about using the "outfit category" which I mentioned above. So, the customer would navigate to Clothing >> Womens >> Gym Wear >> Outfit, where they would then see the top and bottom, and even trainers and accessories listed with one image to the left. If they wanted to examine the products individually, they can then go on to the product page, but here they would see the whole outfit, and be able to add the products and sizes they needed.

This is still a fair amount of work, and not a quick fix, but it would allow you much greater flexibility within your store in the future, such as being able to use cross-sell items, similar items or other "outfits".

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

27 May 2010, 11:08 AM
#207
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Product Attribute Grid

The problem with what you are trying to achieve here is that actually you have 2 products - TOP and BOTTOM, and these then have a single attribute of SIZE for each product. For example, if a top is $5.00 and a bottom is $10.00, there is nothing to stop me from ordering 10 tops and 1 bottom. As you are trying to combine these products into one attriubte, the system would then add 10 "products" to the cart, and only assign one bottom price. This is going to land you in all kinds of trouble in the future if you ever try to install other modules, or upgrade your site.

Instead, I would recommend you thing about using the "outfit category" which I mentioned above. So, the customer would navigate to Clothing >> Womens >> Gym Wear >> Outfit, where they would then see the top and bottom, and even trainers and accessories listed with one image to the left. If they wanted to examine the products individually, they can then go on to the product page, but here they would see the whole outfit, and be able to add the products and sizes they needed.

This is still a fair amount of work, and not a quick fix, but it would allow you much greater flexibility within your store in the future, such as being able to use cross-sell items, similar items or other "outfits".

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

27 May 2010, 3:53 PM
#208
jackie_taferner avatar

jackie_taferner

Totally Zenned

Join Date:
Jun 2009
Location:
Orange County, California
Posts:
547
Plugin Contributions:
3

Re: Product Attribute Grid

Unfortunately though, the Cross-sell module will not sell on a category level, and also Google Shopping shows individual products.

My client would want the top and bottom to show as one piece in advertisements, and bring the client to the one product page, while still allowing them to select both the top and bottom at their whim.

Jackie Taferner - JT Website Design
Custom Website Design and Ecommerce
Support the community. Don't Private Message, post your questions in the forum.

30 May 2010, 3:00 PM
#209
theaymen avatar

theaymen

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Re: Product Attribute Grid

i have downloaded attribute grid 1.1.1

i have 4 files but i believe i only copy 3 folders inot my root files.
is this true, if so can you tell me what the "language folder is for?

i have noticed that there are no instructions on how to use the feature. does anyone know a good site where their is help with this.

Also does anyone have any working links to a store with an attributes grid, as i have no idea what the end result would look like.

i have two examples of what i am hoping for it to look like, please take a look and tell me if it is possible to achieve this with the attributes grid or do i need some thing else:

http://www.diamondbladedealer.com/co...bb540f85326646

http://www.homelinen.co.uk/homelinen...unt_150210.htm

these two types of different, listed product descriptions, with color (dropdown) and QTY is what i am looking for. is this what the attribute grid addon is for or is there another way?

thank you once again you lot are great

30 May 2010, 3:26 PM
#210
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

theAymen:

Also does anyone have any working links to a store with an attributes grid, as i have no idea what the end result would look like.If you are willing to do a little research through this support thread, there are examples posted by other members..

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 May 2010, 7:00 PM
#211
theaymen avatar

theaymen

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Re: Product Attribute Grid

thank you kim, i have been through all the posts i just have two questions.

  1. to be able to list, different product descriptions with the price - do i need this addon or can i do it another way. as i beliee this addon is for multiple attributes, does this mean it is for listing multiple prices

  2. this is what i am looking for, im sure i do not need this addon for listing different sizes/descriptions like this person has

http://www.diamondbladedealer.com/concretebladesstandardconcreteblades-c-3_14.html?zenid=598207bb24b29dea7bbb540f85326646

if there is another way, please someone help!

1 Jun 2010, 6:13 AM
#212
mihaw avatar

mihaw

New Zenner

Join Date:
Jun 2010
Posts:
1
Plugin Contributions:
0

Re: Product Attribute Grid

Please help, How can make like this:

http://www.pokerdiscount.net/poker-chips-1/10-0-gram-30/soprano-10g-clay-striped-casino-chip-9-color-choices-1704.html

How to modify this code to get the result like above :(

$grh_size = sizeof($grid_records['H']['options']);
  $grv_size = sizeof($grid_records['V']['options']);  
  if (($grh_size > 1) || zen_not_null($grid_records['H']['options'][0]['name'])) {
	$top_rowspan = 2;
  } else {
	$top_rowspan = 1;
  }
  if (($grv_size > 1) || zen_not_null($grid_records['V']['options'][0]['name'])) {
	$top_colspan = 2;
  } else {
	$top_colspan = 1;
  }
  $attrib_grid = '<table id="attrib-grid-table">'."\n" . 
  				 '<tr>'."\n".
				 '  <td colspan="'.$top_colspan.'" rowspan="'.$top_rowspan.'"></td>'.
				   '<td colspan="'.sizeof($grid_records['H']['options']).'" id="attrib-grid-opt-nameH">'.$grid_records['H']['name'].(zen_not_null($grid_records['H']['comment']) ? '<br /><span id="attrib-grid-opt-commentH">'.$grid_records['H']['comment'].'</span>' : '').'</td>'."\n".
				 '</tr>'."\n".
				 '<tr>'."\n";
  for($grh=0; $grh < $grh_size; $grh++) {
	if (($grh_size > 1) || zen_not_null($grid_records['H']['options'][$grh]['name'])) {
	  $attrib_grid .= '<td class="attrib-grid-hHeader" id="attrib-grid-hHeader-'.$grid_records['H']['options'][$grh]['id'].'">'.$grid_records['H']['options'][$grh]['name']. ($grid_records['H']['options'][$grh]['price'] != 0 ? '<br /><span class="attrib-grid-header-price">'.$grid_records['H']['options'][$grh]['price_prefix'].$currencies->format($grid_records['H']['options'][$grh]['price']).'</span>' : '').'</td>';
    }
  }
  $attrib_grid .= '</tr>'."\n";
  for($grv=0; $grv < $grv_size; $grv++) {
	$attrib_grid .= '<tr>'."\n";
	if ($grv == 0) {
	  $attrib_grid .= '  <td rowspan="'.$grv_size.'" id="attrib-grid-opt-nameV">'.$grid_records['V']['name'].(zen_not_null($grid_records['H']['comment']) ? '<br /><span id="attrib-grid-opt-commentV">'.$grid_records['V']['comment'].'</span>' : '').'</td>'."\n";
	}
	if (($grv_size > 1) || zen_not_null($grid_records['V']['options'][$grv]['name'])) {
	  $attrib_grid .= '  <td class="attrib-grid-vHeader" id="attrib-grid-vHeader-'.$grid_records['V']['options'][$grv]['id'].'">'.$grid_records['V']['options'][$grv]['name']. ($grid_records['V']['options'][$grv]['price'] != 0 ? '<br /><span class="attrib-grid-header-price">'.$grid_records['V']['options'][$grv]['price_prefix'].$currencies->format($grid_records['V']['options'][$grv]['price']).'</span>' : '').'</td>'."\n";
	}

	$attribute_stock_controlled = (defined('TABLE_PRODUCTS_WITH_ATTRIBUTES_STOCK') && $show_only_grid);
	$show_attribute_stock = ($attribute_stock_controlled && zen_get_show_product_switch($_GET['products_id'], 'quantity') == 1);
	$show_attribute_out_of_stock = ($attribute_stock_controlled && SHOW_PRODUCTS_SOLD_OUT_IMAGE == '1');

	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);
	  $attribute_stock = 'notset';
	  if ($attribute_stock_controlled && ($show_attribute_out_of_stock || $show_attribute_stock)) {
	    $out_of_stock_button = zen_image_button('attribute_out_of_stock.gif', ALT_ATTRIBUTE_GRID_OUT_OF_STOCK);
		$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'];
		$attribute_stock = zen_get_products_stock($_GET['products_id'], $stock_check_array);
	  }
	  $attrib_grid .= '<td class="attrib-grid-cell" id="attrib-grid-cell-'.$grid_records['H']['options'][$grh]['id'].'-'.$grid_records['V']['options'][$grv]['id'].'">';
	  switch(true) {
		case ($show_attribute_out_of_stock && (int)$attribute_stock < 1):
		  $attrib_grid .=	$out_of_stock_button;
		break;
	    default:
		  $attrib_grid .=	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']);
		  if ($show_attribute_stock == true) {
			$attrib_grid .= '<div class="attrb-stock">'.sprintf(TEXT_ATTRIBUTE_GRID_IN_STOCK, $attribute_stock).'</div>';
		  }
		break;
	  }
	  $attrib_grid .= '</td>';
	}
	if ($grid_records['V']['images'] == true) {
	  $attrib_grid .= '<td class="attrib-grid-vImages" id="attrib-grid-vImages-'.$grid_records['V']['options'][$grv]['id'].'">';
	  if (zen_not_null($grid_records['V']['options'][$grv]['image'])) {
		$attrib_grid .= zen_image(DIR_WS_IMAGES . $grid_records['V']['options'][$grv]['image']);
	  }
	  $attrib_grid .= '</td>';
	}
	$attrib_grid .= '</tr>'."\n";
  }
  if ($grid_records['H']['images'] == true) {
	$attrib_grid .= '<tr>'."\n" . 
	  				'  <td colspan="2"></td>';
	for($grh=0; $grh < $grh_size; $grh++) {
	  $attrib_grid .= '<td class="attrib-grid-hImages" id="attrib-grid-hImages-'.$grid_records['H']['options'][$grh]['id'].'">';
	  if (zen_not_null($grid_records['H']['options'][$grh]['image'])) {
		$attrib_grid .= zen_image(DIR_WS_IMAGES . $grid_records['H']['options'][$grh]['image']);
	  }
	  $attrib_grid .= '</td>';
	}	
	if ($grid_records['V']['images'] == true) {
	  $attrib_grid .= '  <td></td>';
	}
	$attrib_grid .= '</tr>';
  }
  $attrib_grid .= '</table>'."\n";
1 Jun 2010, 1:02 PM
#213
magnaromagna avatar

magnaromagna

New Zenner

Join Date:
May 2010
Posts:
14
Plugin Contributions:
0

Re: Product Attribute Grid

Hello,
I have a problem in installin it. I renamed the folder YOUR_TEMPLATE to the name of my actual template (darkness), then I uploaded all files. I navigated into the public shop, and the logged into admin, but the module seems not installed.

Anyone could help me? I tried to search but not very familiar with english lang.
Thank you in advance

1 Jun 2010, 6:45 PM
#214
funkypapa avatar

funkypapa

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: Product Attribute Grid

Hi, I'm using this addon with version 1.3.8a. I have installed this addon on to my live site along with the stock by attributes mod. It works wonderfully. However, I have started on my local machine to change the template and a few other things. In re-adding these modules back in to the new template, when you add some of my products to the cart it's coming up as out of stock.

I added the products to the catalog with current stock.
I assigned them attributes.
I went to the attribute manager and added each stock per attribute.

I'm at a loss as to why only 2 out of the 5 products I have there so far are coming up as out of stock in the shopping cart. I have deleted the products and re-added them thinking I may have done something wrong, but this did not fix it. I then deleted the attribute variants and checked....you can add it to the cart fine. However when I reassign the variants...I get the out of stock warning again. There are 3 in stock: 1 petite, 1 regular, 1 long.

I've tried some searching but my search terms turn up way too many results to sift through. Any help with this would be greatly appreciated.

Edit:
I think this has something to do with only using one set of attributes such as only Size. I followed this from the read me

- If you wish to use this module with single attributes, where all options are listed with a Quantity box next to them, set up an attribute called Quantity, which is a Radio type option. Next setup one option value, which has no text defined, so it is just a completely blank value. When you add this to the product, along with another Radio or Dropdown field, it will default to the GRID format. To ensure that the Quanity is always at the top of the grid, set the sort order for this option to -9999.

I double checked and as far as I can tell I have done this correctly. The reason I think it has to do with this is that the 2 out of 5 products I'm having an error on in the cart, have only one set of attrbutes. Product A is 6 different colors, and Product B is 3 different sizes.

2 Jun 2010, 12:57 PM
#215
theaymen avatar

theaymen

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Re: Product Attribute Grid

@magnomora- mate i have the same issue, i dont know where those instructions have come from, im using the same as you. in the readme file it clearly says to simply take out the files and put them into the same folders (where it says "your_template" means you put that file in the folder which has your template name") in your sites file manager. that is what i did yesterday.

now i have a question, as there are no instructions on how to use it, i found some but what i need is to have the following:

description: price QTY color

single duvet 198x98 £29.99 [ ] [dropdown]
double duvet 298x192 £39.99 [ ] [dropdown]

does anyone know any good tutorials or help sites. please forward the link. thanks ppl!

2 Jun 2010, 2:42 PM
#216
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Product Attribute Grid

@theyAmen - the page you have linked to on that site is a CATEGORY PRODUCT LISTING page, and not a PRODUCT PAGE. Each of those items is an individual product, not an attribute.

@mihaw - no idea what you are asking I'm afraid. Can you be more specific?

@magnaromagna - did you view a PRODUCT within the STORE? Only when you have visited a product page, will this module auto-install.

@FunkyPapa - with regard the stock issue, you may want to check that the Stock by Attributes function file edits are still in place. This module doesn't include any stock checking functions itself, but relies entirely on the Stock by Attribute module and the edits which are included within this module to display the In Stock messages.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

2 Jun 2010, 5:28 PM
#217
theaymen avatar

theaymen

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Re: Product Attribute Grid

sorry absolute this is the right link, please look at the grid

http://www.homelinen.co.uk/homelinen/Bedlinen/Egyptian-Cotton/Egyptian-Cotton-Bedding-200-Thread-Count_150210.htm

this is what i want it to look like, the other link i posted was not the right one.

i seem to only get one COLOR box, though the attributes are ok, the add to cart needs to be moved to the bottom of page
my site looks like this

http://realpurecotton.com/index.php?main_page=product_info&cPath=1&products_id=3

thanks ppl. even though it seems like absolute is the true daddy here!

3 Jun 2010, 12:14 PM
#218
funkypapa avatar

funkypapa

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: Product Attribute Grid

I have this working great now. I have the input boxes centered, the size choices centered and the color choices centered.

I do have 3 questions that I hope are easy fixes, I simply don't know where to make the changes.

Please see the attached image for specific details. Thank you

Attachment #7623

3 Jun 2010, 12:18 PM
#219
funkypapa avatar

funkypapa

New Zenner

Join Date:
Jul 2008
Posts:
84
Plugin Contributions:
0

Re: Product Attribute Grid

I have this working great now. I have the input boxes centered, the size choices centered and the color choices centered.

I do have 3 questions that I hope are easy fixes, I simply don't know where to make the changes.

I did try adding padding into :

.attrib-grid-cell {text-align:center;vertical-align: center;}
.attrib-grid-vHeader {text-align:center;vertical-align: center;}
.attrib-grid-hHeader {text-align:center;vertical-align: center;}
.attrib-grid-opt-nameH {text-align:center;vertical-align: center;}

But if this is the place, then I'm just not inputting it right. I apologize for my lack of specifics with PHP.

Please see the attached image for specific details. Thank you

Attachment #7623

I also apologize for my edit causing a double post :(

4 Jun 2010, 3:31 AM
#220
theaymen avatar

theaymen

New Zenner

Join Date:
May 2010
Posts:
32
Plugin Contributions:
0

Re: Product Attribute Grid

ok, i have managed to make it work! great addon.

though when you add your 2nd attribute to the grid (color), the word "quantity" disappears.

i want to keep it how it is, with the word "quantity" box next to my sizes, but i would like to add a dropdown box for my colors next to the QTY box.

"SIZE" "QTY" "COLOR" [dropdown]

heres what im working with:

http://realpurecotton.com/index.php?main_page=product_info&cPath=1&products_id=3&number_of_uploads=0

as ypu can see i only got 1 dropdown box, but i want one for each attribute.
i have seen a post of someone that has done this but i cannot find it anymore. IF SOMEONE KNOWS HOW TO DEAL WITH THIS PLS HOLLA