Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Show extra info in shopping cart, and save in Order


zeusco

Recommended Posts

Posted

After long work i could insert extra info in shopping cart table, doing the next steps:

 

 

1.- Product_Info.php

 

echo tep_draw_hidden_field('sku', $registro['sku']) .tep_draw_hidden_field('id['.$lines['opcion_id_a'].']', $lines['options_values_id_a']) . tep_draw_hidden_field('id['.$lines['opcion_id_b'].']', $lines['options_values_id_b']) . tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('bot_comprar.jpg', IMAGE_BUTTON_IN_CART);

 

2.- Application_top.php

 

case 'add_product' : if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {

$cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id'], $HTTP_POST_VARS['sku']);

}

 

3.- Shopping_Cart.php

 

// insert into database

if (tep_session_is_registered('customer_id')) tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added, sku) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id_string) . "', '" . (int)$qty . "', '" . date('Ymd') ."', '". (int)$sku . "')");

 

 

 

Since here begin the problem, becose this only work when the user is login. The following code make the same but when the client is NOT LOGIN

 

if (!tep_db_num_rows($product_query)) {

tep_db_query("insert into " . TABLE_CUSTOMERS_BASKET . " (customers_id, products_id, customers_basket_quantity, customers_basket_date_added, sku) values ('" . (int)$customer_id . "', '" . tep_db_input($products_id) . "', '" . $qty . "', '" . date('Ymd') . "', '" . $sku. "KILO')");

 

PD: KILO is a flag to make debugg

 

But don`t work, becose SKU need come from SESSION file :-" and i don`t know save the SKU field in to SESSION.

 

Then the next step is make the SKU field works through SESSION, becose oscommerce SAVE the shopping cart in file session when the user is NOT LOGIN.

 

After that, i need show this SKU in shopping cart page with the MODEL or PRODUCT NAME

 

And after thar the next step is SAVE the SKU field in to ORDER table.

 

PLEASE ANY HELP TO FINISH THIS WORK

 

Thks from Chile

 

Julio Herrera

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...