View Single Post
  #19  
Old 11-18-2007, 01:50 AM
  scoobie's Avatar 
scoobie scoobie is offline
 

Advanced Member
  
Join Date: Dec 2006
Location: Sydney
Posts: 84
 

Default 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
Reply With Quote