Magento - update subtotal while runtime onepage checkout - magento

a customer is in checkout. while the standard checkout progresses i want to renew the subtotal of the checkout session, the payment and the preview steps cause private rules for each customer group. I tried out to set the price via save shipping observer but it doesn't work (the subtotal in preview didn't change and the payment moduls are using the same price as before.. I understand.. the HTML was load before and the steps are only hidden)
Is there any way to refresh the subtotal and the onepagecheckout without loosing the current step ?
Thank u

On the step you are doing this on, find the save action and add:
$this->getOnepage()->getQuote()->collectTotals()->save();
To the code before the response.
Works a treat.

Related

Quantity in checkout shopping cart doesn't work properly for Magento

I have use Magento 1.9.0.1 and on live server the cart is working correctly. I change the quantity of a product in the cart then I push the "Update cart" button and all works fine. I transferred the site another domain and the cart quantity doesn't work anymore. As I change the quantity of a product and click the button the quantity remains the same. If I go back and try to add the same product to the cart, even if I specify a different quantity like 10 and not 1, in the cart only 1 item is added every time I click on "add to the cart" button and not 10 as specified. I cannot figure out where's the problem. I excluded my custom theme and rolled back to the default theme and the problem persist. this site other functionality work fine.
It looks like somewhere in your code you put tmp instead of $tmp. Run a search over all of your code for tmp. And Go through the function getTmpDir and check you have sufficient permission for tmp folder and access to write files in tmp.
When i can change my magento local time zone. than this problem is solve.

Different checkout pages based on product category in Magento

I am new to Magento .So please forgive me if I am asking something silly.
I am working on a Magento shop where I have a requirement that when I select some product in certain category say X, then I am redirected to one page checkout where I have default shipping method and do not want any payment method. i.e. Skip shipping and payment method step in chekout.
Whereas if I click some other categories then I get redirected to onepage checkout with shipping and payment option.
So basically what I need in form of code is -
if(category==X)
then Checkout without Shipping and payment method
else
Checkout with Shipping and Payment options.
As far as I have explored the magento structure , it is far too complex then other CMS. I am not able to even find files where i have to make changes in code. Anybody out there who can guide me for right approach toward the solution? Or is there any extension which fulfills such requirement?
Thanks in advance.
First, create the new payment method for the category (and shipping method if you need that too).
http://www.magentocommerce.com/wiki/5_-_modules_and_development/payment/create-payment-method-module
http://www.magentocommerce.com/wiki/5_-_modules_and_development/shipping/create-shipping-method-module
Then I would probably extend the controller, though you probably could also use an observer.
Extend magento core controller (Checkout/OnepageController)
Keep in mind that the customer may have products from another category in their cart, and what to do in that case.

product qty revert when paypal window closed in magento

Here i am facing one issue. when create an order through paypal in magento after placing an order it is redirecting to paypal. here i am not paying amount just clicked on return to merchant site. in this case qty is reverting correctly to product. in this case order is showing in admin side as pending_payment status.
but forexample i am not clicking any button in paypal and not redirecting to merchant site and just close the window. in this time also order showing in backend as pending_payment status but not reverting qty to product.
anyone advise me what to do in this case.
thanks,
murali.
we are just deleting this order after an half-hour.
Here is the code for delete pending_payment orders from orders grid. for this we set a cron job for delete paypal pending orders. if user close the paypal window it reverts the qty and delete that order. you can check it out here. copy code from below url and place it in magento root folder and set cron for delete pending orders :)
http://eightlessons.blogspot.in/2013/03/delete-pendingpayment-order-status-from.html

Magento custom save order

We have a custom discount option other than magento default discount/coupon option. In that customer can choose the full amount to be paid from their balance amount with the account.
So if they choose to pay the total amount then i want to skip the magento payment tab. In the custom action i have to save the order and redirect the checkout page customer to checkout success page. How can i do that. When i call order->save(), it throws error like " Should select a payment option."
Please help me to skip the payment option on checkout page
Rather than skipping that option entirely, creating a new payment type to pay from the account would probably be clearer to the customer. You could preselect that option for the customer, and keep the rest of the system intact.
Hope that helps!
Thanks,
Joe

Magento - What is the internal url for shipping step in onepage checkout?

I am using an observer to check the shipping information provided by the customer during onepage checkout. By observing the event checkout_controller_onepage_save_shipping_method I want to redirect the customer back to the shipping step to re-enter their information.
Following the conversation on this page, What is the correct way to stop a checkout from an event observer in Magento?, I have everything set up, but I do not want to redirect them to cart, just the shipping step.
Mage::app()->getResponse()->setRedirect(Mage::getUrl('what/goes/here'));
Can I make the code simply refresh the page?
Mage::app()->getResponse()->setRedirect(Mage::getUrl('checkout/onepage')); does not work.
Thanks!
url = checkout/onepage/shipping_method
if ($backUrl = $this->_getRefererUrl()) {
$this->getResponse()->setRedirect($backUrl);
}

Resources