Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Customer Add Product


408 replies to this topic

#1 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 01 February 2005, 23:03

This contribution make ability to customer add products to your shop.
Products must be approve by administrator.

Download here

Edited by Johnson, 04 February 2005, 12:38.


#2 mujina

  • Community Member
  • 176 posts
  • Real Name:mujina

Posted 02 February 2005, 11:59

empo, on Feb 2 2005, 12:03 AM, said:

This contribution make ability to customer add products to your shop.
Products must be approve by administrator.

<{POST_SNAPBACK}>


Hi Maxim!!

I've tested your contribution on the live site and it's amazing!!! I sell books thus it is really usefull for me! Thanks for your work, I'll install it as soon as possible and I'll post my comments.

Is it possible to give access only for a group of customers?

Thanks for sharing this contribution! :thumbsup:

Edited by mujina, 02 February 2005, 11:59.

OSC2.2

#3 jimtsik

  • Community Member
  • 120 posts
  • Real Name:DIMITRIS TSICHLAS
  • Location:Greece Athens

Posted 02 February 2005, 12:40

pLEASE HELP ME WITH THE INSTALLATION .

i GET THIS ERROR MESSAGE WHEN I'M TRYING TO GO AT THE ACCOUNT PAGE .

Fatal error: Call to a member function on a non-object in /home/khposgr/public_html/shop/account.php on line 68

I 'VE FOLLOWED ALL THE INSTRUCTIONS STEP BY STEP .....

#4 DuAel

  • Community Member
  • 3 posts
  • Real Name:Emmanuel Ruhnau

Posted 02 February 2005, 15:20

Good Idea !

How do you manage the categories ?
Is it the customer who choose one, or the administrator ?

How about something like : "Manufacturers Add Product" ? Is it possible to manage that with your contribution ?

#5 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 02 February 2005, 20:41

jimtsik, on Feb 2 2005, 08:40 AM, said:

pLEASE HELP ME WITH THE INSTALLATION .

i GET THIS ERROR MESSAGE WHEN I'M TRYING TO GO AT THE ACCOUNT PAGE .

Fatal error: Call to a member function on a non-object in /home/khposgr/public_html/shop/account.php on line 68

I 'VE FOLLOWED ALL THE INSTRUCTIONS STEP BY STEP .....

<{POST_SNAPBACK}>



