display stock quantity to specific vendor (ver 3.60)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
Hi, ladies and gentlemen

I'm a rookie to use nopCommerce
I want to show the stock quantity to "only" the vendor in the product page
let a vendor see the stock quantity of his own products via a column or page such as the product page without going to the dashboard
but I have no idea how to do it.
Please help me to get this job done, or any other ways to implement?

Thank you :)
8 years ago
alex7166 wrote:
Hi, ladies and gentlemen

I'm a rookie to use nopCommerce
I want to show the stock quantity to "only" the vendor in the product page
let a vendor see the stock quantity of his own products via a column or page such as the product page without going to the dashboard
but I have no idea how to do it.
Please help me to get this job done, or any other ways to implement?

Thank you :)


Hi,

It requires some customization. Where do you want to display it? admin side or on website?
8 years ago
on website, but i hope only the vendor of the product can see the status

for instance, a vendor's email is [email protected] and a product named product_1
the vendor can see the the stock quantity of product_1 of his own after logging in as [email protected],
while other customers can't see that number
i guess it necessary to modify the source code to complete the mechanism,
but i don't know what to do
hope someone can help this, thank you

btw, i'm using nopCommerce 3.60
8 years ago
alex7166 wrote:
on website, but i hope only the vendor of the product can see the status

for instance, a vendor's email is [email protected] and a product named product_1
the vendor can see the the stock quantity of product_1 of his own after logging in as [email protected],
while other customers can't see that number
i guess it necessary to modify the source code to complete the mechanism,
but i don't know what to do
hope someone can help this, thank you

btw, i'm using nopCommerce 3.60


Hi Alex,
Which page you want to add this feature ? Product details page or vendor page or  any product box.
This feature you can add any where
8 years ago
i think you have two ways for it.

1. you can use the ACL (Access control list) and you need to create new permission for show the stock Qty and give access to vendor role only

2.you can directly hard code to check that if customer has vendor role then show the stock qty otherwise hide it.

I Hope it helps
8 years ago
vipul.dumaniya wrote:
i think you have two ways for it.

1. you can use the ACL (Access control list) and you need to create new permission for show the stock Qty and give access to vendor role only

2.you can directly hard code to check that if customer has vendor role then show the stock qty otherwise hide it.

I Hope it helps


Thanks vipul.dumaniya. I think so.
8 years ago
vipul.dumaniya wrote:
i think you have two ways for it.

1. you can use the ACL (Access control list) and you need to create new permission for show the stock Qty and give access to vendor role only

2.you can directly hard code to check that if customer has vendor role then show the stock qty otherwise hide it.

I Hope it helps


thanks, i also think so
but i can't find a way to create a new permission in ACL
the second option is another problem, i don't know how to modify the code to fit my need
it may no easy way, that's why i asked this question
god, hope there exists a plugin for this job
8 years ago
i don't think that there is some plugin for this functionality.

for adding ACL etc you can refer some admin controller that how it work.

you need to insert new permission record on PermissionRecord table manually as there is not any interface to insert it from admin.

after then you need to follow all required ACL funtionality that is used on all admin controllers
8 years ago
vipul.dumaniya wrote:
i don't think that there is some plugin for this functionality.

for adding ACL etc you can refer some admin controller that how it work.

you need to insert new permission record on PermissionRecord table manually as there is not any interface to insert it from admin.

after then you need to follow all required ACL funtionality that is used on all admin controllers


thanks, but that's too difficult to a rookie like me (i've googled, trust me)
excepting the ACL,
what should i do?

i guess there must be a flow control to decide whether to display the stock quantity, not to show every customer
if the current user's email and the vendor's email are the same, then display the number
i found the FormatStockMessage at Libraries\Nop.Services\Catalog\ProductExtensions.cs #86, but i don't know how to modify the block to fit my need.
i have no asp.net experience
but i must complete this to survive my new job :(
8 years ago
hi, ladies and gentlemen,
i update my question here:


a customer's email account is [email protected]
the vendor - testVender's email is set to [email protected]
a known variable of the stockQuantity is in Libraries\Nop.Services\Catalog\ProductExtensions.cs line#102

how to get the emails of the current customer and the vendor?
i want to add a condition in this program block to judge whether these two emails are the same

the answer i need becomes simpler, but still need help
thank you :)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.