Post by Zviadi » Mon Sep 22, 2008 4:00 pm

hi guys,  i need a help,  i want the payment information page not to exist in checkout process at all,  i mean, from the products page, when clicking checkout button to go  to the checkout confirmation page immediately. 

any ideas about this please?

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by Qphoria » Mon Sep 22, 2008 7:06 pm

Try this:

Edit catalog/controller/checkout_shipping.php.
Change all instances of:
checkout_payment
to
checkout_confirm

Edit catalog/controller/checkout_confirm.php
Change:

Code: Select all

        if (!$session->get('payment_method')) {
	  		$response->redirect($url->ssl('checkout_payment'));
    	}

    	if (!$payment->hasMethod($session->get('payment_method'))) {
	  		$response->redirect($url->ssl('checkout_payment')); 
    	}
to:

Code: Select all

        if ($session->get('payment_method')) {
	  		$response->redirect($url->ssl('checkout_payment'));
    	}

    	if ($payment->hasMethod($session->get('payment_method'))) {
	  		$response->redirect($url->ssl('checkout_payment')); 
    	}
Change:
$view->set('checkout_payment', $url->ssl('checkout_payment'));
to
$view->set('checkout_shipping', $url->ssl('checkout_shipping'));

Change:
$view->set('back', $url->ssl('checkout_payment'));
to
$view->set('back', $url->ssl('checkout_shipping'));

Change:
$view->set('checkout_payment_address', $url->ssl('checkout_address', 'payment'));
to:
$view->set('checkout_payment_address', $url->ssl('checkout_address', 'shipping'));

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by Zviadi » Tue Sep 23, 2008 4:15 am

thanks for your attitude but

it does not work , its stuck on the payment information page, i m clicking continue but it does not respond,

i just want to jump at to the checkout-confirm page.

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by Qphoria » Tue Sep 23, 2008 9:37 pm

Ah i see you want to completely skip shipping and payment. Though, if nobody is paying and nobody is shipping. Why do you need a store? Wouldn't it just be a bunch of information and download links?

You can edit the catalog/extension/module/header.php file and change the checkout_shipping to checkout_confirm.

but then you need to edit catalog/controller/checkout_confirm to replace all references to shipping and payment data and set them to null
Last edited by Qphoria on Tue Sep 23, 2008 9:39 pm, edited 1 time in total.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by jty » Wed Sep 24, 2008 2:16 pm

Qphoria wrote: Though, if nobody is paying and nobody is shipping. Why do you need a store?
It might be a case of only wanting an ordering process eg. a wholesaler taking orders online and then shipping is calculated offline and payment is by account or something like that.

jty
Active Member

Posts

Joined
Sat Aug 30, 2008 8:19 am

Post by Zviadi » Wed Sep 24, 2008 5:49 pm

i m not good in php yet, could you please tell me exactly how to do that


i just need to get orders and thats why, no payment no shipping.
Last edited by Zviadi on Wed Sep 24, 2008 6:19 pm, edited 1 time in total.

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by bruce » Wed Sep 24, 2008 6:34 pm

Hi,

First of all you can avoid the shipping pages by setting all of your products to not require shipping. You do this in the product section of your store admin.

To avoid the payment section, you can modify catalog\controller\checkout_payment as follows (only the beginning is shown)

Code: Select all

class ControllerCheckoutPayment extends Controller {
	var $error = array();

