0

I just installed a buy-now plugin, But it affects the display of other features.enter image description here

How should I change it so that the buynow-button is displayed on top of product-addto-links.
Please help me!!!!
I don't know much about magento.

app/code/Prince/Buynow/view/frontend/layout/catalog_product_view.xml

    <?xml version="1.0"?>
    <page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
    <css src="Prince_Buynow::css/buynow.css"/>
</head>
<body>
    <referenceBlock name="product.info.addtocart">
        <block class="Magento\Catalog\Block\Product\View"
               name="product.buynow"
               template="Prince_Buynow::buynow-view.phtml"
               before="-" ifconfig="buynow/general/enable_view"/>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart.additional">
        <block class="Magento\Catalog\Block\Product\View"
               name="product.buynow.config"
               template="Prince_Buynow::buynow-view.phtml"
               before="-" ifconfig="buynow/general/enable_view"/>
    </referenceBlock>
    <referenceBlock name="related.product.addto">
        <block class="Prince\Buynow\Block\Product\ListProduct"
               ifconfig="buynow/general/enable_related"
               name="product.buynow.related"
               before="-" template="Prince_Buynow::buynow-list.phtml"/>
    </referenceBlock>
</body>

  • Why not just use the "instant purchase" feature? – Shawn Abramson Nov 6 '18 at 4:05
  • Sorry, I am wrong. I am using version 2.2.2.And i enabled the "instant purchase" feature,but it doesn't seem to work – yoyo Nov 6 '18 at 5:47
  • How you added this button ?, I think It will happen in your product page by moving the <div> – PЯINCƏ Nov 6 '18 at 9:02
  • @PRINCE I installed this plugin link – yoyo Nov 6 '18 at 9:53
  • i think for instant purchase button to appear you need to be logged in and possibly you might need to have a stored payment method, although i dont quite remember – Shawn Abramson Nov 6 '18 at 12:22
1

Try this:

app/design/frontend/Vendorname/themename/Magento_Catalog/layout/catalog_product_view.xml

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <move element="product.buynow" destination="product.info.form.content" before="product.info.addtocart"/>
    </body>
</page>

D'ont forget to clean the cache.

  • I tried your method,But it doesn't seem to take effect,I cleared the cache.link – yoyo Nov 7 '18 at 1:46
  • Try to enable the path hints, then give me the block names of the two blocks add to cart and by now mageplaza.com/kb/… – PЯINCƏ Nov 7 '18 at 8:45
  • Thank you very much,PRINCE.I have found the reason for this problem,and i have solved this problem. – yoyo Nov 12 '18 at 6:19
  • Cool, You can accept the answer if it helped you – PЯINCƏ Nov 12 '18 at 9:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.