X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Display & Update Weights in Product Search List - v4.3.0 (https://forum.x-cart.com/showthread.php?t=51858)

gtwing 01-19-2010 11:20 AM

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!:D/

BAlexander 05-16-2010 02:04 PM

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.


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

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