Post by sdd » Sat Feb 06, 2021 6:29 am

Need help and Thanks in advance.

I currently running opencart 3.0 and want the use paypal express since paypal standard is not sending the customers shipping address.
Long story short i already tried changing the values below:
Valid value is:
0. Prompt for an address, but do not require one.
1. Do not prompt for an address.
2. Prompt for an address and require one.

with the paypal express option im now receiving error code below on the checkout page:

Unknown: Array and string offset access syntax with curly braces is deprecated in
/home/.............../catalog/model/extension/payment/pp_express.php on line 330

whats wrong and how to fix???
Last edited by sdd on Sun Feb 07, 2021 5:35 am, edited 1 time in total.

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by mikeinterserv » Sat Feb 06, 2021 8:48 pm

The code should work as its only a warning
You won't see it if debugging is not enabled

You could try this to see if it goes away - not tested
Line 330

Code: Select all

$activate_code .= $base{mt_rand(0, $max)};
Try

Code: Select all

$activate_code .= $base[mt_rand(0, $max)];
Or go down to php 7.3

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by sdd » Sun Feb 07, 2021 2:44 am

;D Great, you were right its only a warning but code still works. The small change above took away the warning however i still cant get paypal to send customer shipping address. I have gotten burned by a customer and really want to get this fix or i may be forced to remove paypal altogether. I'm using opencart version 3.02
Thank you for your help.

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by mikeinterserv » Sun Feb 07, 2021 2:58 am

Paypal standard works fine - I would definitely recommend you use that instead - what was your problem with standard? the same with shipping

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by sdd » Sun Feb 07, 2021 3:06 am

Yes same issue with standard and i though using paypal express would be better but the same....... so far the script shown below is what i have for pp standard that dont work:
Im starting to think paypal has manually made this not work so that they force you to purchase their higher monthly merchant fees. But i got burned once by a customer and just may remove paypal if i dont get this shipping address fixed.

change it using Theme Editor and ........../catalog/view/theme/default/template/extension/payment/pp_standard.twig


{% if testmode %}
<div class="alert alert-danger alert-dismissible"><i class="fa fa-exclamation-circle"></i> {{ text_testmode }}</div>
{% endif %}
<form action="{{ action }}" method="post">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="{{ business }}" />
{% set i = 1 %}
{% for product in products %}
<input type="hidden" name="item_name_{{ i }}" value="{{ product.name }}" />
<input type="hidden" name="item_number_{{ i }}" value="{{ product.model }}" />
<input type="hidden" name="amount_{{ i }}" value="{{ product.price }}" />
<input type="hidden" name="quantity_{{ i }}" value="{{ product.quantity }}" />
<input type="hidden" name="weight_{{ i }}" value="{{ product.weight }}" />
{% set j = 0 %}
{% for option in product.option %}
<input type="hidden" name="on{{ j }}_{{ i }}" value="{{ option.name }}" />
<input type="hidden" name="os{{ j }}_{{ i }}" value="{{ option.value }}" />
{% set j = j + 1 %}
{% endfor %}
{% set i = i + 1 %}
{% endfor %}
{% if discount_amount_cart %}
<input type="hidden" name="discount_amount_cart" value="{{ discount_amount_cart }}" />
{% endif %}
<input type="hidden" name="currency_code" value="{{ currency_code }}" />
<input type="hidden" name="first_name" value="{{ first_name }}" />
<input type="hidden" name="last_name" value="{{ last_name }}" />
<input type="hidden" name="address1" value="{{ address1 }}" />
<input type="hidden" name="address2" value="{{ address2 }}" />
<input type="hidden" name="city" value="{{ city }}" />
<input type="hidden" name="zip" value="{{ zip }}" />
<input type="hidden" name="country" value="{{ country }}" />
<input type="hidden" name="address_override" value="1" />
<input type="hidden" name="email" value="{{ email }}" />
<input type="hidden" name="invoice" value="{{ invoice }}" />
<input type="hidden" name="lc" value="{{ lc }}" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="2" />
<input type="hidden" name="charset" value="utf-8" />
<input type="hidden" name="return" value="{{ return }}" />
<input type="hidden" name="notify_url" value="{{ notify_url }}" />
<input type="hidden" name="cancel_return" value="{{ cancel_return }}" />
<input type="hidden" name="paymentaction" value="{{ paymentaction }}" />
<input type="hidden" name="custom" value="{{ custom }}" />
<input type="hidden" name="bn" value="OpenCart_2.0_WPS" />
<div class="buttons">
<div class="pull-right">
<input type="submit" value="{{ button_confirm }}" class="btn btn-primary" />
</div>
</div>
</form>

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by mikeinterserv » Sun Feb 07, 2021 3:21 am

Try changing

Code: Select all

<input type="hidden" name="lc" value="{{ lc }}" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="2" />
To

Code: Select all

