Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Extra Fields


KiLLaH
 Share

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

Link to comment
Share on other sites

  • 5 years later...
  • Replies 226
  • Created
  • Last Reply

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...