ok, try with the old function
ops!! the correct function is "paypalplus_is_payd" !!
try to change it...
if you have other problems try to change the old function
function paypalplus_publish($item) {
if(osc_get_preference('pay_per_post', 'paypal')) {
and make a new one
function paypalplus_compnay_publish($item) {
$conn = getConnection();
$usertype = $conn->osc_dbFetchResult("SELECT b_company FROM %st_user WHERE pk_i_id = %d", DB_TABLE_PREFIX, osc_logged_user_id());
if ($usertype['b_company']=='1') {
// Check if it's already payed or not
$conn = getConnection();
// Item is not paid, continue
$ppl_category = $conn->osc_dbFetchResult("SELECT f_publish_cost FROM %st_paypal_prices WHERE fk_i_category_id = %d", DB_TABLE_PREFIX, $item['fk_i_category_id']);
if($ppl_category && isset($ppl_category['f_publish_cost'])) {
$category_fee = $ppl_category["f_publish_cost"];
} else {
$category_fee = osc_get_preference('default_publish_cost', 'paypalplus');
}
paypalplus_send_email($item, $category_fee);
if($category_fee>0) {
// Catch and re-set FlashMessages
osc_resend_flash_messages();
Item::newInstance()->update(array('b_enabled' => 0), array('pk_i_id' => $item['pk_i_id']));
$conn->osc_dbExec("INSERT INTO %st_paypal_publish (fk_i_item_id, dt_date, b_paid) VALUES ('%d', '%s', '0')", DB_TABLE_PREFIX, $item['pk_i_id'], date('Y-m-d H:i:s'));
paypalplus_redirect_to(osc_render_file_url(osc_plugin_folder(__FILE__) . 'payperpublish.php&itemId=' . $item['pk_i_id']));
} else {
// PRICE IS ZERO
$conn->osc_dbExec("INSERT INTO %st_paypal_publish (fk_i_item_id, dt_date, b_paid) VALUES ('%d', '%s', '1')", DB_TABLE_PREFIX, $item['pk_i_id'], date('Y-m-d H:i:s'));
}
} else {
// NO NEED TO PAY PUBLISH FEE
paypalplus_send_email($item, 0);
}
$category = Category::newInstance()->findByPrimaryKey($item['fk_i_category_id']);
View::newInstance()->_exportVariableToView('category', $category);
paypalplus_redirect_to(osc_search_category_url());
}
then at the end of the page add
osc_add_hook('posted_item', 'paypalplus_company_publish');
remember to disable "pay per post" option!!