Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Designing a Single Page website so the Homepage shows the product in the Cart and has Checkout below
 
SamArtioli
Jr. Member
 
Total Posts:  9
Joined:  2009-04-28
 

I am designing a new webpage for a single product.
I have gone through tutorials online and have made a basic layout using the modern theme.
I’ve removed blocks I don’t need (Like search) and styled with custom css. Everything is looking good.

In the content area I am going to have a <div> with pics and some verbage of my product.
I even added a custom block inside the default block of page.xml to load the div through it’s own template from 1column.phtml.

<block type="page/html" name="product_bulletpoints" as="product_bulletpoints" template="product/bulletpoints.phtml">

No problem.

Where I am having difficulty is:

Below my custom <div> I want to display the product in a cart. (The user can change quantities and color)

Directly below that I want to show the checkout. (Name, billing, shipping, etc)

The goal is to have all of this on one very simple page so that is easy to order my product. (Basically exactly like shamwow.com)
Simple and Sweet.

The problem is I am still trying to wrap my head around layout xmls and template .phtml

I am thinking that inside of 1column.phtml I should do something like:

<div class="col-main">
        
<?php echo $this->getChildHtml('global_messages'?>
        
<!-- <?php echo $this->getChildHtml('content'?> -->
        
<?php echo $this->getChildHtml('product_bulletpoints'?>    <!-- MY CUSTOM BLOCK -->

        
<?php echo $this->getChildHtml('ADD_CART_OR_SIMETHING....'?>
        <?php 
echo $this->getChildHtml('ADD_ONEPAGE_OR_SIMETHING....'?>

</div>

Though I am sure there’s more I have to do than that…

Tips, pointers, suggestions all welcome.

All the best!

 
Magento Community Magento Community
Magento Community
Magento Community
 
SamArtioli
Jr. Member
 
Total Posts:  9
Joined:  2009-04-28
 

I think I answered my own question… I think I had to form the question and type it out to figure out the answer :D

Inside ...frontend/default/mytheme I did:

grep -r cart.phtml

And saw that /layout/checkout.xml

The embodying <reference name="content"> block caught my eye and I copied that whole block into the <default> block of page.xml.

What do you know? It works!!

I did the same search for checkout.phtml and found the reference block inside /layout/checkout.xml also.

Copied in that whole block and I now have the cart and the checkout on my home page!!
I’m sure there’s a lot of gotchas I’m gunna hit, but I feel pretty good right now!

Here are the blocks I copied into the <default> tag of page.html

<reference name="content">
            <
block type="checkout/cart" name="checkout.cart">
                <
action method="setCartTemplate"><value>checkout/cart.phtml</value></action>
                <
action method="setEmptyTemplate"><value>checkout/cart/noItems.phtml</value></action>
                <
action method="chooseTemplate"/>
                <
action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/item/default.phtml</template></action>
                <
action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/item/default.phtml</template></action>
                <
action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/item/default.phtml</template></action>

                <
block type="core/text_list" name="checkout.cart.top_methods" as="top_methods" translate="label">
                    <
label>Payment Methods Before Checkout Button</label>
                    <
block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/>
                </
block>

                <
block type="page/html_wrapper" name="checkout.cart.form.before" as="form_before" translate="label">
                    <
label>Shopping Cart Form Before</label>
                </
block>

                <
block type="core/text_list" name="checkout.cart.methods" as="methods" translate="label">
                    <
label>Payment Methods After Checkout Button</label>
                    <
block type="checkout/onepage_link" name="checkout.cart.methods.onepage" template="checkout/onepage/link.phtml"/>
                    <
block type="checkout/multishipping_link" name="checkout.cart.methods.multishipping" template="checkout/multishipping/link.phtml"/>
                </
block>

                <
block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>
                <
block type="checkout/cart_shipping" name="checkout.cart.shipping" as="shipping" template="checkout/cart/shipping.phtml"/>
                <
block type="checkout/cart_crosssell" name="checkout.cart.crosssell" as="crosssell" template="checkout/cart/crosssell.phtml"/>

                <
block type="checkout/cart_totals" name="checkout.cart.totals" as="totals" template="checkout/cart/totals.phtml"/>
            </
block>
        </
reference>        

        <
reference name="content">
            <
block type="checkout/onepage" name="checkout.onepage" template="checkout/onepage.phtml">
                <
block type="checkout/onepage_login" name="checkout.onepage.login" as="login" template="checkout/onepage/login.phtml">
                    <
block type="page/html_wrapper" name="checkout.onepage.login.before" as="login_before" translate="label">
                        <
label>Login/Registration Before</label>
                        <
action method="setMayBeInvisible"><value>1</value></action>
                    </
block>
                </
block>
                <
block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="checkout/onepage/billing.phtml"/>
                <
block type="checkout/onepage_shipping" name="checkout.onepage.shipping" as="shipping" template="checkout/onepage/shipping.phtml"/>
                <
block type="checkout/onepage_shipping_method" name="checkout.onepage.shipping_method" as="shipping_method" template="checkout/onepage/shipping_method.phtml">
                    <
block type="checkout/onepage_shipping_method_available" name="checkout.onepage.shipping_method.available" as="available" template="checkout/onepage/shipping_method/available.phtml"/>
                    <
block type="checkout/onepage_shipping_method_additional" name="checkout.onepage.shipping_method.additional" as="additional" template="checkout/onepage/shipping_method/additional.phtml"/>
                </
block>
                <
block type="checkout/onepage_payment" name="checkout.onepage.payment" as="payment" template="checkout/onepage/payment.phtml">
                    <
block type="checkout/onepage_payment_methods" name="checkout.payment.methods" as="methods" template="checkout/onepage/payment/methods.phtml">
                        <
action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
                    </
block>
                </
block>
                <
block type="checkout/onepage_review" name="checkout.onepage.review" as="review" template="checkout/onepage/review.phtml"/>
            </
block>
        </
reference>

I also uncommented out:

<?php echo $this->getChildHtml('content'?>

in 1column.phtml

 
Magento Community Magento Community
Magento Community
Magento Community
 
nathannielson12
Jr. Member
 
Total Posts:  1
Joined:  2013-01-07
 

Can you post a link to your website?  I am looking into single product themes, however am a pretty big noob.  any help would be great

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top