Post by pattison666 » Fri Sep 17, 2010 7:54 pm

Hi,
I'm not sure if this is possible within Opencart, but have a site where I need to make it so that when a customer makes their first order they can't change their shipping address - i.e. their shipping address must be the same as their card holder address (a step in fraud prevention).

After they have made their first order it should work in the normal way, they can specify an alternative shipping address.

Has anyone done this already or is it an option somewhere?

I am using only registered accounts (guest checkout is disabled, on this particular site).
Last edited by i2Paq on Fri Sep 24, 2010 11:58 pm, edited 1 time in total.
Reason: Topic moved

Newbie

Posts

Joined
Fri Sep 10, 2010 4:37 pm

Post by Qphoria » Fri Sep 24, 2010 9:10 pm

1. EDIT: catalog/controller/checkout/payment.php

2. FIND:

Code: Select all

if (!isset($this->session->data['payment_address_id']) && isset($this->session->data['shipping_address_id']) && $this->session->data['shipping_address_id']) {
          $this->session->data['payment_address_id'] = $this->session->data['shipping_address_id'];
} 
3. AFTER, ADD:

Code: Select all

$this->load->model('account/order');
$order_total = $this->model_account_order->getTotalOrders();
if (isset($this->session->data['payment_address_id']) && isset($this->session->data['shipping_address_id']) && $this->session->data['shipping_address_id'] && !$order_total) {
          $this->session->data['payment_address_id'] = $this->session->data['shipping_address_id'];
} 

This should force the payment address to always follow the shipping address if there are no previous orders.
It assumes that you won't be using guest checkout

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 5 guests