DVBHardware Posted June 7, 2005 Posted June 7, 2005 Has anybody have the product copy fuction working, that copies products_ship_price, products_ship_price_two correctly ? in admin/catagories.php I have been banging on this all day and everything seems to be in order. When I copy a product: products_ship_price I get the year 2005 products_ship_price_two I get the original $12.00 from products_ship_price of the original product. It should be 12.00 6.00 Thanks I'm not a coder just a splicer.
Guest Posted June 7, 2005 Posted June 7, 2005 sounds like the contribution did not take this into account. looks like it will require modification.
DVBHardware Posted June 8, 2005 Author Posted June 8, 2005 Here is what I have in admin/catagories case 'copy_to_confirm': if (isset($HTTP_POST_VARS['products_id']) && isset($HTTP_POST_VARS['categories_id'])) { $products_id = tep_db_prepare_input($HTTP_POST_VARS['products_id']); $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']); if ($HTTP_POST_VARS['copy_as'] == 'link') { if ($categories_id != $current_category_id) { $check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where products_id = '" . (int)$products_id . "' and categories_id = '" . (int)$categories_id . "'"); $check = tep_db_fetch_array($check_query); if ($check['total'] < '1') { tep_db_query("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$categories_id . "')"); } } else { $messageStack->add_session(ERROR_CANNOT_LINK_TO_SAME_CATEGORY, 'error'); } } elseif ($HTTP_POST_VARS['copy_as'] == 'duplicate') { // BoF IndvShip - $product_query = tep_db_query("select products_ship_price, products_ship_price_two, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'"); $product = tep_db_fetch_array($product_query); tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, products_image, products_price, products_ship_price, products_ship_price_two, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "', now() , '" . tep_db_input($product['products_ship_price']) . "' , '" . tep_db_input($product['products_ship_price_two']) . "' , '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')"); $dup_products_id = tep_db_insert_id(); // EoF IndvShip - // BoF Header Tag Controller $description_query = tep_db_query("select language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$products_id . "'"); // EoF Header Tag Controller while ($description = tep_db_fetch_array($description_query)) { // BoF Header Tag Controller tep_db_query("insert into " . TABLE_PRODUCTS_DESCRIPTION . " (products_id, language_id, products_name, products_description, products_head_title_tag, products_head_desc_tag, products_head_keywords_tag, products_url, products_viewed) values ('" . (int)$dup_products_id . "', '" . (int)$description['language_id'] . "', '" . tep_db_input($description['products_name']) . "', '" . tep_db_input($description['products_description']) . "', '" . tep_db_input($description['products_head_title_tag']) . "', '" . tep_db_input($description['products_head_desc_tag']) . "', '" . tep_db_input($description['products_head_keywords_tag']) . "', '" . tep_db_input($description['products_url']) . "', '0')"); // EoF Header Tag Controller } I'm not a coder just a splicer.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.