Jump to content
empo

Customer Add Product

Recommended Posts

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

Need help to work 2 contributions together in includes/aplication_top.php:

 

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

Share this post


Link to post
Share on other sites

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?

 

 

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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

@@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


:|: Was this post helpful ? Click the LIKE THIS button :|:

 

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

Share this post


Link to post
Share on other sites

Help I am getting an error when I go to the admin page. Looks like the file column_right.php is missing. I have tried searching the zip file I recieved and it is not there.

 

ning: require(includes/column_right.php) [function.require]: failed to open stream: No such file or directory in /home/shopobxc/public_html/account.php on line 236

 

 

Warning: require(includes/column_right.php) [function.require]: failed to open stream: No such file or directory in /home/shopobxc/public_html/account.php on line 236

Fatal error: require() [function.require]: Failed opening required 'includes/column_right.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/shopobxc/public_html/account.php on line 236

Share this post


Link to post
Share on other sites

Read posts #407 and #408

 

The contribution is written for osC2.2 and you've installed it on a 2.3 version most likely.


If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you.

 

"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."

- Me -

 

"Headers already sent" - The definitive help

 

"Cannot redeclare ..." - How to find/fix it

 

SSL Implementation Help

 

Like this post? "Like" it again over there >

Share this post


Link to post
Share on other sites

Hi Henry, I'm looking for an updated version for 2.3.x (as I'm fully up tot date with 2.3.3.4 and probably not moving to 2.4)......if not available I will try to create it myself...

Share this post


Link to post
Share on other sites

Hi Henry, I'm looking for an updated version for 2.3.x (as I'm fully up tot date with 2.3.3.4 and probably not moving to 2.4)......if not available I will try to create it myself...

 

Just forget my request....took me some time to convert some php code, but got 1.4.3 working on osc 2.3.3.4

Share this post


Link to post
Share on other sites

Just forget my request....took me some time to convert some php code, but got 1.4.3 working on osc 2.3.3.4

 

Are you now going to add a new package to the addond area.


REMEMBER BACKUP, BACKUP AND BACKUP

Get the latest Responsive osCommerce CE (community edition) here

It's very easy to over complicate what are simple things in life

Share this post


Link to post
Share on other sites

Are you now going to add a new package to the addond area.

 

Depending on the needs!!

I updated the php code on the fly, moreless debugging step by step, which i'm still doing as the layout is not 100% inline with the 2.3.3.4 version (almost done), but the addon itself is functional as it suppose to be.

Next to that I did not register all my changes...so need to dig into the code to see what i changed.....

Share this post


Link to post
Share on other sites

Hi Maxim,

 

Firstly, thank you for this great contribution - it is fantastic!

 

Secondly, I cannot get TinyMCE to work with it - it's driving me nuts! Any ideas?

 

Thirdly, did you ever do a Manufacturers Add Product one? I was wondering if you could help me as I have created a monster in that I am trying to get my customers to be able to add manufacturers. I have written the forms but now struggling with the functionality. Would you be willing to look into it for me?

 

I don't get notifications from this site so please feel free to email me on hello at womensbusinessclub.co.uk

 

Have a lovely weekend.

Angela

account_add.php

Share this post


Link to post
Share on other sites

Hi Angela,

 

Maxim stopped suporting this and was last active on this form on Sept 2009.

The communitie took over.

 

I will have a look at TinyMCE later as I also want to add it to the CAP.

 

Cheers, Renzo

Share this post


Link to post
Share on other sites

Hello
A very nice contribution! ! ! Congratulations!
The contribution works very well with oscommerce2.2rc1 in php 4.3.10.
On the other hand, with oscommerce2.2.rc2a and php 5.5, I am redirected to the index at the time of the preview.

None of the links you have mentioned are working.
How to do.
Thank you

Edited by burt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×