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)
-   -   Weight removing from product page (https://forum.x-cart.com/showthread.php?t=18040)

Realsecurity 11-17-2005 08:23 AM

Weight removing from product page
 
This mod will remove the word Weight and figure of weight from the product pages, making this neater on the pages. The cart will still carry the weight calculation and gives correct shipping prices at checkout. There is other mods to show total weight at checkout wich makes things simpler.

The code below is a modification to what limited topics i have found on the forums, this code i messed around with and actually works now. V4.0.13 should work on other versions but make sure you back up the file first.

SKIN1/CUSTOMER/MAIN as some of you might find its saves searching your directory for the file......

MAKE copy of the file first Product.tpl, then:

Find in your Product.tpl file the code below:

if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN>{$config.General.weight_symbol}</TD></TR>{/if}

and replace with:

if $product.weight ne "0.00"}<TR><TD width="30%">{*$lng.lbl_weight*}</TD><TD nowrap><SPAN id="product_weight">{*$product.weight*}</SPAN>{*$config.General.weight_symbol*}</TD></TR>{/if}

This will then REMOVE the word Weight, REMOVE the Number in weight and REMOVE the symbol weight g or Kg lb etc.....

Hope this helps, spent many hours searching for a solution in the end messed around with the script me self.

balinor 11-17-2005 01:04 PM

Be VERY careful when you are working with {if} tags. If you don't include the brackets, you could really mess your site up. Instead of all of those comment tags, just put a comment at the beginning and the end of the code, like this:

Code:

