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)
-   -   Adding a blank line.. (https://forum.x-cart.com/showthread.php?t=62579)

Yvonnewilt 02-07-2012 06:55 PM

Adding a blank line..
 
I'm trying to figure out how to add a blank line if the item is not on sale. Specifically in the products view, if the item is on sale, the cart shows Market price and price, which is fine.. but I want it to add a blank line where Market Price would be if the item is not on sale, if that makes sense?

Basically, I am trying to get the buy now / add to wish list buttons to print on the same line so it is uniform.

I tried this in the products_t.tpl

Code:

{if $discount gt 0}
 <font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{if $discount eq 0}<br /><br />
{/if}
{/if}


But that did not change anything. Can anyone help me with this please?

pauldodman 02-08-2012 12:10 AM

Re: Adding a blank line..
 
That's because you have the 2nd if statement - the one with the spaces, nested within the 1st if statement. That should come after the 1st statement.

Better would be to have an else in there instead.
{if $discount gt 0}
code
{else}
<br /><br />
{/if}

That would solve your problem - although you might want to consider using an image spacer for the blank space, rather than line breaks, then you can control the actual space easier using css, and also, it will work better in different browsers.

Yvonnewilt 02-08-2012 04:31 AM

Re: Adding a blank line..
 
Thank you Paul. Perhaps I am looking in the wrong place. When I do this, it simply adds 2 blank lines in between the market price and price. I am trying to add blank lines only if the market price is not showing.

I hope that makes sense?

Any suggestions of where would I need to add the blank lines in the products_t.tpl to make this happen?

pauldodman 02-08-2012 07:33 AM

Re: Adding a blank line..
 
So you tried my suggestion, and it's adding the blank lines after the market price?

Yvonnewilt 02-08-2012 10:14 AM

Re: Adding a blank line..
 
yes.. instead of only adding it if the item is not on sale.

pauldodman 02-09-2012 04:44 AM

Re: Adding a blank line..
 
OK, leave the original if statement as it was then:

{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}

Just before that if statement, there should be another if statement that starts:
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}

We will use that for the {else}

Add this then, immediately after your first, original if statement.

{else}
<br /><br />


So you should have something looking like this:


{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{else}
<br /><br />
{/if}

Let me know if that makes sense.

Yvonnewilt 02-09-2012 08:02 AM

Re: Adding a blank line..
 
Thank you so much Paul!! I got it to work. I had to play with it a little.. but here is what it ended up being:

Code:

{if $discount gt 0}
 <font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{else}
{if $discount eq 0}
<font class="MarketPrice"><br /></font>
{/if}


Yvonnewilt 02-09-2012 08:39 AM

Re: Adding a blank line..
 
Would you be able to help me with this also? Still trying to get everything aligned. At times the product title wraps to a 2nd line. I would like the thumbnail to align whether the product title is 1 line or 2 lines. I managed to accomplish this on the New Products view on the main page by editing the products_t.tpl from:

Code:

<table cellpadding="3" cellspacing="0" width="100%">
<tr>
<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].tmbn_x|default:$config.Appearance.thumbnail_width image_y=$products[product].tmbn_y product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
{if $active_modules.Special_Offers ne "" && $products[product].have_offers && $usertype eq 'C'}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{/if}


to this:
Code:

<table cellpadding="3" cellspacing="0" width="100%">
<tr>
    <td align=left valign=top rowspan="2" height="100%" nowrap="nowrap">
<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$products[product].tmbn_x|default:$config.Appearance.thumbnail_width image_y=$products[product].tmbn_y product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
{if $active_modules.Special_Offers ne "" && $products[product].have_offers && $usertype eq 'C'}
{include file="modules/Special_Offers/customer/product_offer_thumb.tpl" product=$products[product]}
{/if}


However, it does not change the featured products nor the products under the categories or providers. I'm unsure why this is? I checked the featured.tpl and it is pulling from the products_t.tpl.

Is there something else I need to edit to add the rowspan?

Thank you for all of your help!!

pauldodman 02-09-2012 09:45 AM

Re: Adding a blank line..
 
Can you post a link to your site?
Either here, or via PM, or email?

pauldodman 02-10-2012 03:06 AM

Re: Adding a blank line..
 
Ok, I got your link - and I was looking at your New Products that you mentioned - did you mean the page you get to by clicking the 1st link in your categories - that takes you to: home.php?cat=2
Because for me on that page, they are still misaligned.
Anyway, I think what you need to do, is add a fixed height to that product cell (<td>) - maybe something like height=30px


All times are GMT -8. The time now is 10:53 PM.

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