Jump to content
empo

Customer Add Product

Recommended Posts

This contribution make ability to customer add products to your shop.

Products must be approve by administrator.

 

Download here

Edited by Johnson

Share this post


Link to post
Share on other sites
This contribution make ability to customer add products to your shop.

Products must be approve by administrator.

 

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

OSC2.2

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 ?

Share this post


Link to post
Share on other sites
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 .....

 

 

strange at this line regular oscom code

<?php

if ($messageStack->size('account') > 0) {

?>

what version of shop your use???

Share this post


Link to post
Share on other sites
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 ?

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.

Share this post


Link to post
Share on other sites
strange at this line regular oscom code

<?php

  if ($messageStack->size('account') > 0) {

?>

what version of shop your use???

 

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

Share this post


Link to post
Share on other sites

in readme file i write:

This contribution is compatible with OsCommerce 2.2 MS2.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
ups... also if i go in to categories in admin all my products dont show up :-(

 

greetz john

 

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);

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Hi Maxim!

 

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

Edited by mujina

OSC2.2

Share this post


Link to post
Share on other sites

New function added:

Admin get email notification

Onfly thumbnail pictures 100x100 by default

Also some minor bug fixed

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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> <b>' . $categories['categories_name'] . '</b>'; ?></td>
<td class="dataTableContent" align="center"> </td>

Add Below:

 <td class="dataTableContent" align="center"> </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> ' . $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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

1.In my contribution customer use default oscommerce upload class (a little bit changed)so they cant use Image uploader

2.And for sure they cant delete files or upload files which are not images

 

3.Try to use this code:

 

<?
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();">
<? if (is_file(DIR_WS_IMAGES ."thumb/".$products['products_image'])){$temp="thumb/";}else{$temp=NULL;}?>

<?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 .$temp. $products['products_image'], $products['products_name'], LARGE_IMAGE_WIDTH, LARGE_IMAGE_HEIGHT);
   ?>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

Share this post


Link to post
Share on other sites

Your contribution sounds really great and is something that I could really use. However, I'm having some difficulties with seeing how it works.

 

I've gone out to your sample site (http://www.procreator.info/shop/) to see how the customer can add a product. I can't seem to see where the product is added. Also, where does the administrator go to approve the new product?

 

Thanks for your help.

Share this post


Link to post
Share on other sites
Your contribution sounds really great and is something that I could really use.  However, I'm having some difficulties with seeing how it works.

 

I've gone out to your sample site (http://www.procreator.info/shop/) to see how the customer can add a product.  I can't seem to see where the product is added.  Also, where does the administrator go to approve the new product?

 

Thanks for your help.

For see how this contribute work you need to login in with

http://www.procreator.info/shop/

User:test@test.com

Pass:testing

then go to my account

after that you add new product this product must be approved by administrator

so go to admin section and approve it after this you will see your new product

Share this post


Link to post
Share on other sites

New function added:

Owner of product get notification of new review for each product he added

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

×