1

I want remove Shipping Information, Shipping method, and Payment method for now i don't need to add all of this, i only want customer can view product detail and go for checkout.

i tried to remove it at time of checkout it giving me error message that process can not go further for checkout.

1

Please use virtual product type. It removes everything about the shipping.

For the payment enable single option Money Order

1

Amasty give a good idea.But if you want checkout all type of Product using checkout

Then follow below steps:

step1: make shipping same as billing address.

Step2:On Billing save action programmatically set free shipping as shipping method.

may like:

add below code which set shipping method on checkout after $this->getOnepage()->saveBilling($data, $customerAddressId);

$this->getOnepage()->getQuote()->getShippingAddress()->setShippingMethod($shippingMethod);
 $this->getOnepage()->getQuote()->collectTotals()->save();

Step3: Also on billing save action programmatically save Zero Subtotal payment as payment or any available payment gateway. exmaple:

$quote=$this->getOnepage()->getQuote()
        $paymentData = $this->_preparePaymentData($paymentData);
        if ($quote->isVirtual()) {
            $quote->getBillingAddress()->setPaymentMethod('free');
        } else {
            // check if shipping address is set
            if (is_null($quote->getShippingAddress()->getId())) {
               // error
            }
            $quote->getShippingAddress()->setPaymentMethod(
                isset($paymentData['method']) ? $paymentData['method'] : null
            );
        }

        if (!$quote->isVirtual() && $quote->getShippingAddress()) {
            $quote->getShippingAddress()->setCollectShippingRates(true);
        }

        $total = $quote->getBaseSubtotal();
        try {
            $payment = $quote->getPayment();
            $payment->importData(array('method' => 'free'));
            $quote->setTotalsCollectedFlag(false)
                ->collectTotals()
                ->save();
        } catch (Mage_Core_Exception $e) {

        }

Step4: Goto review step using json return like:

try {

            // get section and redirect data
            $redirectUrl = $this->getOnepage()->getQuote()->getPayment()->getCheckoutRedirectUrl();
            if (empty($result['error']) && !$redirectUrl) {
                $this->loadLayout('checkout_onepage_review');
                $result['goto_section'] = 'review';
                $result['update_section'] = array(
                    'name' => 'review',
                    'html' => $this->_getReviewHtml()
                );
            }
            if ($redirectUrl) {
                $result['redirect'] = $redirectUrl;
            }
        } catch (Mage_Payment_Exception $e) {
            if ($e->getFields()) {
                $result['fields'] = $e->getFields();
            }
            $result['error'] = $e->getMessage();
        } catch (Mage_Core_Exception $e) {
            $result['error'] = $e->getMessage();
        } catch (Exception $e) {
            Mage::logException($e);
            $result['error'] = $this->__('Unable to set Payment Method.');
        }
        $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.