I have a custom module which does same function of product view page. I am using this module in order to show my bundle products. i have created a fully functional module for this.
I have loaded the product successfully and displayed products name,description, different options in my page. However my add to cart button is not working.
I am loading my product like this
<?php
/*getInternationalPlans() is a custom function which filter out bundle products that
satisfy certain conditions. there may be more than one bundle products for this
function
*/
$_product=$this->getInternationalPlans($custom_select_business);
foreach ( $_product as $product ){
$plan_array [] = $product->getId ();
}
?>
<?php
/*it unregisters the product */
Mage::unregister ( 'product' );
Mage::register('international_product',$plan_array[0]);// i need only the first product
/* loading the current product*/
$_product=Mage::getSingleton('catalog/product')->load($plan_array[0]);
/*registering the current product*/
Mage::register('product', $_product); // add the product object in the registry
$block = Mage::getBlockSingleton('Mage_Catalog_Block_Product_View'); // Instantiate the product view block
?>
but in default product view page prdoucts are loading using getProduct() method. my form is like this... which is exactly same as that of default one
<form action="<?php echo $this->getSubmitUrl($_product) ?>" method="post"
id="product_addtocart_form"
<?php if($_product->getOptions()): ?> enctype="multipart/form-data"
<?php endif; ?>>
/*all options are showing here*/
/*...................................*/
$buttonTitle = $this->__('Order Now');
<button type="button" title="<?php echo $buttonTitle ?>" id="international_btn" class="btn btn-success" onclick="productAddToCartForm.submit(this)">
</form>
However the action part of form is blank, after I load this code. when I click on the button, it loads the same page again and during consoling it says that 'productId is not defined'
. So I have checked 'productAddToCartForm '
definition and found out that it uses 'productId'
in its definition. How can I set 'prdouctId'
in my page? why form action field is empty?
how can make my order now button work perfectly?
Please help me...
ce-1.7
orce-1.8
?