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)
-   -   Removing Options on 0 Dollar Items... (https://forum.x-cart.com/showthread.php?t=34093)

crcool75 09-21-2007 06:53 AM

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

toomnyhats 09-21-2007 11:41 AM

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.

crcool75 09-21-2007 06:46 PM

Re: Removing Options on 0 Dollar Items...
 
Thanks toomy, I got it working!

toomnyhats 09-22-2007 06:31 AM

Re: Removing Options on 0 Dollar Items...
 
No problem!

CollectiveInk 10-18-2007 12:55 PM

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

MoonDog 10-21-2007 05:13 PM

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 -

CollectiveInk 10-22-2007 06:10 PM

Re: Removing Options on 0 Dollar Items...
 
That did it! Thanks. :D :D/

Crazy how one little space can make a huge difference how things appear. 8O


All times are GMT -8. The time now is 03:39 PM.

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