Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Adding a blank line..

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 02-07-2012, 06:55 PM
 
Yvonnewilt Yvonnewilt is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 41
 

Default 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?
__________________
4.1.11
New products
News Management
Magnifier
BCSE Detailed Images
Special Offers
Wishlist
OnSale
Reply With Quote
  #2  
Old 02-08-2012, 12:10 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default 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.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #3  
Old 02-08-2012, 04:31 AM
 
Yvonnewilt Yvonnewilt is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 41
 

Default 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?
__________________
4.1.11
New products
News Management
Magnifier
BCSE Detailed Images
Special Offers
Wishlist
OnSale
Reply With Quote
  #4  
Old 02-08-2012, 07:33 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default Re: Adding a blank line..

So you tried my suggestion, and it's adding the blank lines after the market price?
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #5  
Old 02-08-2012, 10:14 AM
 
Yvonnewilt Yvonnewilt is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 41
 

Default Re: Adding a blank line..

yes.. instead of only adding it if the item is not on sale.
__________________
4.1.11
New products
News Management
Magnifier
BCSE Detailed Images
Special Offers
Wishlist
OnSale
Reply With Quote
  #6  
Old 02-09-2012, 04:44 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default 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.
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #7  
Old 02-09-2012, 08:02 AM
 
Yvonnewilt Yvonnewilt is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 41
 

Default 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}
__________________
4.1.11
New products
News Management
Magnifier
BCSE Detailed Images
Special Offers
Wishlist
OnSale
Reply With Quote
  #8  
Old 02-09-2012, 08:39 AM
 
Yvonnewilt Yvonnewilt is offline
 

Advanced Member
  
Join Date: Jun 2009
Posts: 41
 

Default 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!!
__________________
4.1.11
New products
News Management
Magnifier
BCSE Detailed Images
Special Offers
Wishlist
OnSale
Reply With Quote
  #9  
Old 02-09-2012, 09:45 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default Re: Adding a blank line..

Can you post a link to your site?
Either here, or via PM, or email?
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
  #10  
Old 02-10-2012, 03:06 AM
  pauldodman's Avatar 
pauldodman pauldodman is offline
 

X-Guru
  
Join Date: Jul 2003
Location: Spain / UK
Posts: 3,062
 

Default 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
__________________
Paul Dodman
e-business & m-commerce consultant
w: www.luminointernet.com
e: xcart@luminointernet.com

Professional X-Cart help, advice, support and services, specialists in Mobile X-Cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:28 PM.

   

 
X-Cart forums © 2001-2020