View Single Post
  #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