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

Product.tpl code question

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-17-2009, 06:42 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Product.tpl code question

I am trying to add the following code to the Product.tpl file.

{include file="PriceMatch.tpl"}{if $product.free_shipping eq "Y"} {include file="freeshipping.tpl"}

Works fine except that the PriceMatch.tpl is showing above the freeshipping.tpl on the customer side. I am trying to have the freeshipping.tpl show to the right of the PriceMatch.tpl. Thanks for your help in advance.
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #2  
Old 01-17-2009, 06:55 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Product.tpl code question

could you post the code?
__________________
xcart 5.1.2
Reply With Quote
  #3  
Old 01-17-2009, 07:04 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Re: Product.tpl code question

The code I am inserting is the following:
-----------------------------------------------------
{include file="PriceMatch.tpl"}{if $product.free_shipping eq "Y"} {include file="freeshipping.tpl"}
-----------------------------------------------------
Below is the area that I am inserting the code. Do you need a copy of the entire Product.tpl code or will this do?


{** Dynamic Images - Tela Firma **}
{if $active_modules.Dynamic_Images}
{include file="modules/Dynamic_Images/product_image.tpl}
{else}
{/if}
{include file="PriceMatch.tpl"}{if $product.free_shipping eq "Y"} {include file="freeshipping.tpl"}
<br />
{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{elseif $product.force_image_type eq 'W' && $product.variantid}
{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
{else}
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
{/if}

{/if}
{** /Dynamic Images - Tela Firma **}
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #4  
Old 01-17-2009, 07:08 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Product.tpl code question

need the code inside the .tpl files. it is probably cause the file to be inserted on the next line.
__________________
xcart 5.1.2
Reply With Quote
  #5  
Old 01-17-2009, 07:14 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Re: Product.tpl code question

The code for the PriceMatch.tpl is:
-------------------------------------
<table border="0" width="14%">
<tr>
<td>
<a href="http://www.traderhank.com/Price-Match-p-54.html">
<img border="0" src="http://www.traderhank.com/images/pricematch.gif" width="123"

height="100"></a></td>
</tr>
</table>
---------------------------------------

And the code for the freeshipping.tpl is:
---------------------------------------
<table border="0" width="10%">
<tr>
<td>
<img border="0" src="http://www.traderhank.com/skin1/images/Free_Ship1.jpg"

width="90" height="89"></td>
</tr>
</table>
---------------------------------------

The other issue I just noticed is that if I select "No" for Free Shipping in the product details my detailed image for my product variant will not show, but it will show when Free Shipping is selected.
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #6  
Old 01-17-2009, 07:18 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Re: Product.tpl code question

Here is a link to how it looks now.

http://www.traderhank.com/ITP-TYPE-T-7-BLACK-BEADLOCK-WHEEL-KIT-YAMAHA-RHINO-CLON-pr-1117174.html
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #7  
Old 01-17-2009, 07:21 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Product.tpl code question

Try this...

replace
{include file="PriceMatch.tpl"}{if $product.free_shipping eq "Y"} {include file="freeshipping.tpl"}

with this...

<table cellpadding="0" cellspacing="0">
<tr>
<td>
{include file="PriceMatch.tpl"}
</td>
<td>
{if $product.free_shipping eq "Y"} {include file="freeshipping.tpl"}{/if}
</td>
</tr>
</table>
__________________
xcart 5.1.2
Reply With Quote
  #8  
Old 01-17-2009, 07:26 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Re: Product.tpl code question

This is how the code looks, but now the PriceMatch, Free shipping and the product image are not showing.


{** Dynamic Images - Tela Firma **}
{if $active_modules.Dynamic_Images}
{include file="modules/Dynamic_Images/product_image.tpl}
<table cellpadding="0" cellspacing="0">
<tr>
<td>
{include file="PriceMatch.tpl"}
</td>
<td>
{if $product.free_shipping eq "Y"} {include file="freeshipping.tpl"}{/if}
</td>
</tr>
</table>
{if $active_modules.Detailed_Product_Images ne "" && $config.Detailed_Product_Images.det_image_popup eq 'Y' && $images ne '' && $js_enabled eq 'Y'}
{include file="modules/Detailed_Product_Images/popup_image.tpl"}
{elseif $product.force_image_type eq 'W' && $product.variantid}
{include file="product_thumbnail.tpl" productid=$product.variantid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="W"}&nbsp;
{else}
{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.image_x image_y=$product.image_y product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}&nbsp;
{/if}
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
  #9  
Old 01-17-2009, 08:17 AM
  ARW VISIONS's Avatar 
ARW VISIONS ARW VISIONS is offline
 

X-Man
  
Join Date: Jan 2007
Location: Pensacola, FL
Posts: 2,536
 

Default Re: Product.tpl code question

looks like you lef this out. look at your original post.

{else}
{/if}

that is just below this code

{include file="modules/Dynamic_Images/product_image.tpl}

I don't know if that is the problem.
__________________
xcart 5.1.2
Reply With Quote
  #10  
Old 01-17-2009, 08:27 AM
 
dillion dillion is offline
 

Advanced Member
  
Join Date: Jun 2006
Posts: 53
 

Default Re: Product.tpl code question

I will try what you suggested but I also got it working by using one .tpl file instead of two. Seems to work okay. The problem I am having though is when I select "No" for Free Shipping in the Product Details my product image will not show. I have no idea what might be causing this.

{** Dynamic Images - Tela Firma **}
{if $active_modules.Dynamic_Images}
{include file="modules/Dynamic_Images/product_image.tpl}
{else}
{/if}
{if $product.free_shipping eq "Y"} {include file="price-free.tpl"}
<br />
__________________
X-CART GOLD 4.1.7
UNIX
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 11:34 PM.

   

 
X-Cart forums © 2001-2020