Badge URL add Product Name in Email Subject

  • Posts: 4
  • Thank you received: 1
3 years 2 weeks ago #339742

-- HikaShop version -- : 4.4.5
-- Joomla version -- : 3.10.6
-- PHP version -- : 7.4.28

We have a request to allow an email link when clicking on a Badge (Open to Offers) that adds the product_name to the subject line.

I've tried various combinations of, and variable references, like...

mailto:sales@alloldstuff.co.uk?subject={VAR:PRODUCT_NAME}

in the Badge URL, but it just displays {VAR:PRODUCT_NAME} in the subject line, not the Product Name.

Is this possible?

Thanks

Please Log in or Create an account to join the conversation.

  • Posts: 83402
  • Thank you received: 13495
  • MODERATOR
3 years 2 weeks ago #339762

Hi,

Tags are not supported there.
However, it's possible for the badges on the product details page by adding the code

if(!empty($this->element->badges)) {
foreach($this->element->badges as $i => $b) {
foreach(get_object_vars($this->element) as $k => $v) {
 if(!is_string($v)) continue;
 $this->element->badges[$i]->badge_url = str_replace('{VAR:'.strtoupper(str$k).'}', $v, $b->badge_url);
}
}
}
before the line:
if(!empty($this->element->badges))
in the file product / show_block_img via the menu Display>Views.

Please Log in or Create an account to join the conversation.

Time to create page: 0.054 seconds
Powered by Kunena Forum