magento2 – Add Block to Product Page with selection attribute in backend

I am trying to create an option where I can select yes or no in the backend, and when it’s set to yes, it adds a block with an image in the product page. Here’s what I have so far:

  1. I created a Yes/No Attribute called “samsung_5_vjet_garanci” and
    made sure its Visible on Catalog Pages on Storefront. Added it on a sample product, and set it to YES
  2. Created a CMS Block with just the “<img src=”{{media url=”wysiwyg/image.png”}}” alt=”” />” with identifier “samsung-garanci”
  3. Created a .phtml file and uploaded it /app/design/frontend/vendor/themename/Magento_Catalog/templates/product/view/samsung.phtml
<?php $_product = Mage::getSingleton('catalog/product')

if ($_product->getAttributeText('samsung_5_vjet_garanci') == "Yes"): ?>

<?php echo $this->getLayout()->createBlock('cms/block')->setBlockId('samsung-garanci')->toHtml(); ?>

<?php endif; ?>
  1. Added a block in catalog_product_view.xml

    <referenceContainer name="">
        <block class="MagentoCatalogBlockProductView" name="samsung" as="samsung" after="-" template="Magento_Catalog::product/view/samsung.phtml" />

But it’s not working, what am I doing wrong, it’s been 3 days figuring this out, and still nothing.
Thank you very much if you help me