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

Weight removing from product page

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-17-2005, 08:23 AM
 
Realsecurity Realsecurity is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Bexhill
Posts: 128
 

Default 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.
__________________
SURECOM XCART V4.1.8
Reply With Quote
  #2  
Old 11-17-2005, 01:04 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

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.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote

The following user thanks balinor for this useful post:
SamsonTS (02-03-2010)
  #3  
Old 11-17-2005, 01:14 PM
 
Realsecurity Realsecurity is offline
 

Senior Member
  
Join Date: Apr 2005
Location: Bexhill
Posts: 128
 

Default

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.....
__________________
SURECOM XCART V4.1.8
Reply With Quote
  #4  
Old 11-17-2005, 01:16 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Just copy the code I quoted above.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 05-17-2006, 06:50 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default

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!
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #6  
Old 05-17-2006, 06:53 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

customer/main/product.tpl
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #7  
Old 05-17-2006, 10:28 AM
 
Dawn Howard Dawn Howard is offline
 

eXpert
  
Join Date: Apr 2006
Posts: 229
 

Default

worked like charm, thanks!

actually for the next newbie like me who doens't know squat, it was: skin1/customer/main/product.tpl
__________________
Dawn
X-Cart Business 5.3.6.3
Mods:
Qty input - Custom Mod
Part numbers near title - Custom Mod
Membership approval before ordering - Custom Mod
Order Forms - Custom Mod
Freight on Board - Custom Mod
Catalog Order Form
Call For Price
Template: Crisp White skin
Running on Windows
Reply With Quote
  #8  
Old 05-17-2006, 10:31 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

Dawn, this thread may help you in the future:

http://forum.x-cart.com/viewtopic.php?t=28546
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #9  
Old 11-24-2006, 03:59 PM
 
msutherland msutherland is offline
 

Newbie
  
Join Date: Jun 2005
Posts: 3
 

Default 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?
__________________
M Sutherland
X-Cart Gold Version 4.1.7 [Linux]
php 4.4.3
MySQL 4.1.21-standard
Reply With Quote
  #10  
Old 11-30-2006, 12:19 AM
 
Bodger Bodger is offline
 

Advanced Member
  
Join Date: Oct 2005
Location: South Devon. UK
Posts: 65
 

Default 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.
__________________
Web:
X-Cart Gold 4.1.3
Apache 1.3.37 (Unix)
Linux
PHP 4.4.3
MySQL 4.1.19- standard

Home PC Dev:
X-Cart Gold 4.1.3
Uniform Server
PHP 5.1.1
MySQL server 5.0.17
MySQL client 4.1.7
Web Server Apache/2.0.55 (Win32)
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 02:02 PM.

   

 
X-Cart forums © 2001-2020