X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Show extra field in admin search results (https://forum.x-cart.com/showthread.php?t=69821)

mcanitano 08-15-2014 11:16 AM

Show extra field in admin search results
 
We are currently trying to show an extra field in the search results on the admin side. We have created a new column for this, but cannot it to work.

Our extra field is "Cost" (what it costs us to purchase the product if we do not have it in stock) and is very helpful for our Ordering Department.

We want to be able to quickly search for an item, see if we have it in stock, and edit/see the Cost of the item just as if we were editing the Selling Price.

We are using X-Cart 4.5.5 GOLD and have gotten nowhere. We've tried following the threads to implement it onto the invoice but it does not work the same in search results.

mcanitano 09-29-2014 10:38 AM

Re: Show extra field in admin search results
 
UPDATE: We tried to follow this post: http://forum.x-cart.com/showthread.php?t=63314

But were unable to get this to work. Our issue is that we can't get the foreach loop to pull an extra field value from it's corresponding product, or any product in that case.

mcanitano 03-03-2015 07:09 AM

Re: Show extra field in admin search results
 
Bump, has anyone else ever tried to do this?

chamberinternet 03-03-2015 07:19 AM

Re: Show extra field in admin search results
 
Hi McAnitano...

I'm not sure if this is possible as i've just enabled the Debug Console on an XC 4.5 installation and the {$products} variable isn't outputting the extra fields data for each product.

Some of the PHP Code will need to be adjusted to grab the extra field data.

mcanitano 03-03-2015 09:26 AM

Re: Show extra field in admin search results
 
Well, we took your advice and did this on the PHP side, except not with Extra Fields.

We custom added a new data field "dealer_cost" to the xcart_products array using phpMyAdmin, then went into include/product_modify.php and added
Code:

                        'dealer_cost'      => $dealer_cost,

after
Code:

            'title_tag'        => $title_tag,

around line 900

and added to main/product_details.tpl after List Price

Code:

<tr>
  {if $geid ne ''}<td width="15" class="TableSubHead"><input type="checkbox" value="Y" name="fields[list_price]" /></td>{/if}
  <td class="FormButton" nowrap="nowrap">{$lng.lbl_dealer_cost} <span class="Text">({$config.General.currency_symbol}):</span></td>
  <td class="ProductDetails"><input type="text" name="dealer_cost" size="18" value="{$product.dealer_cost|formatprice|default:$zero}" /></td>
</tr>


chamberinternet 03-03-2015 11:39 PM

Re: Show extra field in admin search results
 
Ah OK ... Thats fine.
So are you still having trouble? Or are you all set?

mcanitano 03-05-2015 05:00 AM

Re: Show extra field in admin search results
 
We're all set, works fine the way we did it!


(custom extra field in PHP).

Thanks for the help.


All times are GMT -8. The time now is 08:56 PM.

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