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???
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.
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
Try
Or go down to php 7.3
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)};
Code: Select all
$activate_code .= $base[mt_rand(0, $max)];

Thank you for your help.
Paypal standard works fine - I would definitely recommend you use that instead - what was your problem with standard? the same with shipping
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>
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>
Try changing
To
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
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" />
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" />
Make sure to clear your cache etc
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.
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.


........../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');
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.
Why is that?mikeinterserv wrote: ↑Sun Feb 07, 2021 2:58 amPaypal standard works fine - I would definitely recommend you use that instead - what was your problem with standard? the same with shipping
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
Who is online
Users browsing this forum: No registered users and 18 guests