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

Removing Options on 0 Dollar Items...

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-21-2007, 06:53 AM
 
crcool75 crcool75 is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 87
 

Default Removing Options on 0 Dollar Items...

Hello,

On our customer front-end, under the price of a detailed product description there are options, quantity and then the Add to Cart button. We have it setup so that if an item has a "0" price it says "Call for pricing". If a product has a "0" price we don't want that options line, quantity and Add to Cart button to show up.

I know this is in the product.tpl file, but I can't figure out the {if} statements nor where to put them. Any help would be greatly appreciated!

Thank you
__________________
X-Cart Gold 4.4.0
Reply With Quote
  #2  
Old 09-21-2007, 11:41 AM
 
toomnyhats toomnyhats is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 41
 

Default Re: Removing Options on 0 Dollar Items...

In skin1/customer/main/product.tpl


FIRST

FIND:
<table width="100%" cellpadding="0" cellspacing="0">
<tr><td colspan="2">
<b><font class="ProductDetailsTitle">{$lng.lbl_options}</font></b>

REPLACE WITH:
<table width="100%" cellpadding="0" cellspacing="0">
{*****1a-ADDED TO REMOVE PRICE FROM $0 PRODUCTS*****}
{if $product.taxed_price ne 0}
{****1a-END ADDED TO REMOVE PRICE FROM $0 PRODUCTS***}
<tr><td colspan="2">
<b><font class="ProductDetailsTitle">{$lng.lbl_options}</font></b>

SECOND

FIND:
{include file="customer/main/product_prices.tpl"}
{if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)}
{if $js_enabled}
<br />

REPLACE WITH:
{include file="customer/main/product_prices.tpl"}
{if $config.General.unlimited_products eq "Y" or ($product.avail gt 0 and $product.avail ge $product.min_amount)}
{if $js_enabled}
<br />
{****1b-ADDED TO REMOVE PRICE FOR $0 PRODUCT*******}
{/if}
{****1b-END ADDED TO REMOVE PRICE FOR $0 PRODUCT***}

THIRD

FIND:
{if $product.forsale ne "B"}
<table cellspacing="0" cellpadding="0">
<tr>
<td>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>


REPLACE WITH:
{if $product.forsale ne "B"}
<table cellspacing="0" cellpadding="0">
<tr>
{****2a-ADDED TO REMOVE PRICE FOR $0 PRODUCT*******}
{if $product.forsale ne "B"||$product.taxed_price ne 0}
{****2a-END ADDED TO REMOVE PRICE FOR $0 PRODUCT***}
<td>{include file="buttons/add_to_cart.tpl" style="button" href="javascript: if(FormValidation()) document.orderform.submit();"}</td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
{****2b-ADDED TO REMOVE PRICE FOR $0 PRODUCT*******}
{/if}
{****2b-END ADDED TO REMOVE PRICE FOR $0 PRODUCT***}


This works on my test site which doesn't contain any mods. I didn't test it on my live site. If you have a heavily modded products.tpl, you may run into snags.
__________________
toomnyhats
X-Cart Gold 4.1.9 (Unix)
X-SpecialOffers
DSEFU (disabled)
Reply With Quote
  #3  
Old 09-21-2007, 06:46 PM
 
crcool75 crcool75 is offline
 

Advanced Member
  
Join Date: Jan 2006
Posts: 87
 

Default Re: Removing Options on 0 Dollar Items...

Thanks toomy, I got it working!
__________________
X-Cart Gold 4.4.0
Reply With Quote
  #4  
Old 09-22-2007, 06:31 AM
 
toomnyhats toomnyhats is offline
 

Advanced Member
  
Join Date: Sep 2006
Posts: 41
 

Default Re: Removing Options on 0 Dollar Items...

No problem!
__________________
toomnyhats
X-Cart Gold 4.1.9 (Unix)
X-SpecialOffers
DSEFU (disabled)
Reply With Quote
  #5  
Old 10-18-2007, 12:55 PM
 
CollectiveInk CollectiveInk is offline
 

Member
  
Join Date: Sep 2007
Posts: 21
 

Default Re: Removing Options on 0 Dollar Items...

I know this reply to this thread is a month out of date, but the info was very helpful, with one exception.

The three part mod did a great job removing the add to cart button on zero (0) priced items, but on those with a price, it added a "&nbs p;" visually after the add to cart button for those products with a price.

So now it looks a bit funky with the button and then those letters (I know it is html for a space, but not sure why it's showing up all of a sudden.)

Any thoughts?

Thanks for current and future assistance.

Tim
__________________
x-cart gold Version 4.1.8
Reply With Quote
  #6  
Old 10-21-2007, 05:13 PM
 
MoonDog MoonDog is offline
 

Advanced Member
  
Join Date: Aug 2007
Posts: 93
 

Default Re: Removing Options on 0 Dollar Items...

CollectiveInk,

Find this line of code:
Code:
<td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;</td>
and remove the space between 's' and 'p' in '&nbs p;' near the end of this line.

It should look like this: &nbsp;

- MoonDog -
__________________
X-CART Gold v4.1.8
Reply With Quote
  #7  
Old 10-22-2007, 06:10 PM
 
CollectiveInk CollectiveInk is offline
 

Member
  
Join Date: Sep 2007
Posts: 21
 

Default Re: Removing Options on 0 Dollar Items...

That did it! Thanks.

Crazy how one little space can make a huge difference how things appear.
__________________
x-cart gold Version 4.1.8
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 03:52 PM.

   

 
X-Cart forums © 2001-2020