| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Direct access to orders and items | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||
|
|||||||
Re: Direct access to orders and items
im not sure, its a simple expansion of the built in search function. i dont have 4.1 though.
__________________
version 4.0.17 |
|||||||
#12
|
|||||||||
|
|||||||||
Re: Direct access to orders and items
Works perfectly in 4.1.4 - thanks.
I have removed the "Submit" buttons though as I usually just press the enter key (also means that less space is taken on the page). My code is: <form action="order.php"> Order No.<input type="text" name="orderid" onclick="find"> </form> <form action="product_modify.php"> Prod. ID<input type="text" name="productid" onclick="find"> </form>
__________________
X-Cart Gold | v 4.0.18 | Unix | php 4.3 | phpMyAdmin 2.8.0.3 | |
|||||||||
#13
|
|||||||||
|
|||||||||
Re: Direct access to orders and items
And you can put the code into admin/menu_admin.tpl for 4.1.x users.
__________________
Carl Tice X-Cart 4.6.6 X-Payments 3.0 ReBOOT 3.4.1 PHP 5.6.30 MySQL 5.6.35 Linux 2.6.32-042stab120.18 ionCube PHP Loader v4.7.3 Perl 5.10.1 |
|||||||||
#14
|
|||||||
|
|||||||
Re: Direct access to orders and items
4.1.8
I put Audioline's handy mod into one of the standard menu boxes as follows: 1. Create new file admin/quick_find.tpl Code:
Code:
Code:
3. Create a new language variable lbl.quick_find with whatever name you choose. (eg "Quick Find") Thanks Audioline.
__________________
Andrew Gadsden xcart 4.1.8 [unix] http://www.allabouttea.co.uk The home of Tea on the Web - forum members please use code XCART-77 for a 10% discount! |
|||||||
#15
|
|||||||
|
|||||||
Re: Direct access to orders and items
To have this in the header bar you just make these simple changes. I put this in my header bar since I already have to scroll up & down for the left menu. It has enough in it right now.
In admin_head.tpl change this code: Code:
To this code: Code:
Here is a picture: http://www.tnpaintballers.com/images/xcart_mods/admin_header_bar_mod.jpg
__________________
Version 4.1.8 TN Paintballers LLC 914 N Charles G Seivers Blvd Clinton, TN 37716 865-457-8000 www.tnpaintballers.com |
|||||||
#16
|
|||||||
|
|||||||
Re: Direct access to orders and items
Quote:
Quote:
If you pull up an item in your database viewing it as a customer would you see something like this in the URL: product.php?productid=16134, but the SKU you assigned this product would be SKU1234 or just 1234. With the way this Direct access to orders worked initially is that you had to enter that longer 16134 as in the example above. If you needed to edit an item on your site you wouldn't know that number, but you would know the SKU number you assigned the item. With this mod I have posted below you can select whether you want to search by your SKU number or that longer number which is the productid for the database. For you advance users this allows you to search by either the productid = PID or productcode = SKU. First thing is add these to input fields to the form to search for products Quote:
In this file /include/product_modify.tpl add this code Quote:
Right below this code Quote:
http://www.tnpaintballers.com/images/xcart_mods/admin_header_bar_mod_2.jpg
__________________
Version 4.1.8 TN Paintballers LLC 914 N Charles G Seivers Blvd Clinton, TN 37716 865-457-8000 www.tnpaintballers.com |
|||||||
#17
|
|||||||||
|
|||||||||
Re: Direct access to orders and items
Sweet ... Nice addition ..
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!) Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x Multiple Instances of X-Cart MySQL 5.6.37 CentOS 7.4 Chamber Internet - Lancashire, United Kingdom http://www.chamberelancs.co.uk |
|||||||||
#18
|
|||||||
|
|||||||
Re: Direct access to orders and items
You will need to add this IF statement to hide these boxes if the admin isn't logged in. If not then anybody that gets to your Admin panel will see these input boxes.
Add this right before the opening <form> line of each form. Code:
Add this right after the closing </form> line of each form. Code:
If you just want to copy & past then replace each form of the previous code I gave with this: This is the Order Search form Code:
This is the Product Search form Code:
__________________
Version 4.1.8 TN Paintballers LLC 914 N Charles G Seivers Blvd Clinton, TN 37716 865-457-8000 www.tnpaintballers.com |
|||||||
#19
|
|||||||||
|
|||||||||
Re: Direct access to orders and items
Hi,
I've implemented this mod with little hiccup... the order bit works but not the product bit. When I enter in my sku, my url gets translated to:- https://www.womansworld.com.au/dev/xcart/admin/product_modify.php?search_id=D1429&search_types=1 I can see the url is wrong and the word admin should be the word provider. My code in include/product_modify.php is this:- ini_set("memory_limit", "32M"); function get_productid($product_code) { $category_query = db_query("SELECT productid FROM xcart_products WHERE productcode = '" . (int)$product_code . "'"); $category = mysql_fetch_array($category_query, MYSQL_ASSOC); return $category['productid']; } if ($HTTP_POST_VARS['search_types'] == 1){ ?> <script type="text/javascript" language="JavaScript"><!-- setTimeout('Redirect()',500); function Redirect() { location.href = '../provider/product_modify.php?productid=<?PHP echo get_productid($HTTP_POST_VARS['search_id']) ?>'; } // --></script> <?PHP }elseif ($HTTP_POST_VARS['search_types'] == 2){ ?> <script type="text/javascript" language="JavaScript"><!-- setTimeout('Redirect()',500); function Redirect() { location.href = '../provider/product_modify.php?productid=<?PHP echo $HTTP_POST_VARS['search_id'] ?>'; } // --></script> <?PHP } The code in my admin_head.tpl for the order bit is:- {if $login ne ''} <form action="product_modify.php"> Item ID:<input type="text" name="search_id"><input type="submit" value="find"> <input type="radio" id="search_types" name="search_types" value="1" checked="checked" />{$lng.lbl_sku} <input type="radio" id="search_types" name="search_types" value="2" />PID </form> {/if} I am not sure why I am getting a different url and how to fix it?
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox) PHP 4.4.4 SQL 4.1.21 Linux O/S |
|||||||||
#20
|
|||||||||
|
|||||||||
Re: Direct access to orders and items
Hi,
I finally got my code to work. I had <input type="submit" value="find"> in the wrong spot in head_admin.tpl. However if anyone is interested, I had to remove the reference to (int) in the product_modify.php file. For me it was not appending the productid to the url so it couldn't find the product. My php select statement looks like this now:- $category_query = db_query("SELECT productid FROM xcart_products WHERE productcode = '" . $product_code . "'");
__________________
X-CART 4.1.8 (Add-Ons: onSale, CDSEO, AOM, Thickbox) PHP 4.4.4 SQL 4.1.21 Linux O/S |
|||||||||
|
|||
X-Cart forums © 2001-2020
|