How to change the snippet to get %listing_url% parameter and insert it on seller’s block area, including listing title on whatsapp message link, for example:
Please try this PHP snippet. It will change the %listing_url% custom token on the listing URL and the %listing_title% custom token on the listing title. Then please try to create a Vendor attribute, choose attribute area as Block (primary) or Block (secondary) to show it on the listing page, and please set the Format attribute option by your requirements
The single vendor page doesn’t have the “current listing” context like the listing page does since vendors can have multiple listings (although this page has a “current vendor” context).
Yes, I understand, but I would like to hide the button in vendor page otherwise it will display just the %listing_url% and %listing_title% as plain text, not the correct value because there is no such info on that page. So how to avoid display this in such page?
Please try this PHP snippet instead. This snippet will show your attribute with %listing_url% only in the vendor block on the listing page if you set Block (primary) or/and Block (secondary) as areas for the attribute