opencart error when trying to pay with paypal

This time opencart makes problem with paypal and when u try to enter your name in non english like arabic or hebrew u get this error

“You have entered unsupported characters for this field. Current available language character types are: European, Chinese, Korean, Japanese, and Thai. Please try again.”

well the problem is with the invoice number sent from opencart to paypal

which includes number – first name – last name

so all u need to do is delete the first and last name and all will be ok

this is how u do it

go to : catalog > controller > payment > pp_standard.php

on line 82 u have this

$this->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');

Just replace wuth this


$this->data['invoice'] = $this->session->data['order_id'];

and we done!

/*****************************************************************************/
Arabic Answer

المشكله في رقم الفاتورة المرسل للبي بال
حيث أنه يضم رقم – الاسم الاول – الاسم الاخير

وبمجرد الغاء الاسم الاول والاسم الاخير وارسال رقم الفاتورة فقط فسيتم قبولها من البي بال

الطريقة هي كالتالي:

– اذهب الى:
catalog > controller > payment > pp_standard.php

– السطر 82
ربما يكون مختلف السطر لديك حسب الثيم انما هو يحتوي مايلي:


$this->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');

قم باستبادله بمايلي:


$this->data['invoice'] = $this->session->data['order_id'];

Advertisements

How to make qTranslate supports Custom Fileds or Meta Box?

am still developing this french site and site is build with many custom post types and custom fields

So, to make qtranslate quick tags work with custom fields, this is what you do:

ID, 'Activities', true));?>

or in my situation


echo PMI::format( _e(get_post_meta( $post_id, $custom_field, true )), $formats );

_e and all quicktags work perfectly both full version  <!–:en–>Founder and CEO <!–:–><!–:fr–>fondateur et directeur général <!–:–> and shorthand version [:en] etc.

fix Object of class WP_Post could not be converted to string

Today i was working on adding to a site french language using qtranslate  and i got this problem

Catchable fatal error: Object of class WP_Post could not be converted to string in ../wp-content/plugins/qtranslate/qtranslate_core.php on line 455

 

after some search i found the soultion it was simply in changing the qtranslate_core.php

(i know it is hard when u keep updating plugin but u can keep track by writing the changes in a file and put in the site directory )

 

as we said here  wp-content/plugins/qtranslate/qtranslate_core.php

before


function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='', $before = '', $after = '') {

global $post;

 return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date, $before, $after);

}

after


function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='') {

global $post;

 return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date);

}

we just removed ($before = '', $after = '' )