Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Customer Add Product


empo

Recommended Posts

I searched the form but could not find a solution for this problem.

 

I've installed CAP and it works well, but when the Categories are displayed in the first tab, the sort order is wrong. The categories are sorted alphabetically by a mix of categories and subcategories ... which makes it difficult for customers to find the proper slot to place a product.

 

I would like them sorted the way they appear in the Categories sidebar

Category A

Category A--> Subcategory A1

Category A--> Subcategory A2

Category A--> Subcategory A3

Category B

Category B--> Subcategory B1

Category B -> Subcategory B2

etc.

 

Is there a way to sort them alphabetically by Category then subcategory?

 

I assume changes would need to be made to the following code (in account_add.php)but do not know php well enough to solve this alone.

 

thanks in advance

larry

 

==========

while ($categories = tep_db_fetch_array($categories_query)) {

//echo $categories['parent_id'];

$parent_id = $categories['parent_id'];

if ($parent_id==0)

{

$categories_array[] = array('id' => $categories['categories_id'],

'text' => $categories['categories_name']);

} else {

$txt=NULL;

while ($parent_id!=0) {

//echo $parent_id;

$category_query = tep_db_query("select a.categories_id,parent_id, b.categories_name from " . TABLE_CATEGORIES . " as a," . TABLE_CATEGORIES_DESCRIPTION . " as b where a.categories_id = b.categories_id and a.categories_id = " . $parent_id . " and b.language_id = " . (int)$language_id . " order by categories_name");

$category = tep_db_fetch_array($category_query);

$txt .=$category['categories_name']."->" ;

$parent_id = $category['parent_id'];

//die($txt.$parent_id.$category['categories_id']);

}

$categories_array[] = array('id' => $categories['categories_id'],

'text' => $txt.$categories['categories_name']);

}

}

Edited by Dr.Tech
Link to comment
Share on other sites

  • 2 weeks later...
==========

while ($categories = tep_db_fetch_array($categories_query)) {

//echo $categories['parent_id'];

$parent_id = $categories['parent_id'];

if ($parent_id==0)

{

$categories_array[] = array('id' => $categories['categories_id'],

'text' => $categories['categories_name']);

} else {

$txt=NULL;

while ($parent_id!=0) {

//echo $parent_id;

$category_query = tep_db_query("select a.categories_id,parent_id, b.categories_name from " . TABLE_CATEGORIES . " as a," . TABLE_CATEGORIES_DESCRIPTION . " as b where a.categories_id = b.categories_id and a.categories_id = " . $parent_id . " and b.language_id = " . (int)$language_id . " order by categories_name");

$category = tep_db_fetch_array($category_query);

$txt .=$category['categories_name']."->" ;

$parent_id = $category['parent_id'];

//die($txt.$parent_id.$category['categories_id']);

}

$categories_array[] = array('id' => $categories['categories_id'],

'text' => $txt.$categories['categories_name']);

}

}

 

just above the piece you posted you should see

//print_r( $languages);
for ($i=0, $n=sizeof($languages); $i<$n; $i++) {
//echo $languages[$i]['directory'];
if ($languages[$i]['directory']==$language) $language_id=$languages[$i]['id'];
}
$categories_array = array(array('id' => '', 'text' => TEXT_NONE));
$categories_query = tep_db_query("select a.categories_id,parent_id, b.categories_name from " . TABLE_CATEGORIES . " as a," . TABLE_CATEGORIES_DESCRIPTION . " as b where a.categories_id = b.categories_id and b.language_id = " . (int)$language_id . " order by categories_name");

I changed the

(int)$language_id . " order by categories_name");

at the end to

(int)$language_id . " order by categories_id");

and got the result that your looking for.

 

I've noticed though, that when ever you go beyond 2 sub-categories, they get mixed up in this drop down box. It shows up like,

 subcat1->category->subcat2

instade of

category->subcat1->subcat2

can anyoone help me with this?

Link to comment
Share on other sites

No, my problem is that the category that the customer selected is not the category that the product shows up in. The added product always shows up in the top level and not the selected category. The second problem is, in the notification email to the admin. Where is says "New product was added to :", the category is blank.

 

Seso

 

This is a great contribution - my thanks!

 

I think I can help with your problem if it is still relevant.

Yeah, I noticed / have been trying to get the products to add into the correct category rather than just some in on top level. Here's a dirty but effective fix. Find the following line which adds the product "corresponding to category" in the relevant database table in account_add.php

 

-----------------

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$category_id . "')");

 

-----------------

 

Replace this with

 

-----------------

 

$chosencategory = $_POST['category_id'];

 

tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . $chosencategory . "')");

 

-----------------

 

This will revive the original category posted from the add product form (category_id) which appears to get lost between being posted / reaching the preview page / and being saved. Didnt find out where this happens, but this fix appears to work so didnt bother seaching further. Note there is no validation of this variable here - is there any security risk?

 

