Add product to cart for guest user in magento -
i have add together cart in product listing page. if invitee user clicks on button, redirect client login page , after login, product should added cart , page redirected cart page. have written code invitee user redirects login page while clicking on button , pass product id in url of login page. after not able next portion. in product listing page code :
if (mage::getsingleton('customer/session')->isloggedin()){ $url = $this->getaddtocarturl($_product); }else{ $id = $_product->getentityid(); $url = mage::geturl("customer/account/login/cartproductid/$id"); } <button type="button" title="<?php echo $this->__('add cart') ?>" class="button btn-cart" onclick="setlocation('<?php echo $url; ?>')"><span><span><?php echo $this->__('add cart12') ?></span></span></button> after login redirects client dashboard page. should cart page adding product in cart.
please help. in advance.
when utilize customer/account/login. going login page
in login page when come in detail , submit next action invoked
customer/account/login
which in homecoming phone call function
customer/account/loginpost
you can find code redirection
$session->setbeforeauthurl(mage::helper('customer')->getaccounturl()); this part need customize job done!!!
you can override action client business relationship controller , changes per need.
magento user add cart
No comments:
Post a Comment