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.