<input type="hidden" name="lc" value="{{ lc }}" />
<input type="hidden" name="rm" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />
I just looked at a currently working PP Standard on a live site and those are the only differences
Make sure to clear your cache etc

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by mikeinterserv » Sun Feb 07, 2021 4:14 am

Can you confirm your OC version - you stated it but not quite clearly
If its 3.0.3.2 then you made need to change a little in the controller too
Can you post your controller file as an attachment.

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by sdd » Sun Feb 07, 2021 4:51 am

;D Thank you so much. All is working now. You have been a great help. Did a fake order and shipping info was transferred. For those who are having a similar issue with opencart Version 3.0.2.0 I added all the changes below:
Image

........../catalog/controller/extension/payment/pp_standard.php ...............where payment_ is i changed to shipping_

Code: Select all

	}



			$data['currency_code'] = $order_info['currency_code'];

			$data['first_name'] = html_entity_decode($order_info['shipping_firstname'], ENT_QUOTES, 'UTF-8');

			$data['last_name'] = html_entity_decode($order_info['shipping_lastname'], ENT_QUOTES, 'UTF-8');

			$data['address1'] = html_entity_decode($order_info['shipping_address_1'], ENT_QUOTES, 'UTF-8');

			$data['address2'] = html_entity_decode($order_info['shipping_address_2'], ENT_QUOTES, 'UTF-8');

			$data['city'] = html_entity_decode($order_info['shipping_city'], ENT_QUOTES, 'UTF-8');

			$data['zip'] = html_entity_decode($order_info['shipping_postcode'], ENT_QUOTES, 'UTF-8');

			$data['country'] = $order_info['shipping_iso_code_2'];
			if ($order_info['payment_iso_code_2'] == 'US') {
				$data['state'] = $order_info['shipping_zone_code'];
			} else {
				$data['state'] = $order_info['shipping_zone'];
			}

			$data['email'] = $order_info['email'];

			$data['invoice'] = $this->session->data['order_id'] . ' - ' . html_entity_decode($order_info['payment_firstname'], ENT_QUOTES, 'UTF-8') . ' ' . html_entity_decode($order_info['payment_lastname'], ENT_QUOTES, 'UTF-8');
......................catalog/view/theme/default/template/extension/payment

Code: Select all

<input type="hidden" name="currency_code" value="{{ currency_code }}" />
  <input type="hidden" name="first_name" value="{{ first_name }}" />
  <input type="hidden" name="last_name" value="{{ last_name }}" />
  <input type="hidden" name="address1" value="{{ address1 }}" />
  <input type="hidden" name="address2" value="{{ address2 }}" />
  <input type="hidden" name="city" value="{{ city }}" />
  <input type="hidden" name="zip" value="{{ zip }}" />
  <input type="hidden" name="state" value="{{ state }}" />
  <input type="hidden" name="country" value="{{ country }}" />
  <input type="hidden" name="address_override" value="1" />
  <input type="hidden" name="email" value="{{ email }}" />
  <input type="hidden" name="invoice" value="{{ invoice }}" />
  <input type="hidden" name="lc" value="{{ lc }}" />
<input type="hidden" name="rm" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="no_shipping" value="1" />
  <input type="hidden" name="charset" value="utf-8" />
  <input type="hidden" name="return" value="{{ return }}" />
  <input type="hidden" name="notify_url" value="{{ notify_url }}" />
Last edited by sdd on Sun Feb 07, 2021 5:40 am, edited 2 times in total.

User avatar
sdd
New member

Posts

Joined
Sat Feb 06, 2021 6:21 am

Post by mikeinterserv » Sun Feb 07, 2021 5:26 am

Glad to help and glad to see you found the controller info on your own. :-)

Active Member

Posts

Joined
Thu May 28, 2020 6:55 am
Location - Wales

Post by tomeda » Fri Jun 10, 2022 1:16 pm

mikeinterserv wrote:
Sun Feb 07, 2021 2:58 am
Paypal standard works fine - I would definitely recommend you use that instead - what was your problem with standard? the same with shipping
Why is that?

I am still looking to fix it for pp express: Deprecated: Array and string offset access syntax with curly braces is deprecated in /catalog/model/extension/payment/pp_express.php on line 330

OC version 3.0.3.8

OpenCart SEO Services
http://tomeda.bg


User avatar
New member

Posts

Joined
Thu Mar 19, 2015 4:48 am


Post by ADD Creative » Fri Jun 10, 2022 5:53 pm

tomeda wrote:
Fri Jun 10, 2022 1:16 pm
I am still looking to fix it for pp express: Deprecated: Array and string offset access syntax with curly braces is deprecated in /catalog/model/extension/payment/pp_express.php on line 330

OC version 3.0.3.8
See. https://github.com/opencart/opencart/pull/8158

www.add-creative.co.uk


Guru Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: No registered users and 18 guests