-
Product Attribute Grid
The module is designed to set out attributes within a grid format, when 2 dropdown or radio options are available. For example, if an item has both colour and size. The grid is populated with quantity fields, so that a number of products can be added at any time.
This can be seen on our test store, located at http://www.absolute-solutions.co.uk/...products_id=36
Please feel free to contact me with suggestions or updates for the next release,
Absolute
-
Re: Product Attribute Grid
The module can be downloaded HERE
Absolute
-
Re: Product Attribute Grid
Ok, I've had a few minutes to play with this long awaited module, and have a few questions. But first, I would like to thank you for finally delivering this incredibly useful tool unto us. There are many businesses out there that have not been able to participate in ecommerce, due to the unavailability of such a module.
I could (and will) poke around further when I've got more time, but I figure I should go ahead and post my most obvious questions here to (hopefully) save others time.
- Is there any way to track the stock of each product combination?
- Can we remove individual quantity boxes for unavailable combinations?
- Would it be possible for other attributes (a gift-wrapping check box, for example) to co-exist with a PAG product?
#3 is something that I would really like to see work, as without additional attributes, we are losing a great deal of product customization.
Thanks again,
01011010
-
Re: Product Attribute Grid
Wow,thank you thank you. I have installed, looks great and I agree with 01011010 that the below are very important requirements for the module to work on our store too!
Quote:
Originally Posted by
01011010
- Is there any way to track the stock of each product combination?
- Can we remove individual quantity boxes for unavailable combinations
Don't get me wrong we will put in onto our store straight away, but I am concerned about the unavailable combos and also the stock levels for warehousing. On our Retail store we have stock by attributes which works great but I am not sure how this would work on the current site with this module. But stock by attributes module still doesn't get around the problem of unavailable combos.
But thank you again, it was very easy to install.
-
Re: Product Attribute Grid
Just one more thing, I have minimum for each of my products. At the moment only the products without attributes are displaying the min requirements.
Mind you when I have tried to add less than the required minimum that I have set for the product, everything works as expected. It just would be nice to show the min at the time of adding the item to cart rather than giving an error after they have tried to add less than the min.
Thanks again
-
Re: Product Attribute Grid
Stock levels for attributes is something that will be introduced in the next couple of Zen releases, according to the roadmap of Zen. In the meantime, there is a module in the downloads section which can be installed to accomplish this task.
These two packages can be installed together, and a little piece of code then used to hide or show the attribute boxes, depending on stock levels.
With the minimum order values, this is all handled through the tpl_product_info_display.php alteration. You would need to change the code on this page as follows:
Line 108 - 112
Code:
/****************************************************/
if (zen_not_null($attrib_grid)) {
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
/****************************************************
Change to
Code:
/****************************************************/
if (zen_not_null($attrib_grid)) {
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
$the_button = zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />'.$the_button;
}
/****************************************************
This will then add the minimum qty above the add to cart button.
Absolute
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
Stock levels for attributes is something that will be introduced in the next couple of Zen releases, according to the roadmap of Zen. In the meantime, there is a module in the downloads section which can be installed to accomplish this task.
These two packages can be installed together, and a little piece of code then used to hide or show the attribute boxes, depending on stock levels.
With the minimum order values, this is all handled through the tpl_product_info_display.php alteration. You would need to change the code on this page as follows:
Line 108 - 112
Code:
/****************************************************/
if (zen_not_null($attrib_grid)) {
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
/****************************************************
Change to
Code:
/****************************************************/
if (zen_not_null($attrib_grid)) {
$the_button = zen_image_submit(BUTTON_IMAGE_IN_CART, BUTTON_IN_CART_ALT);
}
if ($products_qty_box_status == 0 or $products_quantity_order_max== 1) {
$the_button = zen_get_products_quantity_min_units_display((int)$_GET['products_id']) . '<br />'.$the_button;
}
/****************************************************
This will then add the minimum qty above the add to cart button.
Absolute
I tried the above code to show the min qty but it is still not showing up for the add to cart for the attribute grid. What am I doing wrong?
On the other note of the stock I have used the Stock by Attby Attributes by Kuroi but I am unsure what little piece of code is need to hide/show the attribute box depending on stock. Can you give me a hint!
-
Re: Product Attribute Grid
Which module is it you have installed? Can you post a link, so I'm looking at the same one?
I'll install it this weekend, and post some code as soon as I have it.
Absolute
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
Which module is it you have installed? Can you post a link, so I'm looking at the same one?
I'll install it this weekend, and post some code as soon as I have it.
Absolute
Absolute,
The module in question is here.
I've been playing with it a bit, and apparently you have to add stock for every single combination, one at a time. This would be boatloads of fun on a product with 70 colors and 9 different sizes (630 combinations), especially if you have extra "customization" attributes like me. Multiplying that out by several hundred products puts us at about, oh, some incredibly-scary-won't-even-fit-on-your-average-handheld-calculator number of combinations... Great.
I've got to figure out some way to easily disable the quantity boxes for specific color/size matrices. If you have any advice, please share... I don't need to track stock, just disable the unavailable size/color combinations. Perhaps I can get the Stock by Attributes people to can reduce the aforementioned combinations by a few digits.
Also, what about PAG/other attribute coexistence? Even just having check boxes and text fields would be immensely useful.
Thanks,
01011010
-
Re: Product Attribute Grid
Zach - no matter which way you look at it, if you have 2 attributes, with 9 of one and 70 of the other, you are going to have to turn on or off 630 combintations! Why not just set up stocks of 1000 or none?
Absolute
-
Re: Product Attribute Grid
Is there a way for this grid to FORCE a customer to enter in at LEAST 1 value?
(I just posted a new thread about regular Attributes needing a way to force a customer to select an option before hitting "buy").
- Brian
-
Re: Product Attribute Grid
Unfortunately, with attributes, there isn't a javascript alert if the customer doesn't enter a value. With standard attributes, if you don't enter a value, the form gets submitted, and the server side script then checks your selection, and if it is not made correctly, the customer gets returned to the page with the error message.
It would be possible with the grid format to include a quick java check to ensure that the total entered into all the boxes was more than 0. I'll include this in the next release.
Absolute
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
Zach - no matter which way you look at it, if you have 2 attributes, with 9 of one and 70 of the other, you are going to have to turn on or off 630 combintations! Why not just set up stocks of 1000 or none?
Absolute
Absolute,
Because I need some way for Zen to identify which combinations don't exist. Unfortunately I cannot set my master product stock to Inf and my few unavailable color/size combination's stock to 0, as SBA appears to completely override the master stock.
I may have to get creative and figure out how to treat each color as a separate product, thereby limiting the grid to sizes only. To accomplish this, the hard part is going to be streamlining everything so that the customer can easily navigate to and through the sub-products. Someone with PHP skills could probably pull it off, but this is another project entirely, so I'll save it for another thread.
Thanks,
01011010
-
Re: Product Attribute Grid
I have installed this module on my zen cart but it does not seem to be working for me.
My zen cart version is 1.3.8.
For the products i am setting them to priced by attributes and making sure the price is $0.00.
Then creating a Quantity radio type attribute option name with a blank option value in title case and lower case, i have tried a Quantity option value as well. Then another radio field attribute, also tried a dropdown and added them to a product. I have tried with the sort of -9999 and a sort of 0 for the quantity without any luck.
I have copied the files from the module download into the correct directories a few times.
I have followed the instructions in the install readme over and over.
Is there a step i am missing?
-
Re: Product Attribute Grid
Can you post a link to your store?
When you view the product, are you just given the standard attribute layout, with radio/dropdowns? Did you place the tpl_product_info_default.php file in your active tempalte directory, or is it currently in a directory called YOUR_TEMPALTE/tempates/?
Absolute
-
Re: Product Attribute Grid
The shop is still in development so not up on the web yet.
I have placed the tpl_product_info_default.php in my active template directory.
-
Re: Product Attribute Grid
You're not missing anything - all the steps to install are included in the readme, and all the files are included, in the correct locations.
Have you also checked that the attrributes.php file in the modules folder is within your active template director?
Absolute
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
Which module is it you have installed? Can you post a link, so I'm looking at the same one?
I'll install it this weekend, and post some code as soon as I have it.
Absolute
I noticed Zach replied to you with the module in question for the stock by attributes. Were you able to work out the code to exclude the qty box for the unavailable attribute combinations? Here is the link again if you need it
http://www.zen-cart.com/index.php?ma...roducts_id=310
Also as in my previous post about the min require showing next to the add to cart; were you able to get that to show on the products with the attribute grid? Because I still can't.
-
Re: Product Attribute Grid
I'll upload the new code tomorrow, and post the edit here.
Absolute
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
I'll upload the new code tomorrow, and post the edit here.
Absolute
Thanks.
On another note was there suppose to be a stylesheet within the module? as it looks like the grid has refernece to class attrib-grid-cell, attrib-grid-vHeader and attrib-grid-hHeader. Is it possible you could add that to you upload? Thanks.
-
Re: Product Attribute Grid
I have installed the updated module and it is now working for me.
Thanks.
-
Re: Product Attribute Grid
How difficult would it be to get this mod working with other attributes? I need at least one attribute (either dropdown or radio) in addition to the grid.
I'm willing to pay for this capability, if it's possible.
Thanks,
01011010
-
Re: Product Attribute Grid
I installed the mod to work to update a style with multiple quantities depending on the color selected. I only have 2 option names - "Color" and "Buy". I's rather not even give "Buy" an option value, but I think it has to have one so I gave it the value "Qty"
As you can see the table adds another cell so that the last color does not have a heading because "Qty" is taking up a cell.
Am I approching this the wrong way or is there a way to have the table without the value word?
-
Re: Product Attribute Grid
@Zach - This module could certainly be altered to allow for more fields, however, you would need to aid a few additional features, like the ability to turn this off on a per attribute basis, as you would need to be able to select which attributes are shown within the grid.
@dreamz - I need to try and re-create your problem today, and I'll release a fix for this in the next release. For the moment, could you swop the sort orders for the attributes and see if that displays properly?
Absolute
-
Re: Product Attribute Grid
I changed sort order and made "Buy" first. You can see the results. It looks better but still a bit out of sorts. I'd love to be able to just have the add qty cells for just the color attributes without my added option "Buy - Qty." Does that make sense?
-
Re: Product Attribute Grid
@dreamz - could you just confirm for me that you have read the README file, and followed the instructions?
From the README:
Quote:
- 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.
Please forgive me if you have done this. The field you called BUY, should be called Quantity, as above. The attribute you have as Qty should be BLANK. This should then remove the top rows.
Please update your attributes accordingly, and I'll take a look.
Absolute
-
Re: Product Attribute Grid
Ah, I didn't see that. Thanks, it worked like a charm!
-
Re: Product Attribute Grid
Quote:
Originally Posted by
supersnow
I noticed Zach replied to you with the module in question for the stock by attributes. Were you able to work out the code to exclude the qty box for the unavailable attribute combinations? Here is the link again if you need it
http://www.zen-cart.com/index.php?ma...roducts_id=310
Also as in my previous post about the min require showing next to the add to cart; were you able to get that to show on the products with the attribute grid? Because I still can't.
Just wanted to know if you had the time to look at the code so to exclude the qty box for the unavailable attribute combinations?
Also my other question regarding the stylesheet for the module - as it looks like the grid has reference to class attrib-grid-cell, attrib-grid-vHeader and attrib-grid-hHeader. Is it possible you could add that to your upload?
Plus I still having trouble with the min quantities not showing with the add to cart section for products that have attributes. I have ended up having to put this information with the product description but it would be nice to have the normal zencart functions to still show with the product grid.
Thanks again for a great module!
-
Re: Product Attribute Grid
Just because Absolute has provided class tags does not mean he has a stylesheet for them. Everyone's would be different anyway - style those classes in your stylesheet however you wish.
-
Re: Product Attribute Grid
Some how I can't get this module to work. I feel like an idiot!
I've added the files in the areas required. (double and triple checked, restarted as well).
But everything is still displaying all the way down. not in a grid :(
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
These two packages can be installed together, and a little piece of code then used to hide or show the attribute boxes, depending on stock levels.
Absolute
Is the other package you were referring to "Stocks by Attribute"? What is the little piece of code?
Also, is there a way to show the available quantity of each attribute? I was able to do that with attribute by stock, but when I added this module, the available quantity isn't showing.
Thanks!
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
The module is designed to set out attributes within a grid format, when 2 dropdown or radio options are available. For example, if an item has both colour and size. The grid is populated with quantity fields, so that a number of products can be added at any time.
This can be seen on our test store, located at
http://www.absolute-solutions.co.uk/...products_id=36
Please feel free to contact me with suggestions or updates for the next release,
Absolute
your test store is broken or is friday (long week for me)
-
Re: Product Attribute Grid
@marcelo63 - the new release will have the stock display as an option. Due to other commitments, I have been unable to package the new version, however, this will be out this week.
@tracib - our test store is exactly that. The test store is used on a daily basis by our developers to build new modules, and as such, we never guarantee the store to be online. The errors you currently see are standard PHP errors which are only displayed when PHP is set to show all error reporting. This error reporting is used to ensure our modules are 100% PHP compliant.
The error reporting will be turned off for the weekend, as no development is scheduled until Monday morning.
Absolute
-
Re: Product Attribute Grid
I see on your demo store you have little x icons in the grid to show items combos that are not available will this new code be in your new release? Or is it just a simple code change that you will have available on the forum at some point?
-
Re: Product Attribute Grid
The demo store is being used to final test the new module. The out of stock icons and stock count is part of this new module and shown on the demo site. With this store, the count is temporarily turned off.
Absolute
-
Re: Product Attribute Grid
First Thanks for this module it is long needed.
I installed it on my test site and setup a test product-
http://diamondbladedealer.com/index....&products_id=4
The grid output is not formated properly for me, has anyone else had this problem?
Thanks in advance for any help
-
Re: Product Attribute Grid
I've got this running on my store, version 1.3.7 and its going to work very well for my needs. Thanks for the great mod!
One wish is that it would pre-fill the quantities with a 0 and enter a quantity of 1 in the default attribute. Or is this something it does and I haven't figured out yet? :)
I'm using pricing by attribute. I have similar versions of a product that are selectable via attributes. I have a demo product with the grid here:
http://www.crimescene.com/store2008/...roducts_id=293
For my purpose, I wonder if it would be possible to add a column to the table which would present a buy button for that product?
An example of this, for the same product refernced above is here:
http://www.forensicssource.com/p-175...ink-foils.aspx
Tom
-
Re: Product Attribute Grid
Hi,
I'm having problems with this contribution running alongside the Stock by Attributes contribution.
I have set the grid up to work with a single attributes like in the instructions. It adds the correct product and quantity to the shopping cart. When the shopping cart is shown, no matter how much stock is set for the attribute, the item is always listed as out of stock :(
If I change the attributes from the grid layout to a normal checkbox layout the shopping cart's stock levels are correctly detected :huh:
-
Re: Product Attribute Grid
Quote:
Originally Posted by
bencart
Hi,
I'm having problems with this contribution running alongside the Stock by Attributes contribution.
I have set the grid up to work with a single attributes like in the instructions. It adds the correct product and quantity to the shopping cart. When the shopping cart is shown, no matter how much stock is set for the attribute, the item is always listed as out of stock :(
If I change the attributes from the grid layout to a normal checkbox layout the shopping cart's stock levels are correctly detected :huh:
Everything is working now thanks :smile:
-
Re: Product Attribute Grid
Quote:
Originally Posted by
bencart
Everything is working now thanks :smile:
Actually it isn't :cry:
When using Product Attribute Grid with Stock by Attributes the shopping cart is telling me the item is out of stock when it isn't out of stock.
If I switch the attributes from a grid layout to a checkbox layout the shopping cart correctly checks the stock level.
Looking at the source of the grid layout shopping cart and the checkbox layout shopping cart, the major difference is the productID, the value is right before the colon (:) but not after it.
-
Re: Product Attribute Grid
Absolute,
When are you coming out with the update - your last post suggested that it would have been a few weeks ago.
-
Re: Product Attribute Grid
First off let me say Zen Cart is one awesome piece of programming!
But now to my question.
I have installed the Product Attribute Grid, and can get it to work with two attributes. What I would like is to have the grid and also single attributes attached to one product.
Is this possible, and what do I need to do?
Thanks in advance!
-
Re: Product Attribute Grid
Is there anyone who can help me with the above question?
I have a product that I would like to use the grid for size quantities, but also single attributes, like color, text, text font etc...
-
Re: Product Attribute Grid
So we have recently moved hosting companies and now the product grid is not working with a min qty even with the mix set to yes. I have tried everything to try to fix this. It works fine on our old host but not on our new. I was trying to get help on a another forum post:
http://www.zen-cart.com/forum/showth...t=87605&page=2
As the attribute combo quantities were not adding correctly to meet the requirement of the min set. As I said in my other forum area this problem is only on our new hosting and I worked out (with a lot of trial and error) that the only thing that is different between the two is the php version that is on the hosts. The old host (which the module and min qty works perfectly) is running php 4.4.8 and the my new host is using 5.2.5.
So maybe something needs to change in this module so that it works on php 5 as a fair number of host are changing and this is going to cause some problems for other store owners like me who needs a min qty or any qty calculations to work.
-
Re: Product Attribute Grid
Hello,
First of all this mod is fantastic!!
I've been trying for quite a while and cannot figure out how to center the attribute text in the grid, put a black border or change the color of the grid header...I would like the color to match my theme. Can someone point me in the right direction...I've been editing stylesheet.css but with no luck.
Thank You,
Tom
http://www.pokerdiscount.net
Example:
http://www.pokerdiscount.net/poker-c...hips-1718.html
-
Re: Product Attribute Grid
Quote:
Originally Posted by
pokerdis
Hello,
First of all this mod is fantastic!!
I've been trying for quite a while and cannot figure out how to center the attribute text in the grid, put a black border or change the color of the grid header...I would like the color to match my theme. Can someone point me in the right direction...I've been editing stylesheet.css but with no luck.
Thank You,
Tom
http://www.pokerdiscount.net
Example:
http://www.pokerdiscount.net/poker-c...hips-1718.html
The deveoper has put into the custom template some stylesheet defintions you will need to add these to your stylesheet and then allocate the required styles that you want. I hope this helps.
-
Re: Product Attribute Grid
I just noticed that the Product Attribute Grid does not hide prices even when 'Customer Shop Status - View Shop and Prices' is set to 'May browse but no prices unless logged in'.
Anyone know of how to hide the prices that display in the attribute grid until logged in?
-
Re: Product Attribute Grid
I think i've narrowed down my experimenting on what needs to be changed to get 'hiding prices until logged in' to work with the Product Attribute Grid. In attributes.php, I think the default code for hiding prices until logged in is this at around line 108:
PHP Code:
if (((CUSTOMERS_APPROVAL == '2' and $_SESSION['customer_id'] == '') or (STORE_STATUS == '1')) or ((CUSTOMERS_APPROVAL_AUTHORIZATION == '1' or CUSTOMERS_APPROVAL_AUTHORIZATION == '2') and $_SESSION['customers_authorization'] == '') or (CUSTOMERS_APPROVAL == '2' and $_SESSION['customers_authorization'] == '2') or (CUSTOMERS_APPROVAL_AUTHORIZATION == '2' and $_SESSION['customers_authorization'] != 0) ) {
$new_attributes_price = '';
$new_options_values_price = 0;
$products_options_display_price = '';
$price_onetime = '';
}
Now, I figured this is the section where the Product Attribute Grid sets up the 'price' variable that displays in the grid at around line 80 of the attribute grid's attributes.php file:
PHP Code:
$grid_records[$rd]['options'][] = array( 'id' => $products_options->fields['products_options_values_id'],
'name' => $products_options->fields['products_options_values_name'],
'price' => $products_options->fields['options_values_price'],
'price_prefix' => $products_options->fields['price_prefix'],
'weight' => $products_options->fields['products_attributes_weight'],
'weight_prefix' => $products_options->fields['products_attributes_weight_prefix'],
'discounted' => $products_options->fields['attributes_discounted'],
'image' => $products_options->fields['attributes_image'],
'base_price' => $products_options->fields['attributes_base_price_included'],
'required' => $products_options->fields['attributes_required'],
'display' => $products_options->fields['display_only']
);
If I comment out the 'price' variable of the array, then it gets rid of the price completely. I'd like the prices to reappear when logged in..
-
Re: Product Attribute Grid
to anyone that cares, i figured out how to get the prices inside the attribute tables to hide when not logged in. In includes/modules/your_template/attributes.php at around line 47:
PHP Code:
if ($check_attributes_fields == true) {
I noticed Absolute added his entire Attribute Grid code (for this .php file, anyways) in this function. So I created a
PHP Code:
if ($_SESSION['customer_id']){
}
function while just inside the $check_attributes_fields statement and enclosed whatever was inside. I then copied that entire code into an else{} statement, but this time commented out this line, around line 88:
PHP Code:
'price' => $products_options->fields['options_values_price'],
Commenting out the 'price' variable in the $grid_records[$rd]['options'][] array gets rid of the prices that display in the grid.
So the basic layout of my coding solution is that if a user is logged in, the attribute grid performs normally. But, if the user is not logged in, then the attribute grid performs with the price display manually disabled through commenting out the 'price' variable.
I'm sure there is a much easier way of getting this done. It feels like there is a quick one line code method of being able to get 'hide prices until logged in' functionality with the attribute grid, but my programming knowledge is limited.
-
Re: Product Attribute Grid
Quote:
Originally Posted by
supersnow
The deveoper has put into the custom template some stylesheet defintions you will need to add these to your stylesheet and then allocate the required styles that you want. I hope this helps.
Snow,
Can you give me a little more specific information if possible on how to do this...I'm really struggling with this. I want to center the attributes text in the table and also change the background color of the table....except the quantity boxes
http://www.pokerdiscount.net/soprano...ices-1704.html
Thanks in advance.
Tom
-
Re: Product Attribute Grid
Quote:
Originally Posted by
pokerdis
Snow,
Can you give me a little more specific information if possible on how to do this...I'm really struggling with this. I want to center the attributes text in the table and also change the background color of the table....
Tom
In your \includes\templates\your_template\css\stylesheet.css, add this code somewhere:
PHP Code:
.attrib-grid-cell {text-align:center;}
.attrib-grid-hHeader {text-align:center;}
.attrib-grid-table {background-color: #cacaca;}
.attrib-grid-cell is for the qty. box alignment
.attrib-grid-hHeader is the text at the top, dunno if you want to align that too.
.attrib-grid-table is the whole table
-
Re: Product Attribute Grid
Quote:
Originally Posted by
HTsean
In your \includes\templates\your_template\css\stylesheet.css, add this code somewhere:
PHP Code:
.attrib-grid-cell {text-align:center;}
.attrib-grid-hHeader {text-align:center;}
.attrib-grid-table {background-color: #cacaca;}
.attrib-grid-cell is for the qty. box alignment
.attrib-grid-hHeader is the text at the top, dunno if you want to align that too.
.attrib-grid-table is the whole table
HTSean,
Thank you very much.....the attrib text above the qty box now is centered. I see no change though in either the top header alignment or the background color.
Thanks Again,
Tom
-
Re: Product Attribute Grid
sorry about the table, i just got the name of the class from firefox's developer tool..
as for the header, i dunno. that line did it for me.. maybe we were having different alignment issues.
-
Re: Product Attribute Grid
Quote:
Originally Posted by
HTsean
to anyone that cares, i figured out how to get the prices inside the attribute tables to hide when not logged in. In includes/modules/your_template/attributes.php at around line 47:
PHP Code:
if ($check_attributes_fields == true) {
I noticed Absolute added his entire Attribute Grid code (for this .php file, anyways) in this function. So I created a
PHP Code:
if ($_SESSION['customer_id']){
}
function while just inside the $check_attributes_fields statement and enclosed whatever was inside. I then copied that entire code into an else{} statement, but this time commented out this line, around line 88:
PHP Code:
'price' => $products_options->fields['options_values_price'],
Commenting out the 'price' variable in the $grid_records[$rd]['options'][] array gets rid of the prices that display in the grid.
So the basic layout of my coding solution is that if a user is logged in, the attribute grid performs normally. But, if the user is not logged in, then the attribute grid performs with the price display manually disabled through commenting out the 'price' variable.
I'm sure there is a much easier way of getting this done. It feels like there is a quick one line code method of being able to get 'hide prices until logged in' functionality with the attribute grid, but my programming knowledge is limited.
HTsean,
This is actually important for my cart too.
unfortunately I can't manage to edit the attributes.php without errors.
I have tried to follow your post's steps, but I think I am having problem placing the Else Statement.
I have added the if ($_SESSION['customer_id']){ after Line 47. But I am stuck as to where to place the Else statement from there, I have tried a few logical place without success.
Could you please point me as to what portion of code should I enclose in the If statement and where to place the Else part?
I actualy want to hide the table altogether if not logged in, so an Empty Else statement should do?
Ideally if you could just quote your attributes.php in full I could work it out from there ;)
Thanks a mil!
Stephane
-
Re: Product Attribute Grid
Has anyone figured out a way to have additional single attributes work along with the attribute grid?
All I need is one additional product attribute outside the grid -- a radio button or checkbox would do it.
-
Re: Product Attribute Grid
Here it goes, this is my personally edited attributes.php with the only update being that 'hide prices until logged in' now functions with Absolute's Product Attribute Grid.
The 'hiding' prices part must be done through the zen-cart's options:
Configuration->Customer Details->Customer Shop Status - View Shop and Prices'..
is set to 'May browse but no prices unless logged in' (option 2). After setting that, the attributes.php file that you will need to modify is in:
/includes/modules/YOUR_TEMPLATE/attributes.php
Actually, I cannot copy and paste on this message because it is too long so I saved it as a text file on my server. Here's the link:
http://www.halftonebodyworks.com/sho...attributes.txt
Btw, I probably won't have this txt file on the server for more than a few weeks.
-
Re: Product Attribute Grid
Thanks HTsean,
works a treat you legend !
also I noticed another little glitch on the contribution.
When using only 1 Option Name as column heading, or 1 as row heading you end up with the Title of the columns off set to the left of the table and starting above the Row Heading of the other Option name.
I have fixed this by updating the Attribute.php from Line 107 so the Col or row span is always 2 and will nicely sit as it should above it's column.
Quote:
if (($grh_size > 1) || zen_not_null($grid_records['H']['options'][$grh]['name'])) {
$top_rowspan = 2;
} else {
$top_rowspan = 2;
}
if (($grv_size > 1) || zen_not_null($grid_records['V']['options'][$grv]['name'])) {
$top_colspan = 2;
} else {
$top_colspan = 2;
}
Stephane
-
Re: Product Attribute Grid
For those of you trying to style the table to look a bit more attractive, you can locate this line in the /modules/yourtemplatename/attributes.php:
$attrib_grid = '<table id="attrib-grid-table" cellpadding="3" border="1">'."\n" .
Personally I changed the border to 0.
You can also append your stylesheet by adding the following classes and ids (style however you wish)...
.attrib-grid-cell {text-align:center;border:0;vertical-align: top;}
.attrib-grid-vHeader {border: 0;}
.attrib-grid-opt-nameH {border: 0;}
#attrib-grid-hHeader { }
#attrib-grid-opt-nameH {}
#productAttributes {}
-
Re: Product Attribute Grid
How is the update going so that you can exclude certain combos that are either out of stock or not available i.e a red shirt in size XXL. I saw that you were working on something like that a few months back Absolute but haven't heard from you in a while. Are you still supporting this module/thread?
Thanks again for a great module.
-
Re: Product Attribute Grid
Quote:
Originally Posted by
supersnow
How is the update going so that you can exclude certain combos that are either out of stock or not available i.e a red shirt in size XXL. I saw that you were working on something like that a few months back Absolute but haven't heard from you in a while. Are you still supporting this module/thread?
Thanks again for a great module.
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.
-
Re: Product Attribute Grid
Sounds like a great mod... if I could get it to work. (user error I'm sure)
Am trying to apply the grid to attributes already set-up. Is this possible, or do I need to delete those and start fresh?
I installed the files as directed, but I'm not seeing where in the admin panel it is.
Sorry if these are dumb questions... I'm obviously a newbie!
If someone out there would be kind enough to offer some hand holding, I would be greatly appreciative!!
Thanks!
-
Re: Product Attribute Grid
Hi Domsmom,
You shouldn't need to delete your previous attributes. When I installed this mod to one of our sites, it seemed to work just fine with the existing set of attributes we had entered. If you are not seeing anything change on your product info pages, it is possible that one of the files you uploaded was put into the wrong folder. Check for any override folders and make sure you are placing them there; if you only upload them to the default directory and you had an override file there, it won't work.
Maybe you could give us an example url for one of the products that is still showing the old fashioned attribute layout?
-
Re: Product Attribute Grid
Hi Jacdesigner,
Thanks for the tips, I'll look at the files and make sure they all made it to the right spot. Below is a link. If the link doesn't take you to a "Whoopie Assortment" page, would you mind navigating there? It's the attributes on those pages that I would like to organize in the grid.
http://www.westcoastwhoopies.com/sho...products_id=12
The site is in Beta, so excuse the dust :)
Any additional insight you have would be great!!! Thank You!!
-
Re: Product Attribute Grid
Thanks for the example. That actually looks correct to me. At least, that is how it displays on the sites where I have used it. I was under the impression that the layout reference of "grid" referred to how the attribute names display beside each quantity box, and offer a way to manage multiple attributes at once. If you have a nice attribute image, it will display to the left of the name. This is super handy for color choices.
Perhaps you expected to see the attributes in a 3 column grid instead?
If that is how it is supposed to work, I was not aware. Perhaps someone else can confirm with another example.
-
Re: Product Attribute Grid
Hmmm, I guess I was expecting something different. I guess my next question, is there a way to line up the text boxes?
Thanks for looking!
-
Re: Product Attribute Grid
I got this mod installed and it seems to be working fine, but I want to customize the look to fit my design. Which file do I need to edit to change the size and color of the borders? Also, I need to resize the table because it is stretching my template (800x600).
Oh, and how can I make this just display for certain products? I only need this for certain products that have many options.
Thanks!
-
Re: Product Attribute Grid
Hello there,
In a previous post I noted that I made some edits to the file:
/modules/yourtemplatename/attributes.php:
This was where I located the table and made some manual adjustments to it, including placing a border=0.
Quote:
Originally Posted by
xt0rt
I got this mod installed and it seems to be working fine, but I want to customize the look to fit my design. Which file do I need to edit to change the size and color of the borders? Also, I need to resize the table because it is stretching my template (800x600).
Oh, and how can I make this just display for certain products? I only need this for certain products that have many options.
Thanks!
-
Re: Product Attribute Grid
Very nice! I will go ahead and do that.
Completely off topic, but I just visited Austin the other month. What a cool city... especially all the stores along Guadalupe. I think I'll pass on hanging out with the dirty indie kids next time though. :laugh:
-
Re: Product Attribute Grid
Is there some sort of way for me to just define this to work with certain products? Otherwise if there are not combinations, the output is not functional and rather fugly.
-
Re: Product Attribute Grid
Also, jacdesigner, what line(s) do I edit to get rid of those ugly table borders? I have not been able to get rid of them.
-
Re: Product Attribute Grid
For editing the border, look for this line:
$attrib_grid = '<table id="attrib-grid-table" cellpadding="3" border="1">'."\n" .
For the other question, I suppose you could create different "product types" (Catalog, Product Types) and then create a different template for your other product type without the attribute module code in it. I have not tried this myself so not sure what fancy coding might be necessary for the template change.
-
Re: Product Attribute Grid
Yeah, that just might work... I don't think it will be too difficult. Otherwise, I can always just make a text box for the customer to specify combinations. This site only has one customer anyway (I'm using Zen as a B2B order system).
-
Re: Product Attribute Grid
Ok, I am unable to find that line anywhere in the specified file, not even the word 'grid'. Can you give me a full path to the file from the main ZC directory?
-
Re: Product Attribute Grid
I have loaded this module and can not get it to work. I changed the column to 3 in the admin/config/product listing and still do not see any columns on my main products.
my site is www.burnerbooks.com/index.php.
Any help would be greatly appreciated!
:frusty:
-
Re: Product Attribute Grid
ok...finally got grid to show up with many changes. But, still does not line up with attributes and many are missing.
In FF, grid sets to left and in IE it is centered.
My site http://www.burnerbooks.com//index.ph...roducts_id=183.
Is an example of grid with attributes not lining up.
Should be:
Length 8 1/4
Point Size 7.2
Thanks.
-
Re: Product Attribute Grid
Howdy, first post here so dont slam me too much - I am VERY new to Zen Cart, new as in I did my first install yesterday. I have setup several stores in the past with OSC and have decided to give Zen a try - I work for a Tee Shirt company and this grid attributes mod will be very very helpful - IF I can get it to work.
I'm not sure what I am doing wrong, I have a basic install of Zen, this is the first mod I tried to install. I am pretty sure I have the files in the right place, I did not overwrite any existing files, I created 2 attributes of the same type and now no attributes show up. The ONLY way I get attributes to come back is if I do this from the instructions:
"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."
But I dont have single attributes -
The instructions are really short, is there anything I should be doing in the admin?
Any advise would be great - Thanks...
-
Re: Product Attribute Grid
Quote:
Originally Posted by
jalaco
Has anyone figured out a way to have additional single attributes work along with the attribute grid?
All I need is one additional product attribute outside the grid -- a radio button or checkbox would do it.
I have the same problem...
news about?
-
Re: Product Attribute Grid
I cant believe this! I just installed this mod 3 times on two different servers and I get no grid! Even tried fresh installs just to make sure. Is there something I'm missing? I have two attributes with two options each. Both still display there dropdowns. Is there an ON button I'm missing somewhere? With no admin files - I doubt it...but just want to make sure. All four files are right where they are supposed to be...this is one of the lightest mods ever and I cannot believe I am having this luck!!! Anyone else? Zen 1.3.8a
-
Re: Product Attribute Grid
I don't remember having this problem, and I don't think you need to toggle any setting to "turn it on" once all files are uploaded. You may need to adjust the stylesheet, though.
Maybe it is related to this thread?
http://www.zen-cart.com/forum/showthread.php?p=313783
-
Re: Product Attribute Grid
I've recently installed this contribution, but have ran into a little problem.
The grid is populated correctly, but no matter what quantities I enter into the attribute boxes nothing is added to my shopping cart!
This problem does not occur without the contribution, so I know that Zen Cart is setup correctly.
I'm running the latest version (1.0.1) of the contribution and version 1.3.8a of Zen Cart.
Also, I noticed that the version ID line in attributes.php (in the contribution and Zen Cart) differs. Not sure if an old file (pre-1.3.8a) was used.
Has any else experienced this issue?
-
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
-
Re: Product Attribute Grid
Whenever I try to add more than one attribute with a qty box it all reverts to radio fields. Take a look here.
I added Color as a radio field the same way as adding the Qty radio, so it has a sort order of -9998. Then I added a separate drop down option name "colors" with option values "black" and "white". It's probably something I'm just missing in the way I'm doing it :dontgetit
-
Re: Product Attribute Grid
There you have 5 different attributes. You should only ever have TWO.
One attribute, set as a RADIO type should be colour, with RED, GREEN, BLUE etc as the VALUES.
The other should be SIZE with the VALUES XXL, XL, L, M, S
Thats all. Remove the other three attributes and it will work as expected.
You only need a quantity attribute if you only have 1 attribute, and want to force the single attribute into a grid format.
Absolute
-
Re: Product Attribute Grid
Ooooh :blush: Ok I got it now & that worked, thank you!
-
Re: Product Attribute Grid
-
Re: Product Attribute Grid
Absolute, sorry to bother you. Is there a way to have the price in it's own column.
Like
[attribute] [price] [qty box]
??
Thank you!
-
Re: Product Attribute Grid
You can. However, this is a little beyond the scope of this module. The existing could certainly be updated to reflect any setup/layout you are looking for.
Absolute
-
Re: Product Attribute Grid
Quote:
Originally Posted by
Absolute
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
Yes I do have the stock by attributes installed and your fix worked. But there was one small error in the code it was missing a '. So for anyone else wanting this to little fix to work:
In includes/modules/attributes.php (or if you are like me that uses the template override system includes/modules/YOUR_TEMPLATE/attributes.php)
Find:
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);
$attrib_grid .= '<td class="attrib-grid-cell" id="attrib-grid-cell-'.$grid_records['H']['options'][$grh]['id'].'-'.$grid_records['V']['options'][$grv]['id'].'">'.
zen_draw_input_field('products_id['.$products_attribs_id.']', '', 'size="3"').'<br />'.
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']).
'</td>';
}
Replace:
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>';
}
Also remember to upload the image to /images/item_out_stock.gif
We just used a similar X like on Absoulte's website.
Thanks again to Absolute for a great module and very simple fix.
-
Re: Product Attribute Grid
The code above works great for two option attributes. But if I use it the grid for single attributes, and still want to have all options with a Quantity box next to them then I have a problem.
I have followed the readme and set up an attribute called Quantity, which is a Radio type option and then setup one option value, which has no text defined, so it is just a completely blank value, but then even with stock by attribute setup normally I get my X image in all the boxes. But if I put text in the option value the quantity box appears for each single attribute again.
So what do I need to do with this code so it still works with single attributes?
-
Re: Product Attribute Grid
Does anyone think (or know) that this mod could be combined with the "drop down attributes at product listing mod", so that I could create a "quick order on steroids". The grid format would be on the product listing page rather than product info. That way a customer could order for example 5 of one size of shoe and 10 of another size of product a then order 20 of one size and 30 of another of product b on the same page.
I tried combining the 2 modules on my test site with no success. Probably because of my lack of php knowledge.
-
Re: Product Attribute Grid
The two modules would not function together, as the module we have created relies on a number of product specific hidden variables when the form is submitted.
The solution to the problem you are looking to solve has been created already however! We have it running on a couple of our sites. If you want a pointer in the right direction, you would need to update your cart action script to add the items to cart with attributes, and then on your product listing page, show all the product attributes with speific field names.
It can be done, but requires a little PHP knowledge.
Absolute