Post by cebl » Sat May 11, 2019 12:57 pm

Hi,

I have looked through the forums with regard to how to achieve a blank or generic product description being passed to Paypal as I have seen with other sites.

Example of what I am trying to achieve is in the attached file.

The above example is from a company I buy from and I noticed they have a blank description. Previously they had a generic description. A customer has requested the same on a site and I am not sure how to achieve this.

I did find this forum topic viewtopic.php?t=204204

and it was suggested in that topic to "Please go to catalog/controller/extension/payment/pp_standard.php
You can see $data['products'][] array which contain name of product pass this product name in $data['item_name'] = html_entity_decode(//$data['products'][‘name’]//, ENT_QUOTES, 'UTF-8');"

I did insert this and did try changing some parameters and it did not work, but I really didn't know what I was doing with regard to making this work.

Can anyone suggest how I might be able to achieve the desired result for both express and standard paypal?

Attachments

paypal blank description.PNG

paypal blank description.PNG (4.58 KiB) Viewed 465 times


Newbie

Posts

Joined
Wed Jun 27, 2018 11:11 am

Post by straightlight » Sun May 12, 2019 8:01 am

The bug-fixes for the PayPal Express extension module can be found on my namespace: https://www.github.com/straightlight/op ... tributions . All files that contains: pp_express .

Follow the first post's instructions for more info: viewtopic.php?f=201&t=210578

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
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

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

Post by cebl » Sun May 12, 2019 8:07 am

Hi and thank you for your reply. I don't have a bug I want to change the file so there is no description or item number passed to paypal.

Newbie

Posts

Joined
Wed Jun 27, 2018 11:11 am

Post by straightlight » Sun May 12, 2019 8:17 am

For PP Express, in catalog/model/extension/payment/pp_express.php file,

find:

Code: Select all

$data['L_PAYMENTREQUEST_0_DESC' . $i] .= ($option_count > 0 ? ', ' : '') . $option['name'] . ':' . (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value);
and:

Code: Select all

$data['L_PAYMENTREQUEST_0_DESC' . $i] = substr($data['L_PAYMENTREQUEST_0_DESC' . $i], 0, 126);
Replace both with:

Code: Select all

//
at the beginning of these lines.

Then, find:

Code: Select all

$data['L_PAYMENTREQUEST_0_NUMBER' . $i] = $item['model'];
replace with:

Code: Select all

$data['L_PAYMENTREQUEST_0_NUMBER' . $i] = '';

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
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

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

Post by straightlight » Sun May 12, 2019 8:21 am

For PP standard,

in catalog/view/theme/<your_theme>/template/extension/payment/pp_standard.twig file,

find:

Code: Select all

<input type="hidden" name="item_number_{{ i }}" value="{{ product.model }}" />
replace with:

Code: Select all

<input type="hidden" name="item_number_{{ i }}" value="" />

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
Opencart.com Administrator / Quality Assurance Analyst / Programmer


Legendary Member

Posts

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

Post by cebl » Tue May 14, 2019 10:10 am

Hi Straightlight,

Thank you very much. I made the changes and it does remove the model no issues. But it does not remove the product description on each. You can see in the attached screen capture.

Attachments

paypal express.PNG

paypal express.PNG (2.42 KiB) Viewed 367 times


Newbie

Posts

Joined
Wed Jun 27, 2018 11:11 am

Post by cebl » Fri May 17, 2019 9:16 am

Wondering if anyone else might have any idea about this. It works great removing the model but not the description. If I change anything in either file related to product the checkout fails. So I guess there might be other files involved.

Newbie

Posts

Joined
Wed Jun 27, 2018 11:11 am
Who is online

Users browsing this forum: No registered users and 9 guests