Magento – Layout move elements

layoutmagento2

I would like to move the "product-price" so it is just over the "add-to-cart".

The problem is I didn't find the exact "destination".

Had some minor success, either on "configurable products" or on the "simple product" view.

So my question is it possible to move if "configurable product" –>destination a or "simple product" –>destination b

Destination A:

<move element="product.price.final" destination="product.info.options.wrapper" after="-" />

Destination B:
<move element="product.price.final" destination="product.info.form.content" before="-" />

Thanks for your help

The idea with "basket.button.price" didn't work. Here my xml:

<container name="product.info.form.content" as="product_info_form_content">
<container name="basket.button.price" htmlTag="div" htmlClass="basket__elements"></container>
    <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="product.info.addtocart" template="product/view/addtocart.phtml"/>
</container>
<block class="Magento\Framework\View\Element\Template" name="product.info.form.options" as="options_container">
    <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="product/view/options/wrapper.phtml">
        <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml">
            <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/>
                <block class="Magento\Catalog\Block\Product\View\Options\Type\Text" as="text" template="product/view/options/type/text.phtml"/>
                    <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="product/view/options/type/file.phtml"/>
                    <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/>
                    <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/>
                </block>
            <block class="Magento\Framework\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/>
        </block>

    <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="product/view/options/wrapper/bottom.phtml">
        <container name="basket.button.price" htmlTag="div" htmlClass="basket__elements"></container>
            <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.additional" as="product.info.addtocart" template="product/view/addtocart.phtml"/>
        </block>
    </block>

Best Answer

I added this xml file to move "product.price.final" to "product.info.form.options" destination.

File

app/design/frontend/Vendor/theme/Magento_ConfigurableProduct/layout/catalog_product_view_type_configurable.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>
        <move element="product.price.final" as="product.info.main.bottom.price" destination="product.info.form.options" before="product.info.options.wrapper.bottom"/>
    </body>
</page>
Related Topic