Jump to content

portals


Recommended Posts

im new here so im not to sure how much this topic has been discused but havent found something related... I´m building a real estate portal so i would need a system that would work in a way that people could post the adds and have a certin control of there post editing etc would this be posible by prestashop?
I would realy apretiate if any examples

thanks for the help!

Link to comment
Share on other sites

This is not possible with Prestashop at the moment. You cannot give customers the option to add products to your site and manage just their products. You can only add them as employees, which gives them access to edit all the products on the website.

Link to comment
Share on other sites

  • 1 month later...

thanks alot for the info Rocky, any other suggestion/idea? so that i can channel myself into that...

Is it possible to create extra field for the author(the one who logged in) while creating a product. So that we can have a track later? if so, which module i have to edit?

Link to comment
Share on other sites

This would be difficult, but possible. You'll need to add an id_employee field to the ps_product table. Then add the following to the public variables near the top of classes/Product.php:

/** @var integer Employee id */
public id_employee;



Then add the following to the getFields function in classes/Product.php:

$fields['id_employee'] = pSQL($this->id_employee);



Then add the following to the top of the add function in classes/ObjectModel.php so you can access the cookie:

global $cookie;



and then the following after filling in the dates to fill the currently-logged-in employee:

if ($this->table == 'product')
  $this->id_employee = intval($cookie->id_employee);



I haven't tested this code, but it should put the currently-logged-in employee's ID in the database when a product is created, but not update the employee ID when an update occurs.

Link to comment
Share on other sites

great help ROCKY,

"This would be difficult, but possible."
Thanks for your Positive reply.

I will give a try and let you know the output, also if anyone interested in the same thing, can join for more discussion...


Edit:
I added the field in DB, and lines added in other files too (as you said) but i couldnt see the data in the employee field in DB after adding the product into it.

Link to comment
Share on other sites

  • 7 months later...

I'm totally interested. I made a post but was lost in forum stack with no reply since I asked it in a developer sense.

What I made so far you can EASILY show the employee ONLY his product. This is what I've done.

Added the field id_employee to products table. Filled the data manually to test since I needed the code uphere to make this work

then on admin/tabs/AdminProducts.php <- not sure of the name I added a filter line to show only if a product id_employee == Admincookie->id_employee

then to make sure the global admin can see all the product. You can use an if statement to check the profile id (make a profile for merchants)

using the same concept you can make the employee able to change ONLY his own password.

View his own orders and products.. blah blah

I have a deadline with my partner in the small shop we're doing (I'm the computer geek XD). so I'll post you my results with details whenever I think it's working and concrete

Link to comment
Share on other sites

  • 2 weeks later...

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
×
×
  • Create New...