I am using custom theme and trying to move the "product.info.price"
block before the addtocart button
.
I have tried, direct into addtocart.phtml
file but not working.
<?php echo $this->getPriceHtml($_product) ?>
app\design\frontend\my_package\my_theme\Magento_Catalog\templates\product\view\addtocart.phtml
If I used :
<move element="product.info.price" destination="product.info.addtocart" />
Then it moves the price but it only appears on simple products without custom options.
If I used :
<move element="product.info.price" destination="product.info.addtocart.additional" />
Then it moves the price but it only appears on simple products with custom options.
So, How I can show the price block for both simple product
and simple product with custom options
.
Best Answer
Go to below location
Copy file with Name addtocart.phtml & paste it to below location in your theme
Put the below code into the file above this
<div class="actions">
present at around line no.31 .Now go to the below location
Put the below code into the file with name
catalog_product_view.xml