Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Add Product


empo

Recommended Posts

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

Link to comment
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 .....

Link to comment
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 ?

Link to comment
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???

Link to comment
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.

Link to comment
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 ...... ???

Link to comment
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);

Link to comment
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
Link to comment
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

Link to comment
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'); ?>

Link to comment
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.

Link to comment
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:[email protected]

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...