Also going to try to tie in this whole add products contrib with the affiliate sales contrib - so affiliates can add products too. Should be fun : )

 

Cheers

Link to comment
Share on other sites

When I upload image, I realized that original image is overwrote to new image file which is same file name, and original product image also changed to new product (w/ same image file name) image...

Edited by imcrazyjap
Link to comment
Share on other sites

Hi,

This seems to be a very useful contribution.

Does any one have a working example or any images of this module?

Which is the best version to use to install that you have tested and know that it all works.

 

Thanks in advance

Kunal :thumbsup:

Link to comment
Share on other sites

  • 2 weeks later...
Does the calender show up properly when you click on 'date available' in the account_add.php???

In my shop is shows up behind the Tabs so you can only see a piece of it!

Somebody already solved the problem so its in front ?

 

 

You need to add in a file called spiffycalender (or sounds similar, don't know right now) to add a z-index with value 5.

Read the complete thread and you'll find the answer.

Link to comment
Share on other sites

I' ve added this great brilliant contrib to my shop.

There are still some minor issues (like, admin can not change the image of the customers added product and also a sales report) but for the begining I can live with that.

 

What I really need right now is to validate the input data from the customer.

There are so many users how do not put in all required information. Posting the product data should be only possible if all required fields have been filed out.

 

1.) Do have anyone an idea how to implement the form validation into customer_add?

