Dear Empo,
Thanks a lots of this great contribution. I finally installed it, i can see it in admin and able to make approval. but when i go to Administrator, there is a error message on the top:
Warning: reset() [function.reset]: Passed variable is not an array or object in /home/hongkon2/public_html/admin/includes/classes/object_info.php on line 17
Warning: Variable passed to each() is not an array or object in /home/hongkon2/public_html/admin/includes/classes/object_info.php on line 18
and when i clicked " ADD PRODUCT" and "EDIT PRODUCT" , it appeared the error message:
Fatal error: Cannot redeclare tep_show_category() (previously declared in /home/hongkon2/public_html/includes/header.php:160) in /home/hongkon2/public_html/includes/boxes/categories.php on line 60
below is the /includes/boxes/categories.php
<?php
/*
$Id: categories.php,v 1.25 2003/07/09 01:13:58 hpdl Exp $
Welcome to MagC Gifts Store - Unique gift shopping online, jewelry gift shop
http://www.magcgifts.com
Copyright © 2006 MagC Gifts Store
Released under the GNU General Public License
*/
function tep_show_category($counter) {
global $tree, $categories_string, $cPath_array;
for ($i=0; $i<$tree[$counter]['level']; $i++) {
$categories_string .= " ";
}
$categories_string .= '<a href="';
if ($tree[$counter]['parent'] == 0) {
$cPath_new = 'cPath=' . $counter;
} else {
$cPath_new = 'cPath=' . $tree[$counter]['path'];
}
$categories_string .= tep_href_link(FILENAME_DEFAULT, $cPath_new) . '">';
if (isset($cPath_array) && in_array($counter, $cPath_array)) {
$categories_string .= '<b>';
}
// display category name
$categories_string .= $tree[$counter]['name'];
if (isset($cPath_array) && in_array($counter, $cPath_array)) {
$categories_string .= '</b>';
}
if (tep_has_category_subcategories($counter)) {
$categories_string .= '->';
}
$categories_string .= '</a>';
if (SHOW_COUNTS == 'true') {
$products_in_category = tep_count_products_in_category($counter);
if ($products_in_category > 0) {
$categories_string .= ' (' . $products_in_category . ')';
}
}
$categories_string .= '<br>';
if ($tree[$counter]['next_id'] != false) {
tep_show_category($tree[$counter]['next_id']);
}
}
?>
<!-- categories //-->
<tr>
<td>
<?php
$info_box_contents = array();
$info_box_contents[] = array('text' => BOX_HEADING_CATEGORIES);
new infoBoxHeading($info_box_contents, true, false);
$categories_string = '';
$tree = array();
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '0' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
while ($categories = tep_db_fetch_array($categories_query)) {
$tree[$categories['categories_id']] = array('name' => $categories['categories_name'],
'parent' => $categories['parent_id'],
'level' => 0,
'path' => $categories['categories_id'],
'next_id' => false);
if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $categories['categories_id'];
}
$parent_id = $categories['categories_id'];
if (!isset($first_element)) {
$first_element = $categories['categories_id'];
}
}
//------------------------
if (tep_not_null($cPath)) {
$new_path = '';
reset($cPath_array);
while (list($key, $value) = each($cPath_array)) {
unset($parent_id);
unset($first_id);
$categories_query = tep_db_query("select c.categories_id, cd.categories_name, c.parent_id from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.parent_id = '" . (int)$value . "' and c.categories_id = cd.categories_id and cd.language_id='" . (int)$languages_id ."' order by sort_order, cd.categories_name");
if (tep_db_num_rows($categories_query)) {
$new_path .= $value;
while ($row = tep_db_fetch_array($categories_query)) {
$tree[$row['categories_id']] = array('name' => $row['categories_name'],
'parent' => $row['parent_id'],
'level' => $key+1,
'path' => $new_path . '_' . $row['categories_id'],
'next_id' => false);
if (isset($parent_id)) {
$tree[$parent_id]['next_id'] = $row['categories_id'];
}
$parent_id = $row['categories_id'];
if (!isset($first_id)) {
$first_id = $row['categories_id'];
}
$last_id = $row['categories_id'];
}
$tree[$last_id]['next_id'] = $tree[$value]['next_id'];
$tree[$value]['next_id'] = $first_id;
$new_path .= '_';
} else {
break;
}
}
}
tep_show_category($first_element);
$info_box_contents = array();
$info_box_contents[] = array('text' => $categories_string);
new infoBox($info_box_contents);
?>
</td>
</tr>
<!-- categories_eof //-->
I am not good at this. don't know where is the problem.
Mag
Latest News: (loading..)
Customer Add Product
Started by empo, Feb 01 2005, 23:03
408 replies to this topic
#401
Posted 11 March 2011, 04:28
#402
Posted 12 March 2011, 06:26
Oooops...
I have gone through the whole thread, read all the replies and found out empo stop supporting the thread anymore. And Zane86 has sent some helpful posts. I carefully and correctly followed all the steps of the installation. But still got the error message, the parse one has been solved and i comment out some part of the box/category.php then finally i can see the cap contribution on my site, although the tep show error is not solved.
Ok, When i click the add product and add a product into it, then clicked preview , it redirect me to the index page, i have added the suggestion from Zane86, but still redirect me to index page. Just don't know what is going wrong.
and there are only two buttons in the add product page, " Preview " and " Back " , no upload image button or submit button. Besides the drop down button of calendar works well, the rest is
I am using RC2a version and installed cap 1.4.3. I am going to try to install it with RC1 to see whether is it working or not.
For sure the idea of this contribution is wonderful. but it is a pity i still cannot use it.
I have gone through the whole thread, read all the replies and found out empo stop supporting the thread anymore. And Zane86 has sent some helpful posts. I carefully and correctly followed all the steps of the installation. But still got the error message, the parse one has been solved and i comment out some part of the box/category.php then finally i can see the cap contribution on my site, although the tep show error is not solved.
Ok, When i click the add product and add a product into it, then clicked preview , it redirect me to the index page, i have added the suggestion from Zane86, but still redirect me to index page. Just don't know what is going wrong.
and there are only two buttons in the add product page, " Preview " and " Back " , no upload image button or submit button. Besides the drop down button of calendar works well, the rest is
I am using RC2a version and installed cap 1.4.3. I am going to try to install it with RC1 to see whether is it working or not.
For sure the idea of this contribution is wonderful. but it is a pity i still cannot use it.
#403
Posted 21 April 2011, 11:43
Is it possible to sell products that customers receive the commission?
#404
Posted 06 May 2011, 16:45
Hi,
please help me on how to transfer many products from a certain site one at a time?also how import/export product works?Give us instructions pls?need this respond ASAP!!!
Thank you...
please help me on how to transfer many products from a certain site one at a time?also how import/export product works?Give us instructions pls?need this respond ASAP!!!
Thank you...
#405
Posted 28 May 2011, 13:12
Need help to work 2 contributions together in includes/aplication_top.php:
1.from Product Quantity Drop Down Box in Product Info
2.from XSELL add_recommended product
Does anyone get these two to work together?. What could be the correct code??
1.from Product Quantity Drop Down Box in Product Info
// customer adds a product from the products page
case 'add_product' : if (isset($_POST['products_id']) && is_numeric($_POST['products_id'])) {
if (tep_has_product_attributes($_POST['products_id']) && PRODUCT_LIST_OPTIONS != 'true' && basename($PHP_SELF) != FILENAME_PRODUCT_INFO) tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $_POST['products_id']));
$add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1);
$cart->add_cart($_POST['products_id'], $cart->get_quantity(tep_get_uprid($_POST['products_id'], $_POST['id']))+$add_quantity, $_POST['id']);
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
2.from XSELL add_recommended product
// customer adds a product from the products page
case 'add_products' :
if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
$add_quantity = (isset($_POST['cart_quantity']) ? (int)$_POST['cart_quantity'] : 1);
if (isset($HTTP_POST_VARS['add_recommended'])) {
foreach ($HTTP_POST_VARS['add_recommended'] as $value) {
if (ereg('^[0-9]+$', $value)) {
$cart->add_cart($value, $cart->get_quantity(tep_get_uprid($value, $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
}
}
}
}
tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
break;
Does anyone get these two to work together?. What could be the correct code??
Edited by bhbilbao, 28 May 2011, 13:15.
#406
Posted 05 February 2012, 21:55
Zane86, on 01 July 2009, 08:22, said:
Hi there.
Im running osCommerce 2.2 RC2. Don't this Add-On work with that version?
I've installed it and tried, but when the customers add an product, and press Preview, he get sent to the starting page of the catalog. No product gets added.
Have i done anything wrong? Or is it not compatible with osCommerce 2.2 RC2?
Im running osCommerce 2.2 RC2. Don't this Add-On work with that version?
I've installed it and tried, but when the customers add an product, and press Preview, he get sent to the starting page of the catalog. No product gets added.
Have i done anything wrong? Or is it not compatible with osCommerce 2.2 RC2?
Did we get an answer to solve this issue? I am having the same problem, hit Preview, and I am sent back to starting page...
#407
Posted 18 May 2012, 16:18
Hi
Is this post still active, just need bit of help and advice more than help
Would this add on work on a 2.3.1 store or does it need to be converted and secondly, is it easy to convert to 2.3 if it does need converting
Thanks in advance
Ian
Is this post still active, just need bit of help and advice more than help
Would this add on work on a 2.3.1 store or does it need to be converted and secondly, is it easy to convert to 2.3 if it does need converting
Thanks in advance
Ian
#408
Posted 18 May 2012, 17:55
@ianhaney
It would need to be updated to work with v2.3.1. The standard updates would apply as well as some code edits for the administrators access tables.
Chris
It would need to be updated to work with v2.3.1. The standard updates would apply as well as some code edits for the administrators access tables.
Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:
:|: Click Here to learn how I can help you with custom coding, add ons, security and templates :|:
:|: Need an Area Calculator, Pre-Paid Account, Virtual Pin, Auction or Layaway Add on ? Click Here :|:
:|: Click Here to learn how I can help you with custom coding, add ons, security and templates :|:
:|: Need an Area Calculator, Pre-Paid Account, Virtual Pin, Auction or Layaway Add on ? Click Here :|:
#409
Posted 18 May 2012, 18:08
Ok cool thank you Chris appreciate it














