We sacrifice by not doing any other technology, so that you get the best of Magento.

We sacrifice by not doing any other technology, so that you get the best of Magento.

    If you want to show custom text after price on product detail page in product view page, then follow the below steps.

    1. Create catalog_product_view.xml in your custom theme

    app/design/frontend/[Vendor_name]/[theme_name]/Magento_Catalog/layout/catalog_product_view.xml

    <?xml version="1.0" ?>
    <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <body>
            <referenceContainer name="product.info.main">
                <block class="MagentoFrameworkViewElementTemplate" name="price.after.text" template="Magento_Catalog::view/price_after_text.phtml" after="product.info.price"/>
            </referenceContainer>
        </body>
    </page>

    Now you have to create price_after_text.phtml fle and add your custom text in it

    app/design/frontend/Vendor/theme/Magento_Catalog/templates/view/price_after_text.phtml

    2. If you want to set custom text after price at everywhere then override default final_price.phtml file

    from

    vendor/magento/module-catalog/view/base/templates/product/price/final_price.phtml

    to

    app/design/frontend/[Vendor_name]/[theme_name]/Magento_Catalog/templates/product/price/final_price.phtml

    3.  Most easy way to doing it with some style

    .catalog-product-view .product-info-price .price:after { content: 'per piece'; }

    After doing above task run below commands

    - php bin/magento setup:upgrade
    - php bin/magento setup:static-content:deploy
    - php bin/magento cache:clean

    That’s it.

    Now clean cache and check your product page for custom text after price.

    field_5bfb909c5ccae

      Get a Free Quote