Column problem on product page(phOptions)

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Column problem on product page(phOptions)

Post by William_firefold » Fri May 08, 2009 1:13 pm

On a product page, ive been trying to make it so the swatches will fill up the space underneath the word "color" instead of the <td> beside it. I dont really understand how the product variants part of the code works.
Is there a way to do this?

Image

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Column problem on product page(phOptions)

Post by mazhar » Mon May 11, 2009 5:15 am

Locate following code in App_Code/ProductHelper.cs file's BuildProductOptions function

Code: Select all

phOptions.Controls.Add(new LiteralControl("<tr><th class=\"rowHeader\"" + (option.ShowThumbnails ? " valign=\"top\"" : string.Empty) + ">" + option.Name + ":</th>"));
                phOptions.Controls.Add(new LiteralControl("<td align=\"left\">"));
and then make it look like

Code: Select all

phOptions.Controls.Add(new LiteralControl("<tr><th class=\"rowHeader\"" + (option.ShowThumbnails ? " valign=\"top\"" : string.Empty) + ">" + option.Name + ":</th></tr>"));
                phOptions.Controls.Add(new LiteralControl("<tr><td align=\"left\">"));

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Column problem on product page(phOptions)

Post by William_firefold » Mon May 11, 2009 12:13 pm

Thanks mazhar, this one was tricky. The source code in the .cs doesnt look like the website source in this area. To get it looking like 7.02 I used a colspan=2.

Code: Select all

phOptions.Controls.Add(new LiteralControl("<tr><th class=\"rowHeader\"" + (option.ShowThumbnails ? " valign=\"top\"" : string.Empty) + ">" + option.Name + ":</th></tr>"));
phOptions.Controls.Add(new LiteralControl("<tr><td align=\"left\" colspan=\"2\">"));

User avatar
William_firefold
Commander (CMDR)
Commander (CMDR)
Posts: 186
Joined: Fri Aug 01, 2008 8:38 am

Re: Column problem on product page(phOptions)

Post by William_firefold » Mon May 11, 2009 2:23 pm

I have a new question on the same topic.
The selector has a little label built into it that changes to display the name of the option that is clicked. It has no CSS #id attached to it and it isnt a normal control.
It looks like it gets added in producthelper.cs
phOptions.Controls.Add(picker);
but I cant control the position of it.
I want to put it next to the word "color". Is this possible?

Post Reply