Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.


[Contribution] Extra Fields

Recommended Posts

I wanted to copy the extra fields also if I'm copying a products to another place. I found this in my old files,it's working for me:



To Copy extra fields

Look for (in catalog/admin/categories.php):

$dup_products_id = tep_db_insert_id();


Add after it:

// BOF: Extra fields to database on duplicate

$xf_query = tep_db_query("select products_id, products_extra_fields_id, products_extra_fields_value from " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " where products_id = '" . (int)$products_id . "'");

while($xfield = tep_db_fetch_array($xf_query)) {


tep_db_query("insert into " . TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS . " (products_id, products_extra_fields_id, products_extra_fields_value) values ('" . (int)$dup_products_id . "', '" . tep_db_input($xfield['products_extra_fields_id']) . "', '" . tep_db_input($xfield['products_extra_fields_value']) . "')");


// EOF: Extra fields to database on duplicate

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now