Encerrado

OSCommerce - MVS Contribution (to work with SPPC)

I need someone who can do some simple work on my OSCommerce website. I only need someone to fix a problem I am having with the MVS contribution conflicting with the SPPC contribution for OSCommerce.

I have installed the contribution but I have found some errors in my testing and I don't know PHP well enough to fix the code myself. I'm looking for someone who is an expert in PHP and has alot of experience with installing OSCommerce Contributions.

The following contributions for OSCommerce have been installed, tested and are working properly:

SEO-G

SPPC

QPBPP

ORDER EDITOR

DISCOUNT COUPONS

UPS XML RATES

After I installed the MVS contribution I created a test order, and got an error during the "Checkout Confirmation" process. During the test, after payment method and shipping has been selected and I clicked the button for Checkout Confirmation, I got the following error message:

---------------------------------------------------------------------

Warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /public_html/catalog/includes/functions/[url removed, login to view] on line 131

Warning: Cannot modify header information - headers already sent by (output started at /public_html/catalog/includes/functions/[url removed, login to view]) in /public_html/catalog/includes/functions/[url removed, login to view] on line 36

---------------------------------------------------------------------

I believe the error happens when the mysql_real_escape_string conflicts with the $array that is part of the SPPC code in the [url removed, login to view] file.

Here is the code from catalog/includes/functions/[url removed, login to view] starting at line 131:

---------------------------------------------------------------------

if (function_exists('mysql_real_escape_string')) {

return mysql_real_escape_string($string, $$link);

} elseif (function_exists('mysql_escape_string')) {

return mysql_escape_string($string);

}

return addslashes($string);

}

function tep_db_prepare_input($string) {

if (is_string($string)) {

return trim(tep_sanitize_string(stripslashes($string)));

} elseif (is_array($string)) {

reset($string);

while (list($key, $value) = each($string)) {

$string[$key] = tep_db_prepare_input($value);

}

return $string;

} else {

return $string;

}

}

// BOF Separate Pricing Per Customer, adapted from sample code in user comments on

// [url removed, login to view]

// Wrap DB_DATABASE with Back Ticks, Fixes Hyphens in Database Name, code from

// [url removed, login to view];view=findpost&p=563454

function tep_db_table_exists($table, $link = 'db_link') {

$result = tep_db_query("show table status from `" . DB_DATABASE . "`");

while ($list_tables = tep_db_fetch_array($result)) {

if ($list_tables['Name'] == $table) {

return true;

}

}

return false;

}

function tep_db_check_age_specials_retail_table() {

$result = tep_db_query("show table status from `" . DB_DATABASE . "`");

$last_update_table_specials = "2000-01-01 12:00:00";

$table_srp_exists = false;

while ($list_tables = tep_db_fetch_array($result)) {

if ($list_tables['Name'] == TABLE_SPECIALS_RETAIL_PRICES) {

$table_srp_exists = true;

$last_update_table_srp = $list_tables['Update_time'];

}

if ($list_tables['Name'] == TABLE_SPECIALS) {

$last_update_table_specials = $list_tables['Update_time'];

}

} // end while

if(!$table_srp_exists || ($last_update_table_specials > $last_update_table_srp)) {

if ($table_srp_exists) {

$query1 = "truncate " . TABLE_SPECIALS_RETAIL_PRICES . "";

if (tep_db_query($query1)) {

$query2 = "insert into " . TABLE_SPECIALS_RETAIL_PRICES . " select s.products_id, s.specials_new_products_price, [url removed, login to view], s.customers_group_id from " . TABLE_SPECIALS . " s where s.customers_group_id = '0'";

$result = tep_db_query($query2);

}

} else { // table specials_retail_prices does not exist

$query1 = "create table " . TABLE_SPECIALS_RETAIL_PRICES . " (products_id int NOT NULL default '0', specials_new_products_price decimal(15,4) NOT NULL default '0.0000', status tinyint, customers_group_id smallint, primary key (products_id) )" ;

$query2 = "insert into " . TABLE_SPECIALS_RETAIL_PRICES . " select s.products_id, s.specials_new_products_price, [url removed, login to view], s.customers_group_id from " . TABLE_SPECIALS . " s where s.customers_group_id = '0'";

if( tep_db_query($query1) && tep_db_query($query2) ) {

; // execution succesfull

}

} // end else

} // end if(!$table_srp_exists || ($last_update_table_specials....

}

