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)
-   -   updating weight through admin modify products list search re (https://forum.x-cart.com/showthread.php?t=23912)

Audiolines 08-07-2006 11:56 AM

updating weight through admin modify products list search re
 
in reference to this:

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

I added the ability to change the product weights from the modify products search results page so you can go through and change the weight more quickly.

find your skin1/main/products.tpl
first right after
Code:

<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
Code:

<td>Weight</td>

then find



Code:

<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
Code:

<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
Code:

# Perform SQL query to update products
                                if (!empty($update))
                                        db_query("UPDATE $sql_tbl[products] SET ".implode(",", $update)." WHERE productid='$k'");


right after that you put
Code:

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


let me know if this works for you. If you are better at xcart than me,Can you check over it to see if i did this correctly :D


All times are GMT -8. The time now is 10:51 AM.

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