2.) My customers do need to accept the terms and policies, by activating a checkbox. Any idea how to put this into the customer_add.php`?

 

 

Thank you very much in advance

Link to comment
Share on other sites

  • 3 months later...

Just got one question about this contribution:

 

How does it work when someone buy the product thats getting sold?

Will the person that makes the sale get an email with the buyers email address? or will the sale report to me and will I have to deal with it afterwards?

 

PS:

Can the seller add download able products?

Link to comment
Share on other sites

  • 2 weeks later...

hi empo and marq, man can you specify where do i need to replace code in admin/categories.php i have many contributions installed and my admin/categories.php weight about 120kb, i noticed in first page there is some faq where to add/replace but this contrib have some time and i think code in categories.php has been changed since, so meaby you can specify lines where to add?

thanks in advice

 

// User add products

// User add products

Link to comment
Share on other sites

hi empo and marq, man can you specify where do i need to replace code in admin/categories.php i have many contributions installed and my admin/categories.php weight about 120kb, i noticed in first page there is some faq where to add/replace but this contrib have some time and i think code in categories.php has been changed since, so meaby you can specify lines where to add?

thanks in advice

 

// User add products

// User add products

Yikes... This was 2 years ago that I was involved... it'll take a bit to get my head around it again. I'll take a look and see if I can gather my thoughts!

Marg

Link to comment
Share on other sites

HI, I tried to get this to run once upon a time, permissions wouldnt let that happen then, So I'm attempting it again.

 

I think I got it for the most part, but when I am signed on as a customer and click the button to load an image,

I am bombarded with the following errors.

 

Warning: main(includes/functions//product_manage.php) [function.main]: failed to open stream: No such file or directory in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Warning: main(includes/functions//product_manage.php) [function.main]: failed to open stream: No such file or directory in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Warning: main(includes/functions//product_manage.php) [function.main]: failed to open stream: No such file or directory in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Fatal error: main() [function.require]: Failed opening required 'includes/functions//product_manage.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Does anyone know why I might be getting this, and how I can fix it?

Link to comment
Share on other sites

HI, I tried to get this to run once upon a time, permissions wouldnt let that happen then, So I'm attempting it again.

 

I think I got it for the most part, but when I am signed on as a customer and click the button to load an image,

I am bombarded with the following errors.

 

Warning: main(includes/functions//product_manage.php) [function.main]: failed to open stream: No such file or directory in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Warning: main(includes/functions//product_manage.php) [function.main]: failed to open stream: No such file or directory in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Warning: main(includes/functions//product_manage.php) [function.main]: failed to open stream: No such file or directory in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Fatal error: main() [function.require]: Failed opening required 'includes/functions//product_manage.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mycreati/public_html/boutique/account_add.php on line 14

 

Does anyone know why I might be getting this, and how I can fix it?

 

UPDATE: It's Ok I figured it out!! :P Funny what can happen when you neglect to add an entire page DOH!

Link to comment
Share on other sites

I am testing the cap contrib and it's good. On thing though. I would like to add some html text to instruct people who view the products , that they can not purchase the products through the cart. Also I would like the person listing to be able to use some html script Bold, Underline, Spaces, Email link and a couple of colours.

 

How can I get this to work ?

 

Nancy :D

Link to comment
Share on other sites

11.

## Open file: admin/customers.php at line :468(end)

## Add code :

<? require('customers_app.inc.php');?>

 

Can someone past the code snippets above/below where this gets inserted? It's not making sense on that lin number in my file and I don't see any related link in the store admin console.

 

 

What exactly does the Administrator added per the instructions do? Am I supposed to login to admin with that login (but there was no password?!?) or do I continue to use my pre-existing store admin login ?

Link to comment
Share on other sites

11.

## Open file: admin/customers.php at line :468(end)

## Add code :

<? require('customers_app.inc.php');?>

 

Can someone past the code snippets above/below where this gets inserted? It's not making sense on that lin number in my file and I don't see any related link in the store admin console.

What exactly does the Administrator added per the instructions do? Am I supposed to login to admin with that login (but there was no password?!?) or do I continue to use my pre-existing store admin login ?

 

 

This is where I have it,

. ENTRY_EMAIL_ADDRESS_ERROR_EXISTS;
} else {
  echo $customers_email_address . tep_draw_hidden_field('customers_email_address');
}
 } else {
echo tep_draw_input_field('customers_email_address', $cInfo->customers_email_address, 'maxlength="96"', true);
 }
?></td>
	  </tr>
	</table></td>
  </tr><?  require('customers_app.inc.php');?>
<?php
if (ACCOUNT_COMPANY == 'true') {

 

I'm not sure if it is exactly right or not. But my CAP system seems to work except for my calendar won't drop down. But I don't think that has anything to do with this snippit of code.

 

I'm also not exactly sure what your asking. I have found for mine. and this could be because I have done something wrong. But in my regular admin section, when I go to load products into sub catagories. they load in the store part. but do not stick around in the admin section to edit. I made up an admin account as though I was a customer and load my products through the customer ad product council. After the products are loaded, I can go back into the admin section click on the small green dot in the listing row, giving my permission for the item to be in the cart, ( which is normaly a red dot until it is approved )

 

I hope i was helpful. If not perhaps someone with my experience and knowledge can answer too, cause if I'm wrong. I'd like to know so I can fix it.

 

KR,

Nancy :D

Link to comment
Share on other sites

Also I should say, in the regular admin section, (where you would use your regular login and password) when you go to the costomers profiles, Inside each profile you give permission for them to post on your site. Under their name and email it will ask if you, " approve customer Yes or No" select the one you want and save the changes to the profile. Your customers will not be able to load their products until you have given them permission.

 

Nancy :D

Link to comment
Share on other sites

But my path to uploaded images is still off. I added the "thumb" directory and I am pretty sure I set the permissions to 777 using the CHMOD. But still no change to images being added.

...

and mine is still:

http://mysite.com/shop/images/Object doesnt even include the image name.

 

I experienced and solved this same problem. I found that the actual word 'Object' gets saved in the database (instead of the filename) and the picture file failed to be saved anywhere. It failed to save so it didn't return the filename to go into the DB. My thumb folder was okay, but my images folder was not.

 

The solution is to make sure that BOTH the /thumb/ and the /images/ folders are writeable. chmod 707 or 770 or 777 depending on your system.

Link to comment
Share on other sites

Hello. My client and I were just talking about this idea for his website that I'm working on, and the one problem that kept coming up was how the customer who lists an item, gets paid.

 

I've seen a few people ask the same question, with no replies. Well being as this cont. looks like something we could use, that same question arises.

 

How does the customer get paid? How do we get our small percentage of the sale?

 

From what I'm gathering, all the money goes into the store account, and then it's up to my client to figure out how much to pay the customer, and how much is his cut. That basically all this cont. does is allow the customer to add items to the site only. Am I on target?

 

Thanks for any assistance on this!!

Link to comment
Share on other sites

That basically all this cont. does is allow the customer to add items to the site only. Am I on target?

The idea behind the contribution was for customers to upload products. The principal behind it was the adding of an uploaded product, not how to work out commission rates and possible percentages for possible sellers.

 

Ther are a number of contributions you can use to get started on working out payment details but from what I can see they need to be modified to meet your requirements. In the event you feel active enough to create your own code it it isn't exactly rocket science to get the customer name linked to the product and have a page show up different margins (one for your client and one for the seller)

 

Good luck

Upon receiving fixes and advice, too many people don't bother to post updates informing the forum of how it went. Until of course they need help again on other issues and they come running back!

 

Why receive the information you require in good faith for free, only to then have the attitude to ignore the people who gave it to you?

 

There's no harm in saying, 'Thanks, it worked'. On the contrary, it creates a better atmosphere.

 

CHOOCH

Link to comment
Share on other sites

  • 2 weeks later...
Hi jkcool

 

Just add the lines to the lines to

admin/includes/languages/german/customers.php

 

I added them there in my site. just to the danish languages.

 

But i can't get the account_manage.php to work (looks like it can't find my stylesheet.css)

 

I removed the password protected .htacess in my admin folder, and installed the adminlogin contribution.

 

:thumbsup:

 

I had this problem too (excuse me for my bad english..., but i solved the problem with this..

 

Look in account_manage foor this part:

 

<!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 TITLE; ?></title>

 

add directly after:

 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">

 

This wil solve the problem, i think. (you wille have solved the problem already but this is for anybode with the same problem...)

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