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

Display & Update Weights in Product Search List - v4.3.0

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 01-19-2010, 11:20 AM
  gtwing's Avatar 
gtwing gtwing is offline
 

Advanced Member
  
Join Date: Jan 2006
Location: Running Springs, CA
Posts: 66
 

Default Display & Update Weights in Product Search List - v4.3.0

I needed a way to display and modify the product weights in the product search page results so that I could quickly go through and update multiple product weights page by page instead of having to open every product to change its weight.

I modified the steps to do this that I found in the mod for v4.0.17 to make it work in v4.3.0.

find your skin1/main/products.tpl (NOT product.tpl)

first right after

<TD nowrap>{if $search_prefilled.sort_field eq "price"}{include file="buttons/sort_pointer.tpl" dir=$search_prefilled.sort_direction}{/if}{$lng.lbl_price} ({$config.General.currency_symbol})</TD>

add this

<td>Weight</td>

then find

<TD><INPUT type="text" size="9" maxlength="15" name="posted_data[{$products[prod].productid}][price]" value="{$products[prod].price}"{if $products[prod].is_variant eq 'Y'} readonly{/if}></TD>

add

<TD><INPUT type="text" size="9" maxlength="15" name="posted_data[{$products[prod].productid}][weight]" value="{$products[prod].weight}"></td>

then find in your include/process_product.php

# Perform SQL query to update products

if (!empty($update)) db_query("UPDATE $sql_tbl[products] SET ".implode(",", $update)." WHERE productid='$k'");[/code]

right after that paste

# Modify weight
if (isset($v["weight"])) {db_query("UPDATE $sql_tbl[products] SET weight='".doubleval($v["weight"])."'WHERE productid='$k'");}

That's it, do a multiple product search and you'll see the weight column displayed on the right. Change any weights you want, click on update and it's done. Really saves time!
__________________
Gary M. Twing
Eagle Mountain Outfitters
eaglemtnoutfitters.com
Version 4.3.0 Gold
4.4.4 in operibus
Reply With Quote
  #2  
Old 05-16-2010, 02:04 PM
 
BAlexander BAlexander is offline
 

Member
  
Join Date: Mar 2010
Posts: 24
 

Default Re: Display & Update Weights in Product Search List - v4.3.0

Thanks for this. I have 4.3.1 and in the product search options trying to search for products with zero weight is not working. While I cannot update the weight from the weight column created by this addition at lease I can check the categories and see if any products have slipped in with zero weight.
__________________
4.6.4
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 04:01 PM.

   

 
X-Cart forums © 2001-2020