X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Page Width Changes Using Product Variants Firefox to IE (https://forum.x-cart.com/showthread.php?t=28770)

Harry Nile 02-11-2007 12:48 PM

Page Width Changes Using Product Variants Firefox to IE
 
I noticed that the page width expands about 30 pixels in Firefox 1.5.0.9 on the products.php page when a product with variants is dispayed. This page width expansion does not occur in IE 7.

You can see this difference on the following pages using Firefox:

The link below is a product without variants:
http://jimfrenchproductions.com/xcart413/product.php?productid=42&cat=2&page=1

The link below is a product with variants. You will see the option to select either CD or MP3:
http://jimfrenchproductions.com/xcart413/product.php?productid=16&cat=2&page=1

The wider page width for the product with variants pushes the page into a column on the right that is set up as an absolutely positioned DIV. Also when the lower cost variant is selected (choose MP3 from the options) the discount graphic widens the page even further pushing the right column deeply into the absolutely positioned column.

I see the variants code is written in javascript. Is there any way to fix this?

Also is there a way to turn off the display of the discount "save_percent_box" box cell? While this is a nice feature, it doesn't fit well in my design with the absolutely positioned column.

Thank you for your support,

Harry

carpeperdiem 02-11-2007 01:58 PM

Re: Page Width Changes Using Product Variants Firefox to IE
 
Harry,

The reason the page expands is because of the "discount save_percent_box"

To kill it, in product.tpl, FIND:

Code:

<span id="save_percent_box">{if $product.taxed_price >= $product.list_price}{/if}
{if $product.taxed_price gt 0 and $product.list_price gt 0}
<table align="center" width="60"><tr><td class="SaveMoneyLabel">
{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount}
&nbsp;<span id="save_percent">{ $discount }
</span>%
</td>
</tr>
</table>
</span>{/if}

Comment out most of this. I think you can comment all of it out. You may have a table formating issue... but maybe not if it's all commented out. product.tpl is a mess of nested tables. But this is definitely the code that's displaying the discount banner, and if removed, it will fix your issue.

Hope this helps.

Jeremy

balinor 02-11-2007 04:35 PM

Re: Page Width Changes Using Product Variants Firefox to IE
 
Moving to Template Editing as this is not a bug. Please be sure to read the guidelines on posting in the bugs forum, thanks :)

Harry Nile 02-11-2007 07:53 PM

Re: Page Width Changes Using Product Variants Firefox to IE
 
Thank you for the help.

I was mistaken..:oops: The widening problem is caused by the way Firefox interprets the "Audio Download Instructions" DIV. I should have checked it before I posted. I was able to fix the issue by editing the CSS for the DIV.

Thank you for pointing me to the "save_percent_box" code block. I see it has changed a bit from 4.1.5 to 4.1.6 (assuming you pulled the code from 4.1.6).

In 4.1.5 the "save_percent_box" is a TD id instead of a SPAN.

Code:

</td>
<td align="right" valign="top" width="60" id="save_percent_box"{if $product.taxed_price >= $product.list_price} style="display: none;"{/if}>
{if $product.taxed_price gt 0 and $product.list_price gt 0}
<table width="60" cellspacing="1" cellpadding="2">
<tr>
    <td class="SaveMoneyLabel">
<br />
{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount}
&nbsp;<span id="save_percent">{ $discount }</span>%
    </td>
</tr>
</table>
{/if}
</td>


I was wondering if there was a setting in the administration area to turn this on and off but apparently not.

I may just wrap the entire HTML in another 2 column table and put the CafePress table inside the right column so it can move with the page flow and let the "save_percent_box" display. It is a nice feature. First I will see if I can CSS a float.


Thank you for your support,

Harry

carpeperdiem 02-11-2007 08:05 PM

Re: Page Width Changes Using Product Variants Firefox to IE
 
Whoops... I may have edited this code at some point - which could explain some differences...

here is the virgin 4.1.6 block
Code:

<table width="60" cellspacing="1" cellpadding="2">
<tr>
    <td class="SaveMoneyLabel">
<br />
{math equation="100-(price/lprice)*100" price=$product.taxed_price lprice=$product.list_price format="%3.0f" assign=discount}
&nbsp;<span id="save_percent">{ $discount }</span>%
    </td>
</tr>
</table>


Harry Nile 02-12-2007 01:23 AM

Re: Page Width Changes Using Product Variants Firefox to IE
 
I found the best solution for me was to create another table column cell in the "Container" table, found in rectangle_bottom.tpl, and put the CafePress table in there.

Now it will expand and contract nicely with the "save_percent_box" and/or any other things that might stretch the page width.

I may get the hang of this if I keep trying :D

Thank you for your support,

Harry


All times are GMT -8. The time now is 04:36 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.