- Posts: 21
- Thank you received: 0
Remove add to cart button depending on the vendor
12 years 3 months ago #160619
by activha
Remove add to cart button depending on the vendor was created by activha
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->user->usertype == "Registered" ) , then display or not
Thanks
Jean
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->user->usertype == "Registered" ) , then display or not
Thanks
Jean
Please Log in or Create an account to join the conversation.
12 years 3 months ago #160621
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Remove add to cart button depending on the vendor
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 | quantity" to display or not the "add to cart" button or the stock depending the vendor.
You shoud use
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
The accesses starting with a @ are groups, otherwise it indicate the HikaMarket right (like "product_edit" or "order_listing").
Regards,
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 | quantity" to display or not the "add to cart" button or the stock depending the vendor.
You shoud use
Code:
$this->row->vendor
The vendor group is stored with the vendor access
Code:
$access = $this->row->vendor->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
}
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
12 years 3 months ago #161174
by activha
Replied by activha on topic Remove add to cart button depending on the vendor
Thanks seems to work great...
Please Log in or Create an account to join the conversation.
Moderators: Obsidev
Time to create page: 0.186 seconds