-1

in Magento 2 I am getting a product link from an attribute like so

<?= $_product->getData('ecc_related_documents_synced') ? '<a href='.$_product->getData('ecc_related_documents_synced').' ><span class="data-sheet">&nbsp;</span><a>' : '';?>

and i need to add a tab url href to the end of

#relateddoc
3
  • 1
    You mean, you want '<a href='.$_product->getData('ecc_related_documents_synced').'#relateddoc ><span ...? (These attribute values should really rather be put into quotes though.)
    – CBroe
    Commented Jul 3 at 10:25
  • @CBroe would your example work, if so then yes that is what i would need?
    – totneschap
    Commented Jul 3 at 11:44
  • 1
    It should "work", in that it will append #relateddoc to the URL you are outputting as the value of the href attribute there, yes. But why don't you just test it, and see if it achieves what you want/need?
    – CBroe
    Commented Jul 3 at 11:47

0

Browse other questions tagged or ask your own question.