strange at this line regular oscom code
<?php
if ($messageStack->size('account') > 0) {
?>
what version of shop your use???

#6 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 02 February 2005, 20:45

DuAel, on Feb 2 2005, 11:20 AM, said:

Good Idea !

How do you manage the categories ?
Is it the customer who choose one, or the administrator ?

How about something like : "Manufacturers Add Product" ? Is it possible to manage that with your contribution ?

<{POST_SNAPBACK}>

1.Customer cant manage categories he able only add new product to any category
2.About Manufacturers it`s posible and i will do it in next update.

#7 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 02 February 2005, 22:40

New ability added:
Adiministrator can decide who can add new products

Download:
http://www.oscommerce.com/community/contributions,2890

#8 jimtsik

  • Community Member
  • 120 posts
  • Real Name:DIMITRIS TSICHLAS
  • Location:Greece Athens

Posted 03 February 2005, 07:02

empo, on Feb 2 2005, 10:41 PM, said:

strange at this line regular oscom code
<?php
  if ($messageStack->size('account') > 0) {
?>
what version of shop your use???

<{POST_SNAPBACK}>


I use 2.1 ( shop is the root directory ) and not catalog .
what i have to do ?
any ideas ?

the page account_add.php is working by it's own , but when i push preview , something is not going well at upload.cgi .
Maybe some functions that are not at 2.1 ...... ???

#9 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 03 February 2005, 07:28

in readme file i write:
This contribution is compatible with OsCommerce 2.2 MS2.

#10 John Doswell

  • Team Member
  • 456 posts
  • Real Name:John Doswell
  • Gender:Male

Posted 03 February 2005, 11:31

hi,
i have installed the constribution and everything is working in admin and catalog but when i add a product as a customer it gets added but when click on the link the product is not found...

is it just me ???

greetz john

#11 John Doswell

  • Team Member
  • 456 posts
  • Real Name:John Doswell
  • Gender:Male

Posted 03 February 2005, 11:56

ups... also if i go in to categories in admin all my products dont show up :-(

greetz john

#12 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 03 February 2005, 15:51

RobinsonDixon, on Feb 3 2005, 07:56 AM, said:

ups... also if i go in to categories in admin all my products dont show up :-(

greetz john

<{POST_SNAPBACK}>


did you do this??
4.
Execute Sql command:
INSERT INTO `customers` ( `customers_id` , `customers_gender` , `customers_firstname` , `customers_lastname` , `customers_dob` , `customers_email_address` , `customers_default_address_id` , `customers_telephone` , `customers_fax` , `customers_password` , `customers_newsletter` )
VALUES ('0', 'm', 'Administrator', '', '0000-00-00 00:00:00', '', '0', '', NULL , '', NULL);

#13 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 03 February 2005, 16:00

Sometimes mysql change customers_id from 0 to another number
so u need to use phpmyadmin and check that customers_id for administrator are 0!!!!!

#14 mujina

  • Community Member
  • 176 posts
  • Real Name:mujina

Posted 03 February 2005, 18:38

Hi Maxim!

Is it possible to send an email to a DEFINED CONTACT each time a new product is entered ?

Edited by mujina, 03 February 2005, 18:39.

OSC2.2

#15 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 04 February 2005, 11:27

New function added:
Admin get email notification
Onfly thumbnail pictures 100x100 by default
Also some minor bug fixed

#16 Marg

  • Community Member
  • 160 posts
  • Real Name:Marg

Posted 04 February 2005, 14:04

Could you tell us the specific changes in the categories.php in admin? My file has 2550 lines and I am not seeing the changes you made.
Thanks in advance,
Marg

#17 empo

  • Community Member
  • 109 posts
  • Real Name:maxim
  • Gender:Male
  • Location:Сибирь

Posted 04 February 2005, 15:47

Ok i will do it

#18 Marg

  • Community Member
  • 160 posts
  • Real Name:Marg

Posted 04 February 2005, 17:12

Thank you!
Marg

#19 Marg

  • Community Member
  • 160 posts
  • Real Name:Marg

Posted 04 February 2005, 20:12

Open admin/categories.php...
Find:
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_CATEGORIES_PRODUCTS; ?></td>
Add below:
<td class="dataTableHeadingContent" align="left"><?php echo TABLE_HEADING_CUSTOMER; ?></td>

Find:
<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, tep_get_path($categories['categories_id'])) . '">' . tep_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;<b>' . $categories['categories_name'] . '</b>'; ?></td>
<td class="dataTableContent" align="center">&nbsp;</td>
Add Below:
 <td class="dataTableContent" align="center">&nbsp;</td>

Find:
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
    } else {
      $products_query = tep_db_query("select p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");
Replace with:
      $products_query = tep_db_query("select p.products_id,p.customer_id,c.customers_firstname,c.customers_lastname, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p,".TABLE_CUSTOMERS." as c, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and c.customers_id = p.customer_id  and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . tep_db_input($search) . "%' order by pd.products_name");
    } else {
      $products_query = tep_db_query("select p.products_id,p.customer_id,c.customers_firstname,c.customers_lastname, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_CUSTOMERS . " as c , " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and c.customers_id = p.customer_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by pd.products_name");

Find:
<td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products['products_id'] . '&action=new_product_preview&read=only') . '">' . tep_image(DIR_WS_ICONS . 'preview.gif', ICON_PREVIEW) . '</a>&nbsp;' . $products['products_name']; ?></td>
Add Below:
<? if ($products['customer_id']!=0){?><td class="dataTableContent"><?php echo '<a href="' . tep_href_link(FILENAME_CUSTOMERS, 'selected_box=customers&page=1&cID=' . $products['customer_id'] . '&action=edit') . '">' . $products['customers_firstname'].' '.$products['customers_lastname']; ?></a></td><?}else { echo '<td class="dataTableContent">'.ADDED_ADMIN.'</td>';} ?>

These are the changes with a clean version of admin/categories.php.
Yours may be different.

Marg

Edited by Marg, 04 February 2005, 20:13.


#20 bugzmaster

  • Community Member
  • 5 posts
  • Real Name:hasan genis

Posted 06 February 2005, 13:07

Hello, at first i want to thank you for the great contribution. Its that what i need for my shop.

I use the latest version of your customer add product, and did the things you wrote in the readme.txt till the last point

14.
    ## Open file: popup_image.php  at line :36
    ## Replace line 36 with this code :
               <? if (is_file(DIR_WS_IMAGES ."thumb/".$products['products_image'])){$temp="thumb/";}else{$temp=NULL;}?>
               <?php echo tep_image(DIR_WS_IMAGES .$temp. $products['products_image'], $products['products_name']); ?>

because i have in my popup_image.php

  require('includes/application_top.php');

  $navigation->remove_current_page();

  $products_query = tep_db_query("select pd.products_name, p.products_image, p.products_image_lrg, p.products_image_xl_1, p.products_image_xl_2, p.products_image_xl_3, p.products_image_xl_4, p.products_image_xl_5, p.products_image_xl_6 from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'");
  $products = tep_db_fetch_array($products_query);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo $products['products_name']; ?></title>
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
<script language="javascript"><!--
var i=0;
function resize() {
  if (navigator.appName == 'Netscape') i=40;
  if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
  self.focus();
}
//--></script>
</head>
<body onload="resize();">
<?php              // LINE 36
           if (($HTTP_GET_VARS['image'] ==0) && ($products['products_image_lrg'] != '')) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_lrg'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } elseif ($HTTP_GET_VARS['image'] ==1) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_1'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } elseif ($HTTP_GET_VARS['image'] ==2) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_2'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } elseif ($HTTP_GET_VARS['image'] ==3) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_3'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } elseif ($HTTP_GET_VARS['image'] ==4) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_4'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } elseif ($HTTP_GET_VARS['image'] ==5) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_5'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } elseif ($HTTP_GET_VARS['image'] ==6) {
     echo tep_image(DIR_WS_IMAGES . $products['products_image_xl_6'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     } else
     echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
     ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

What should i DO ?
I use I use the the contrib : UltraPics v1.1, WYSIWYG HTML Editor, Image Uploaded
HTML Newsletter, HTML Email, DEFINE MAIN PAGE....

And i have another question too, i use the Image Uploader, is it possible that the users dont use it when they add product `? and use only the standard oscommerce image upload function ? because i think that they may have access to my image directory ? and can change or delete my pictures from the store ...

hope ou can help me because i need your contribution !!!

Thanks a lot
bugzmaster