I have encounter a slight problem regarding magento checkout process. Currently I am using the list.phtml file to add orders into the cart, and upon changing the product, the cart is emptied and the newly selected product is added. I do this via this functionality:
this is the form for deleting (i have the form key into it)
<form action="<?php echo $this->getUrl('checkout/cart/updatePost') ?>" method="POST" name="emptyTheCart">
<?php echo $this->getBlockHtml('formkey'); ?>
<button type="submit" name="update_cart_action" value="empty_cart" style="display:none" title="<?php echo $this->__('Empty Cart'); ?>" id="empty_cart_button"></button>
</form>
$('.item').click(function() {
$(this).find('input:radio')[0].checked = true;
var formurl = $(this).find('input:radio').val();
var datafile=$("#product_addtocart_form").serialize();
var dataExecURL = "<?php echo $this->getUrl('checkout/cart/updatePost') ?>";
var datafiles=$("#emptyTheCart").serialize();
datafiles = datafiles + "&update_cart_action=empty_cart";
$.ajax({
type : 'POST',
data : datafiles,
url : dataExecURL,
success: function()
{
$.ajax({
type : 'POST',
data : datafile,
url : formurl
});
}
});
});
This part works very good. The thing is that on the Category page i have the following custom design in the Custom Layout Update:
<block type="cms/block" name="opdracht_text" before="-">
<action method="setBlockId"><block_id>opdracht_text</block_id></action>
</block>
<block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml" >
<block type="cms/block" name=" shipping_method" >
<action method="setBlockId"><block_id> shipping_method </block_id></action>
</block>
<block type="checkout/onepage_shipping_method_available" template="checkout/onepage/shipping_method/available.phtml"/>
<block type="cms/block" name="billing" >
<action method="setBlockId"><block_id>billing</block_id></action>
</block>
<block type="checkout/onepage_billing" name="checkout.onepage.billing" as="billing" template="checkout/onepage/billing.phtml"/>
<block type="cms/block" name="opdracht-delivery" >
<action method="setBlockId"><block_id>opdracht-delivery</block_id></action>
</block>
<block type="cms/block" name="payment_method" >
<action method="setBlockId"><block_id> payment_method </block_id></action>
</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/info.phtml">
<action method="setMethodFormTemplate"><method>purchaseorder</method><template>payment/form/purchaseorder.phtml</template></action>
</block>
<block type="core/template" name="checkout.onepage.payment.additional" as="additional" />
<block type="core/template" name="checkout.onepage.payment.methods_additional" as="methods_additional" />
</block>
</reference>
As a onepage checkout functionality I have added to magento the extension from
http://www.magentocommerce.com/magento-connect/one-page-checkout.html
when I navigate to my store_url/chekout/cart I can clearely see the cart and the shipping methods and update the price there and after that proceed to the checkout page at
store_url/ onepage/
where I have my billing + shipping + payment methods
I have taken the blocks from the checkout.xml file from the layout folder from my template (default rwd template) and added them to the category page
The main issue that I am having is the fact that upon opening the page I cannot view the shipping method until after I have selected a product and refreshed the page. The State/Province Field is not shown at all and also the Payment methods do not show up.
The thing that I am currently trying to accomplish is that the checkout forms to be on the product page like in the following flow:
Product Selection -> Shipping Method -> Billing Method -> Payment Method
These are the steps that I am currently trying to put in one single page ( the product display page / category page )