2

Help create a block to insert view.phtml. I have a layout file that outputs to buy in one click in the right column. I need to put this block alongside a buy button.

<checkout_cart_index>
    <reference name="head">
        <action method="addCss"><stylesheet>css/oneclickorder.css</stylesheet></action>
    </reference>

    <reference name="checkout.cart.methods">
        <block type="smasoft_oneclickorder/form" name="checkout.cart.methods.oneclickorder" template="smasoft/oneclickorder/form.phtml"/>
    </reference>
</checkout_cart_index>

<!-- Show OneOrderClick form on product view page -->
<catalog_product_view>
    <reference name="head">
        <action method="addCss"><stylesheet>css/oneclickorder.css</stylesheet></action>
    </reference>
    <reference name="right">
        <block type="smasoft_oneclickorder/form" before="-" name="catalog.product.oneclickorder" template="smasoft/oneclickorder/form.phtml"/>
    </reference>

</catalog_product_view>

<smasoft_oneclickorder_index_success translate="label">
    <label>One Click Order Checkout Success</label>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="smasoft_oneclickorder/success" name="checkout.success" template="smasoft/oneclickorder/success.phtml">
            <block type="checkout/onepage_success" name="checkout.magento.success" as="magento_order_success" template="checkout/success.phtml"/>
        </block>
    </reference>
</smasoft_oneclickorder_index_success>

<oneclickorder_email_order_items>
    <block type="smasoft_oneclickorder/email_items" name="items" template="smasoft/oneclickorder/email/items.phtml">
        <block type="sales/order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
            <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
        </block>
    </block>
</oneclickorder_email_order_items>

enter image description here

1 Answer 1

0

<block type="smasoft_oneclickorder/form" name="catalog.product.oneclickorder" template="smasoft/oneclickorder/form.phtml" as="oneclickorder" />

Insert after <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/> in the node <catalog_product_view>.

Then create a new node after

<action method="append"><block>product.info.addtocart</block></action>

Such as:

<action method="append"><block>catalog.product.oneclickorder</block></action>

Also be sure your Modules block exists you are referring to in the type="smasoft_oneclickorder/form as well as the phtml file referenced.

If you need to debug the XML structure:

header("Content-Type: text/xml"); die(Mage::app()->getConfig()->getNode()->asXML());

This will output the entire XML tree that Magento compiles of every XML file it has gathered for the requests or has cached after generating.

2
  • It did not work, did everything you have written. Maybe possible just to insert a file view.html Bolok?
    – Alex Nkl
    Commented Sep 15, 2016 at 19:46
  • What does your Block app/code/local/Smasoft/Oneclickorder/Blocks/Form.php look like? Are you using a local layout file for your changes? Any errors in var/log/exception.log or var/log/system.log ?
    – B00MER
    Commented Sep 15, 2016 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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