  	function index() {
		$address   =& $this->locator->get('address');
		$cart      =& $this->locator->get('cart');
		$config    =& $this->locator->get('config');
		$customer  =& $this->locator->get('customer');
		$database  =& $this->locator->get('database');
		$language  =& $this->locator->get('language');
		$module    =& $this->locator->get('module');
		$payment   =& $this->locator->get('payment');
		$request   =& $this->locator->get('request');
		$response  =& $this->locator->get('response');
		$session   =& $this->locator->get('session');
		$shipping  =& $this->locator->get('shipping');
		$tax       =& $this->locator->get('tax');
		$template  =& $this->locator->get('template');
		$url       =& $this->locator->get('url');

    	if (!$customer->isLogged()) {
			$session->set('redirect', $url->ssl('checkout_shipping'));

	  		$response->redirect($url->ssl('account_login'));
    	}

    	if ((!$cart->hasProducts()) || ((!$cart->hasStock()) && (!$config->get('config_stock_checkout')))) {
      		$response->redirect($url->ssl('cart'));
    	}

    	if ($cart->hasShipping()) {
			if (!$session->get('shipping_method')) {
	  			$response->redirect($url->ssl('checkout_shipping'));
			}

			if (!$shipping->getQuote($session->get('shipping_method'))) {
	  			$response->redirect($url->ssl('checkout_shipping'));
    		}

			if (!$address->has($session->get('shipping_address_id'))) {
	  			$response->redirect($url->ssl('checkout_address', 'shipping'));
    		}
		}
		else
		{
			$session->delete('shipping_address_id');
			$session->delete('shipping_method');
		}

// add fixed redirect here to avoid payment screens
		$response->redirect($url->ssl('checkout_confirm'));


    	if (!$address->has($session->get('payment_address_id'))) {
      		$session->set('payment_address_id', $session->get('shipping_address_id'));
    	}

you then modify catalog\controller\checkout_confirm.php so that it does not check for payment info in the session by removing or commenting out the entire block shown below

Code: Select all

		if (!$session->get('payment_method')) {
	  		$response->redirect($url->ssl('checkout_payment'));
    	}

    	if (!$payment->hasMethod($session->get('payment_method'))) {
	  		$response->redirect($url->ssl('checkout_payment'));
    	}

    	if (!$address->has($session->get('payment_address_id'))) {
	  		$response->redirect($url->ssl('checkout_address', 'payment'));
    	}
You will probably have to change some other bits to fix up the checkout_confirmation template etc but this will give you the navigation model that you want.

cheers

Bruce

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Zviadi » Thu Sep 25, 2008 5:01 pm

Thanks Bruce, I did The Way You said, it kinda skipped the payment and shipping step but now it has an error in payment.php at the top of my site

Notice: Undefined index: in /usr/home/schirnho/public_html/upload/library/cart/payment.php on line 59

Notice: Undefined index: in /usr/home/schirnho/public_html/upload/library/cart/payment.php on line 49

Notice: Undefined index: in /usr/home/schirnho/public_html/upload/library/cart/payment.php on line 49

Notice: Undefined index: in /usr/home/schirnho/public_html/upload/library/cart/payment.php on line 49

Notice: Undefined index: in /usr/home/schirnho/public_html/upload/library/cart/payment.php on line 65


help me out please.
Last edited by Zviadi on Thu Sep 25, 2008 6:48 pm, edited 1 time in total.

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by bruce » Sat Sep 27, 2008 10:36 am

You need to trick opencart into thinking you have a payment method picked.

At the beginning of checkout_confirm.php do something like this (extra code shown for positioning).

Code: Select all

    	if (!$customer->isLogged()) {
			$session->set('redirect', $url->ssl('checkout_shipping'));

	  		$response->redirect($url->ssl('account_login'));
    	}
        // trick is here
        $session->set('payment_method', 'cod');
You can change the template to not show the payment method on the checkout confirmation page. You will have to change the other templates that show payment method as well but this is the quickest way to do what you want.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Zviadi » Sat Sep 27, 2008 3:26 pm

here is an error

Notice: unserialize() [function.unserialize]: Error at offset 1166 of 4952 bytes in /usr/home/schirnho/public_html/upload/library/cart/order.php on line 56

Warning: Cannot modify header information - headers already sent by (output started at /usr/home/schirnho/public_html/upload/library/cart/order.php:56) in /usr/home/schirnho/public_html/upload/library/environment/response.php on line 23

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm

Post by bruce » Sat Sep 27, 2008 3:52 pm

Delete all rows in order_data and test some more.

I have made the changes that I suggested to a clean copy of opencart 0.7.7 and it works as you requested.

Active Member

Posts

Joined
Wed Dec 12, 2007 2:26 pm

Post by Zviadi » Sat Sep 27, 2008 4:32 pm

sorry this error actually is caused by translating the product name(above topic)

New member

Posts

Joined
Sun Sep 14, 2008 7:11 pm
Who is online

Users browsing this forum: No registered users and 3 guests