{*{if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN>{$config.General.weight_symbol}</TD></TR>{/if}*}

That will tell X-Cart to skip the whole thing, and won't leave a blank spot where the weight is supposed to be. No need for it to waste time running the {if} statement if there is nothing to process :)

FYI, this is how you can hide anything on any page. Just be sure to get both the opening and closing {if} tags.

Realsecurity 11-17-2005 01:14 PM

When i tried * commenting out this weight section i tried the * and i ended up with SMARTY ERROR ? so thats why i tried and tested * one tag at a time,
will try and * out the whole line again an see if this does the job, trying to get Total weight to appear on Invoices and in Orders in admin at the moment, not much luck so far.....

balinor 11-17-2005 01:16 PM

Just copy the code I quoted above.

Dawn Howard 05-17-2006 06:50 AM

Quote:

Originally Posted by balinor
Be VERY careful when you are working with {if} tags. If you don't include the brackets, you could really mess your site up. Instead of all of those comment tags, just put a comment at the beginning and the end of the code, like this:

Code:

{*{if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN>{$config.General.weight_symbol}</TD></TR>{/if}*}

That will tell X-Cart to skip the whole thing, and won't leave a blank spot where the weight is supposed to be. No need for it to waste time running the {if} statement if there is nothing to process :)

FYI, this is how you can hide anything on any page. Just be sure to get both the opening and closing {if} tags.



Could you help a newbie out, where do I make this change? Thanks!

balinor 05-17-2006 06:53 AM

customer/main/product.tpl

Dawn Howard 05-17-2006 10:28 AM

worked like charm, thanks!

actually for the next newbie like me who doens't know squat, it was: skin1/customer/main/product.tpl

balinor 05-17-2006 10:31 AM

Dawn, this thread may help you in the future:

http://forum.x-cart.com/viewtopic.php?t=28546

msutherland 11-24-2006 03:59 PM

Re: Weight removing from product page
 
Hmmm.... This doesn't seem to work in 4.1.x. I have (clothing) size variants, and would rather not show the weights in the product detail area. I tried commenting out the similar code in product.tpl; this removes the actual weight (number), but its still showing 'Weight' and 'lbs'. Perhaps I need to make some additional changes somewhere else?

Bodger 11-30-2006 12:19 AM

Re: Weight removing from product page
 
Quote:

Originally Posted by msutherland
Hmmm.... This doesn't seem to work in 4.1.x. I have (clothing) size variants, and would rather not show the weights in the product detail area. I tried commenting out the similar code in product.tpl; this removes the actual weight (number), but its still showing 'Weight' and 'lbs'. Perhaps I need to make some additional changes somewhere else?


Yes, me too !

I was rather hoping there was a simple check box to turn weight on or off, but not so apparently.

Can anybody enlighten us here for versions 4.1.xx please ?

With Thanks,

Mike.

ndent 12-27-2006 03:51 PM

Re: Weight removing from product page
 
Is this still an issue with 4.1.x? I need to do the same... I don't want weight appearing in the description.

smek 06-13-2008 08:39 PM

Re: Weight removing from product page
 
use html commenting and it works

<!---{if $product.weight ne "0.00" || $variants ne ''}
<tr id="product_weight_box">
<td width="30%">{$lng.lbl_weight}</td>
<td nowrap="nowrap"><span id="product_weight">{$product.weight|formatprice}< /span> {$config.General.weight_symbol}</td>
</tr>
{/if} -->

northstar 12-18-2009 09:23 AM

Re: Weight removing from product page
 
I'd love to know how to make the Weight listings disappear on the product pages in Version 4.3. I can't seem to figure it out!

Can anyone help? Thank you!

cflsystems 12-18-2009 09:41 AM

Re: Weight removing from product page
 
The file is skin1/customer/main/product_details.tpl and the code to comment out

{if $product.weight ne "0.00" || $variants ne ''}
<tr id="product_weight_box"{if $product.weight eq '0.00'} style="display: none;"{/if}>
<td class="property-name">{$lng.lbl_weight}</td>
<td class="property-value" colspan="2">
<span id="product_weight">{$product.weight|formatprice}< /span> {$config.General.weight_symbol}
</td>
</tr>
{/if}

northstar 12-18-2009 10:20 AM

Re: Weight removing from product page
 
Perfect! Thank you VERY much!

xcel 02-03-2010 03:38 PM

Re: Weight removing from product page
 
balinor to the rescue. this works in pro 4.1.9. thanks sir!

Quote:

Originally Posted by balinor
Be VERY careful when you are working with {if} tags. If you don't include the brackets, you could really mess your site up. Instead of all of those comment tags, just put a comment at the beginning and the end of the code, like this:

Code:

{*{if $product.weight ne "0.00"}<TR><TD width="30%">{$lng.lbl_weight}</TD><TD nowrap><SPAN id="product_weight">{$product.weight}</SPAN>{$config.General.weight_symbol}</TD></TR>{/if}*}

That will tell X-Cart to skip the whole thing, and won't leave a blank spot where the weight is supposed to be. No need for it to waste time running the {if} statement if there is nothing to process :)

FYI, this is how you can hide anything on any page. Just be sure to get both the opening and closing {if} tags.


Bruno Stevens 12-14-2010 01:14 PM

Re: Weight removing from product page
 
Thx !
Works fine with X-Cart 4.4.1

Quote:

Originally Posted by smek
use html commenting and it works

<!---{if $product.weight ne "0.00" || $variants ne ''}
<tr id="product_weight_box">
<td width="30%">{$lng.lbl_weight}</td>
<td nowrap="nowrap"><span id="product_weight">{$product.weight|formatprice}< /span> {$config.General.weight_symbol}</td>
</tr>
{/if} -->


batt255 06-16-2011 02:22 PM

Re: Weight removing from product page
 
will this work on 4.4.3?

cflsystems 06-16-2011 05:37 PM

Re: Weight removing from product page
 
Yes but use smarty comments not html comments - {* code here *}

batt255 06-18-2011 10:42 AM

Re: Weight removing from product page
 
I'm sorry newbie..can you show me?

cflsystems 06-18-2011 01:01 PM

Re: Weight removing from product page
 
{*
{if $product.weight ne "0.00" || $variants ne ''}
<tr id="product_weight_box">
<td width="30%">{$lng.lbl_weight}</td>
<td nowrap="nowrap"><span id="product_weight">{$product.weight|formatprice}< /span> {$config.General.weight_symbol}</td>
</tr>
{/if}
*}


All times are GMT -8. The time now is 05:42 AM.

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