Post by scottyboyyy » Thu Jun 07, 2018 3:53 am

Rather than an admin style account (user groups), I would like customers in a certain customer group to be able to add one product and be able to edit it.

I will check if the account is in the customer group and if so then show the add / edit product link on their account page.

Using the catalog code from the admin side (view, model and controller) and modifying it, remove the access permission, etc. I believe customers will able to edit all products the same way I can on the admin and it will be similar to the way customers can edit their address, etc.

The thing I can't get my head around is how I would limit each customer to only be able to edit one product and that product to be their own one so that it can't be edited by other customers.

Anyone have any suggestions? Are there other issues I am going to run into from doing it this way? Any ideas would be appreciated!

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am

Post by IP_CAM » Fri Jun 08, 2018 10:33 am

You would probably be better off by getting something like linked, because,
if you're not a really fluent OC Coder, you won't be able to achieve this.
And around here, one cannot expect others, to assist on such highly
custom things, and investing hours, just for the plain fun of it.
Good Luck, nothing personal ;)
Ernie
---
OpenCart-based Web Application: Classified Ads
https://www.opencart.com/index.php?rout ... n_id=32585
Demo:
http://classifiedads.bukausahaonline.com/
---

My Github OC Site: https://github.com/IP-CAM
5'200 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by scottyboyyy » Fri Jun 08, 2018 11:28 am

Hi Ernie,

It's all done and working.

You seem very knowledgeable and established on this forum so you may be able to help me with a few of the more difficult questions I have from doing it.

1) Token - this is an admin thing (I'm assuming) but the code used from the admin to achieve what I wanted is putting a token into the url for customers adding their item, like it does for the admin. This only happens when I'm logged in to admin. Can this cause me security issues?

I can remove it completely, both visually to the user and behind the scenes in the controller and it works the same so that is what I am wanting / going to do but why is it there if it doesn't do something I also wonder. So any advice / info on this would be amazing.

2) I have made that only customers in a certain customer group can see the link on the account page which allows them to add a product otherwise if it's the default customer group they cant see the link and if they try to type in the url they are simply redirected back to their account.

The customers in the customer group specific to adding items is limited to seeing only one product (their product). Trying to locate other products through simply changing url will redirect back to the product list and the list will only show their one item (as it was possible to get on to anyone's item). This was something I spotted / thought to look for, but is there anything I have missed? a security issue you think could happen?

3) This is more of a next step question. Adding customer to customer group manually. Ideally I want the customer to be added to this customer group automatically when a certain item is bought. I have not had time today to play with this but in my head I am thinking is to basically check whether the item is in the customers order list and if so then set the customers group id to the correct value.

Is there a simpler way of doing this? Better way?

Step on from that will be to make it a reoccurring item and if it isn't renewed demote the customer id back down one.

Thanks ^^

Active Member

Posts

Joined
Fri Apr 07, 2017 2:36 am
Who is online

Users browsing this forum: No registered users and 423 guests