function tep_db_check_age_products_group_prices_cg_table($customer_group_id) {

$result = tep_db_query("show table status from `" . DB_DATABASE . "`");

$last_update_table_pgp = strtotime('2000-01-01 12:00:00');

$table_pgp_exists = false;

while ($list_tables = tep_db_fetch_array($result)) {

if ($list_tables['Name'] == TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id) {

$table_pgp_exists = true;

$last_update_table_pgp = strtotime($list_tables['Update_time']);

} elseif ($list_tables['Name'] == TABLE_SPECIALS ) {

$last_update_table_specials = strtotime($list_tables['Update_time']);

} elseif ($list_tables['Name'] == TABLE_PRODUCTS ) {

$last_update_table_products = strtotime($list_tables['Update_time']);

} elseif ($list_tables['Name'] == TABLE_PRODUCTS_GROUPS ) {

$last_update_table_products_groups = strtotime($list_tables['Update_time']);

}

} // end while

if ($table_pgp_exists == false) {

$create_table_sql = "create table " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id . " (products_id int NOT NULL default '0', products_price decimal(15,4) NOT NULL default '0.0000', specials_new_products_price decimal(15,4) default NULL, status tinyint, primary key (products_id) )" ;

$fill_table_sql1 = "insert into " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." select p.products_id, p.products_price, NULL as specials_new_products_price, NULL as status FROM " . TABLE_PRODUCTS . " p";

$update_table_sql1 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_PRODUCTS_GROUPS . " pg using(products_id) set ppt.products_price = pg.customers_group_price where ppt.products_id = pg.products_id and pg.customers_group_id ='" . $customer_group_id . "'";

$update_table_sql2 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_SPECIALS . " s using(products_id) set ppt.specials_new_products_price = s.specials_new_products_price, [url removed, login to view] = [url removed, login to view] where ppt.products_id = s.products_id and s.customers_group_id = '" . $customer_group_id . "'";

if ( tep_db_query($create_table_sql) && tep_db_query($fill_table_sql1) && tep_db_query($update_table_sql1) && tep_db_query($update_table_sql2) ) {

return true;

}

} // end if ($table_pgp_exists == false)

if ( ($last_update_table_pgp < $last_update_table_products && (time() - $last_update_table_products > (int)MAXIMUM_DELAY_UPDATE_PG_PRICES_TABLE * 60) ) || $last_update_table_specials > $last_update_table_pgp || $last_update_table_products_groups > $last_update_table_pgp ) { // then the table should be updated

$empty_query = "truncate " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id . "";

$fill_table_sql1 = "insert into " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." select p.products_id, p.products_price, NULL as specials_new_products_price, NULL as status FROM " . TABLE_PRODUCTS . " p";

$update_table_sql1 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_PRODUCTS_GROUPS . " pg using(products_id) set ppt.products_price = pg.customers_group_price where ppt.products_id = pg.products_id and pg.customers_group_id ='" . $customer_group_id . "'";

$update_table_sql2 = "update " . TABLE_PRODUCTS_GROUP_PRICES.$customer_group_id ." ppt left join " . TABLE_SPECIALS . " s using(products_id) set ppt.specials_new_products_price = s.specials_new_products_price, [url removed, login to view] = [url removed, login to view] where ppt.products_id = s.products_id and s.customers_group_id = '" . $customer_group_id . "'";

if ( tep_db_query($empty_query) && tep_db_query($fill_table_sql1) && tep_db_query($update_table_sql1) && tep_db_query($update_table_sql2) ) {

return true;

}

} else { // no need to update

return true;

} // end checking for update

}

// EOF Separate Pricing Per Customer

?></code>

---------------------------------------------------------------------

Also, another problem is that when I have a product assigned to a Vendor, the product appears in the database, and in the Product Categories, but when the customer clicks on the product, the product doesn't show up, and in it's place it says "Product Not Found!"

I have been told to check the URL to see if products_id is being set correctly. If it is, the problem is in catalog/[url removed, login to view]; if not, then the page that is sending you there (catalog/[url removed, login to view])

This might be a problem with SPPC or the [url removed, login to view] update, since MVS doesn't make any changes in this area.

Please contact me if you have any questions or need more information about this project. I thank you in advance.

Habilidades: PHP

Ver mais: function tep_db_check_age_specials_retail_table oscommerce, oscommerce mvs work, www work at, www when to work com, work view, work editor, work as editor, where to work, when to work com, view work, up work pricing, up string, update oscommerce 2.2 to 2.3.1, true seo expert, to p, the string problem, table customer, string problem, reset link, problem with website, problem with error, problem categories, ppt on php and mysql, ppt mysql, php pg

Acerca do Empregador:
( 0 comentários ) Los Angeles, United States

ID do Projeto: #175408

5 freelancers estão ofertando em média $61 para este trabalho

keyboard999

Hi Sir. I can help you with this project.

$50 USD in 3 dias
(115 Comentários)
6.5
lolacon

Good [url removed, login to view] so kind to check PMB.

$67 USD em 1 dia
(9 Comentários)
4.9
qcomp

I will fix these errors, I have a lot of oscommerce experience. Thanks.

$60 USD em 1 dia
(3 Comentários)
3.1
lifeisboost

Hello, I am an expert on OSC and can provide you with excellent customer service.

$70 USD em 1 dia
(3 Comentários)
2.5
asiawebmedia

[url removed, login to view], we are very [url removed, login to view] have gone through wit the requirements you pasted in your description. We can easily do it with our expertise. we will provide your project with reqiured language. we will p Mais

$60 USD em 1 dia
(1 Comentário)
1.0