[Skip to main content](#vessel-content)

#   Remove add to cart button depending on the vendor

##

- **[activha](/forum/user/32385-activha "View activha's Profile")**
- [![activha's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32385-activha "View activha's Profile") Topic Author
- [ Offline](/forum/user/32385-activha)

Less More

- Posts: 21
- Thank you received: 0
-
-

12 years 5 months ago [\#160619](#160619) by [activha](/forum/user/32385-activha "View activha's Profile")  *[Remove add to cart button depending on the vendor](/forum/23-market-how-to/869069-remove-add-to-cart-button-depending-on-the-vendor#160619 "Hello  Is it possible to remove the add to cart button and the stock display for a product depending on the group of the vendor ?  ex : make that for all vendors belonging to group 'A' add to cart button and stock are not displayed ?  Which template should be edited ?  For instance can I add something with if ( $vendor-&gt;user-&gt;usertype == &quot;Registered&quot; ) , then display or not  Thanks Jean")* was created by *[activha](/forum/user/32385-activha "View activha's Profile")*

Hello

Is it possible to remove the add to cart button and the stock display for a product depending on the group of the vendor ?

ex : make that for all vendors belonging to group 'A' add to cart button and stock are not displayed ?

Which template should be edited ?

For instance can I add something with
if ( $vendor-&gt;user-&gt;usertype == "Registered" ) , then display or not

Thanks
Jean

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODY5MDY5LXJlbW92ZS1hZGQtdG8tY2FydC1idXR0b24tZGVwZW5kaW5nLW9uLXRoZS12ZW5kb3I/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26401
- Thank you received: 4081
-
- [](http://obsi.dev)
-

12 years 5 months ago [\#160621](#160621) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Remove add to cart button depending on the vendor](/forum/23-market-how-to/869069-remove-add-to-cart-button-depending-on-the-vendor#160621 "Hello  Is it possible to remove the add to cart button and the stock display for a product depending on the group of the vendor ?  ex : make that for all vendors belonging to group 'A' add to cart button and stock are not displayed ?  Which template should be edited ?  For instance can I add something with if ( $vendor-&gt;user-&gt;usertype == &quot;Registered&quot; ) , then display or not  Thanks Jean")*

Hi,

In the HikaShop product views (product page and product listing) you have access to the product's vendor object.

So you can modify the view "product &#124; quantity" to display or not the "add to cart" button or the stock depending the vendor.
You shoud use Code:

$this-&gt;row-&gt;vendor

to access to the vendor of the processing product (if you are in a listing, the quantity view will be call for each product).

The vendor group is stored with the vendor access Code:

$access = $this-&gt;row-&gt;vendor-&gt;vendor_access; if(is_string($access)) $access = explode(',', $access); if(in_array('@3', $access)) { // @3 means the group with the id 3. // the vendor is in the group 3. Do some special stuff }

The accesses starting with a @ are groups, otherwise it indicate the HikaMarket right (like "product_edit" or "order_listing").

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODY5MDY5LXJlbW92ZS1hZGQtdG8tY2FydC1idXR0b24tZGVwZW5kaW5nLW9uLXRoZS12ZW5kb3I/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[activha](/forum/user/32385-activha "View activha's Profile")**
- [![activha's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/32385-activha "View activha's Profile") Topic Author
- [ Offline](/forum/user/32385-activha)

Less More

- Posts: 21
- Thank you received: 0
-
-

12 years 5 months ago [\#161174](#161174) by [activha](/forum/user/32385-activha "View activha's Profile")  Replied by *[activha](/forum/user/32385-activha "View activha's Profile")* on topic *[Remove add to cart button depending on the vendor](/forum/23-market-how-to/869069-remove-add-to-cart-button-depending-on-the-vendor#161174 "Hello  Is it possible to remove the add to cart button and the stock display for a product depending on the group of the vendor ?  ex : make that for all vendors belonging to group 'A' add to cart button and stock are not displayed ?  Which template should be edited ?  For instance can I add something with if ( $vendor-&gt;user-&gt;usertype == &quot;Registered&quot; ) , then display or not  Thanks Jean")*

Thanks seems to work great...

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzIzLW1hcmtldC1ob3ctdG8vODY5MDY5LXJlbW92ZS1hZGQtdG8tY2FydC1idXR0b24tZGVwZW5kaW5nLW9uLXRoZS12ZW5kb3I/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.042 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
