Post by asifshaikh » Fri May 15, 2020 8:13 pm

Version 2.3.0.2

Following VQMod code, I used to display "Y" or "N" on the customer Checkout page for frontend. and it is working perfectly.
But I want the same functionality in Admin Customer edit Page below Postcode field for each address for backend use.
Note: I have created new table "pincodes" in the same database where I stored the pincodes.

Code: Select all

	<file path="catalog/controller/checkout/" name="shipping_method.php">
		<operation>
			<search position="after" error="log"><![CDATA[$this->load->language('checkout/checkout');]]></search>
			<add><![CDATA[
		if (isset($this->session->data['shipping_address']['address_id'])) {
			$data['address_id'] = $this->session->data['shipping_address']['address_id'];
		} else {
			$data['address_id'] = $this->customer->getAddressId();
		}

		$this->load->model('account/address');

		$data['addresses'] = $this->model_account_address->getAddresses();

		if (isset($this->session->data['shipping_address']['postcode'])) {
			$data['postcode'] = $this->session->data['shipping_address']['postcode'];
		} else {
			$data['postcode'] = '';
		}
		
		$result_pincode = $this->db->query("SELECT PinID FROM pincodes WHERE Pincode = '".$data['postcode']."'");
		$data['matchFound'] = $result_pincode->num_rows > 0 ? 'Y' : 'N';
			]]></add>
		</operation>
	</file>
	<file name="catalog/view/theme/*/template/checkout/shipping_method.tpl">
		<operation>
			<search position="before" error="log"><![CDATA[
			<?php if ($error_warning) { ?>]]></search>
			<add><![CDATA[
		<?php echo $matchFound; ?></br>
			]]></add>
		</operation>		
	</file>
Please help with the solution.

Newbie

Posts

Joined
Sat Sep 08, 2012 9:36 pm

Post by straightlight » Sun May 17, 2020 6:09 am

You could always create a new service request in the Commercial Support section of the forum, or contact a reliable Opencart partner from this site or contact me directly to get this done as a custom job.

The most generated errors being found on Opencart forum originates from contributed programming. The increased post counters are caused by redundancies of the same solutions that were already provided prior.


Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON
Who is online

Users browsing this forum: Chulain and 20 guests