Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Uploading products from CSV file


WebDev22

Recommended Posts

Posted

I did a search in the forums for the best way to import products from a spreadsheet and found Eazy Populate and Easy Populate. Are they the same product? Any recommendations which to use for importing products with attributes?

Posted

EZ is v3, EP is v2.

 

EP is not the easiest to use with attributes but I have done it.

 

The documentation that comes with it is very good.

 

G

Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Posted
EZ is v3, EP is v2.

 

EP is not the easiest to use with attributes but I have done it.

 

The documentation that comes with it is very good.

 

G

 

Thanks. Can you remind me how to check osCommerce version? I know ours is v2 but can't remember how to check.

Posted
Thanks. Can you remind me how to check osCommerce version? I know ours is v2 but can't remember how to check.

 

Never mind about the version question. I found it. Thanks.

Posted

I think Easy Populate 2.76h-MS2 is awesome. I'm not great at this, but I can read, and I was able to set it up and also create extra fields and add them to EP by reading and imitating. I had previously failed with the add extra fields contribution.

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted
I think Easy Populate 2.76h-MS2 is awesome. I'm not great at this, but I can read, and I was able to set it up and also create extra fields and add them to EP by reading and imitating. I had previously failed with the add extra fields contribution.

That's good to hear. I'm working with it now and need to upload a database of around 300 products in six major categories and 20 subcategories. I'm still reading but assume there's a way to set up the CSV so that it creates and populates certain categories/subcategories.

Posted

I would manually add one product to each category, through the Admin Catalog Categories/Products Add category button and add product button. After adding one per category, I would download the catalog database, then just imitate and upload. It worked well for me. I recall the Attributes downloaded differently than I expected, so you get to see exactly how it wants the cvs file to look.

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted

I uploaded a small sampling of the database as a test but the attributes were ignored. Any ideas on how to upload attributes as well?

Posted

Trying to share what little I know to try and buy some forum karma.....

 

As I said, they don't look like you would expect (if you expected anything). You can not just create them because you will never guess the naming structure. You really have to create them manually, then download to see how it structured them, then imitate. Okay, actually there is a logical progression, but that doesn't mean database columns will be created on upload. It has to be quickest to just manually create attributes then download to see how it structured them. Each option gets 2 columns, each attribute gets 3 columns.

 

This is my header row, I added spaces between the example rows to group them logically.

 

v_products_model

v_products_name_1

v_products_description_1

v_products_url_1

v_products_image

v_products_image_lg

v_products_subtitle

v_products_developer

v_products_rating

v_products_condition

v_products_year

v_products_price

v_products_quantity

v_products_weight

v_date_avail

v_date_added

v_categories_image_1

v_categories_name_1_1

v_categories_image_2

v_categories_name_2_1

v_categories_image_3

v_categories_name_3_1

v_categories_image_4

v_categories_name_4_1

v_categories_image_5

v_categories_name_5_1

v_categories_image_6

v_categories_name_6_1

v_categories_image_7

v_categories_name_7_1

v_manufacturers_name

 

v_attribute_options_id_1 has a value of "1" for every product

v_attribute_options_name_1_1 has a value of "Size" for every product

 

v_attribute_values_id_1_1 has a value of "1" for every product

v_attribute_values_name_1_1_1 has a value of "6.5 Inch" for every product

v_attribute_values_price_1_1 has a value of "0" for every product available in this size, for which you want the option to appear.

 

v_attribute_values_id_1_2 has a value of "2" for every product

v_attribute_values_name_1_2_1 has a value of "7 Inch" for every product

v_attribute_values_price_1_2 has a value of "0" for every product available in this size

 

v_attribute_values_id_1_3 has a value of "3" for every product

v_attribute_values_name_1_3_1 has a value of "7.5 Inch" for every product

v_attribute_values_price_1_3 has a value of "0" for every product available in this size

 

v_attribute_options_id_2 has a value of "2" for every product

v_attribute_options_name_2_1 has a value of "Color" for every product

 

v_attribute_values_id_2_1 has a value of "4" for every product

v_attribute_values_name_2_1_1 has a value of "red" for every product

v_attribute_values_price_2_1 has a value of "0" for every product available in this color

 

v_attribute_values_id_2_2 has a value of "5" for every product

v_attribute_values_name_2_2_1 has a value of "blue" for every product

v_attribute_values_price_2_2 has a value of "0" for every product available in this color

 

v_attribute_values_id_2_3 has a value of "6" for every product

v_attribute_values_name_2_3_1 has a value of "green" for every product

v_attribute_values_price_2_3 has a value of "0" for every product available in this color

 

v_attribute_values_id_2_4

v_attribute_values_name_2_4_1

v_attribute_values_price_2_4

v_attribute_values_id_2_5

v_attribute_values_name_2_5_1

v_attribute_values_price_2_5

v_attribute_values_id_2_6

v_attribute_values_name_2_6_1

v_attribute_values_price_2_6

v_attribute_values_id_2_7

v_attribute_values_name_2_7_1

v_attribute_values_price_2_7

v_attribute_values_id_2_8

v_attribute_values_name_2_8_1

v_attribute_values_price_2_8

v_attribute_values_id_2_9

v_attribute_values_name_2_9_1

v_attribute_values_price_2_9

v_attribute_values_id_2_10

v_attribute_values_name_2_10_1

v_attribute_values_price_2_10

v_attribute_values_id_2_11

v_attribute_values_name_2_11_1

v_attribute_values_price_2_11

v_attribute_values_id_2_12

v_attribute_values_name_2_12_1

v_attribute_values_price_2_12

 

v_attribute_options_id_3

v_attribute_options_name_3_1

 

v_attribute_values_id_3_1

v_attribute_values_name_3_1_1

v_attribute_values_price_3_1

 

v_attribute_values_id_3_2

v_attribute_values_name_3_2_1

v_attribute_values_price_3_2

 

v_tax_class_title

v_status EOREOR

 

 

Walter

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted

Thanks, Walter. This is very helpful. After looking at the database in more depth, I wonder if I actually need to use attributes. Can attributes simply display information rather than presenting multiple options?

 

The database we received from the vendor contains five columns: Wattage, Bulb Size, Rated Life, etc. There's no description. Ideally, we would like to create a product page that displays the information like this:

 

Wattage (Volts): 120

Bulb Size: F73

Rated Life: 1200

 

Any suggestions or ideas on how to approach this?

Posted

Those are not "attributes" in Oscommerce talk. I had the same thing, with video games. I set up attributes for system, genre, ratings, ect. Then when I looked at my handywork, it appeared as though if you purchased the game, you could choose between rated E for everyone, T for teen or M for mature, um, not how games work, or light bulbs.

 

What I did was go into the products table and create new columns. Some words like "year" are like system words or something, so that was my first mistake. Preface the title with "products". products_year NOT year

 

So you add:

 

products_watts

products_size

products_life

 

NO v_ the v_products_watts has to do with ezpopulate and gets coded there. v_products_watts will be in the header of the download and upload files, but the database column is simply products_watts.

 

 

There is a lot of useful information in the comments in catalog/admin/easypopulate.php

 

Around line 246 read "BEGIN Define Custom Fields for your products database"

 

 

prompting you to add something like this:

 

$custom_fields[TABLE_PRODUCTS] = array( 'products_watts' => 'Watts', 'products_size' => 'Size', 'products_life' => 'Life' );

$custom_fields[TABLE_PRODUCTS_DESCRIPTION] = array();

 

 

=> 'Watts' (above) is just what it will be called next to the checkbox on the easy populate page for future inclusion or exclusion in downloads.

 

Then I imitated some more. On the product_info.php, around line 86 I found

 

$products_name = $product_info['products_name'];

 

So I added

 

$products_watts = $product_info['products_watts'];

$products_developer = $product_info['products_developer'];

$products_condition = $product_info['products_condition'];

 

And the ever so awesome:

 

$products_rating_image = '<img src="images/esrb_' . $product_info['products_rating'] . '.jpg" border="0" />';

 

Then on the product_info.php I added:

 

        <tr>
	  <td class="mymain" align="left" colspan="2"><?php echo $products_name; ?>  (<?php echo $products_year; ?>)</td>
       </tr> 	       
<tr>  
   <td width="50%" class="mysub" align="left">Wattage (Volts): <?php echo $products_watts; ?></td>
         <td width="50%" class="mysub" align="left">Bulb Size: <?php echo $products_size; ?></td>
       </tr>
       <tr>  
   <td width="50%" class="mysub" align="left">Rated Life: <?php echo $products_life; ?></td>
         <td width="50%" class="mysub" align="left">Developer: <?php echo $products_developer; ?></td>
       </tr>

And the ever so awesome:


        <td align="left"><?php echo $products_rating_image; ?></td>

 

 

I smell kharma, someones gonna answer my question!!!

 

Walter

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted
I smell kharma, someones gonna answer my question!!!

 

This is extremely helpful, although a lot to absorb, especially for someone who normally doesn't wear this hat. Thanks, Walter!

Posted

Early on in this process, I had some of my column headers defined as such (Watts, Life, etc.). I assume these were ignored?

Posted

i just went through this same exact worm hole!

 

as i was installing and configuring easypopulate, i realized that options and attributes weren't what i needed, but extra product fields. so with a better understanding in hand of what options, attributes and extra fields are, i'm adding the "Products Extra Fields" contribution (http://www.oscommerce.com/community/contributions,2202) and ditching the options and attributes i had configured. the configuration instructions of easy populate are very educational!

 

:-)

Posted

especially for someone who normally doesn't wear this hat.

 

I never touched this stuff before February. I see you speak in complete sentences and use punctuation, you should have no trouble.

 

 

Early on in this process, I had some of my column headers defined as such (Watts, Life, etc.). I assume these were ignored?

 

On uploading? Yes, if there was no corresponding column in the database table, and easy populate wasn't told to upload it.

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted

I used Products Extra Fields first, then ditched it for easy populate. If I recall, extra fields was to make the columns in the table and you still had to know too much, and after not getting it to work, it seemed easier to just make the columns myself and easy populate seemed better, although I think it serves a different purpose, like if you use Products Extra Fields you still might need easy populate to upload and download smoothly. I think, my head was spinning at the time. I look at stuff I did in February and I'm like "I wrote that?"

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted
I had the same thing, with video games. I set up attributes for system, genre, ratings, ect. Then when I looked at my handywork, it appeared as though if you purchased the game, you could choose between rated E for everyone, T for teen or M for mature, um, not how games work, or light bulbs.

 

What a cool feature that would be. I've got kids so I'm all about E for everyone.

 

Then I imitated some more. On the product_info.php, around line 86 I found

 

$products_name = $product_info['products_name'];

 

So I added

 

$products_watts = $product_info['products_watts'];

$products_developer = $product_info['products_developer'];

$products_condition = $product_info['products_condition'];

 

And the ever so awesome:

 

$products_rating_image = '<img src="images/esrb_' . $product_info['products_rating'] . '.jpg" border="0" />';

For the code above, did you add your code within the 'else' statement?

Posted

I just plugged it in the way $products_name = $product_info['products_name']; was. It's all about copying, I don't know what I'm doing.

 

It's like Oh, echo $products_name pastes the name? I'll try echo $products_year over there. Then the error says $products_year isn't defined. No? Well where is $products_name defined? $products_name = $product_info['products_name']; Hmmm....$products_year = $product_info['products_year']; ? BINGO! It works.

 

I edited and obviously changed to watts in my example, here's my real page:

 

<?php
/*
 $Id: product_info2.php 1739 2007-12-20 00:52:16Z hpdl $

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 $product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $product_check = tep_db_fetch_array($product_check_query);

// the following cPath references come from application_top.php
 $category_depth = 'top';
 if (isset($cPath) && tep_not_null($cPath)) {
   $categories_products_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_TO_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
   $cateqories_products = tep_db_fetch_array($categories_products_query);
   if ($cateqories_products['total'] > 0) {
     $category_depth = 'products'; // display products
   } else {
     $category_parent_query = tep_db_query("select count(*) as total from " . TABLE_CATEGORIES . " where parent_id = '" . (int)$current_category_id . "'");
     $category_parent = tep_db_fetch_array($category_parent_query);
     if ($category_parent['total'] > 0) {
       $category_depth = 'nested'; // navigate through the categories
     } else {
       $category_depth = 'products'; // category has no products, but display the 'no products' message
     }
   }
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_DEFAULT);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <meta name="author" content="Walter Doherty" />
 <meta name="verify-v1" content="YgE4olHAdThmx/WxD6D6TpUyimlKEse+uyRTHSFyScE=" />
 <meta name="description" content="Product Info" />
 <meta name="keywords" content="Product Info" />
 <link rel="SHORTCUT ICON" href="favicon.ico" />
 <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>" />
 <link rel="stylesheet" type="text/css" href="stylesheet.css" />
 <title>Instant Video Games - Product Info</title>
<!-- Begin Preload Script -->

<script type="text/javascript">
//<![CDATA[
<!--

function newImage(arg) {
if (document.images) {
       rslt = new Image();
       rslt.src = arg;
       return rslt;
}
}

function changeImages() {
if (document.images && (preloadFlag == true)) {
       for (var i=0; i<changeImages.arguments.length; i+=2) {
               document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
       }
}
}

var preloadFlag = false;
function preloadImages() {
if (document.images) {
       id23 = newImage("images/23.jpg");
       id24 = newImage("images/24.jpg");
       id25 = newImage("images/25.jpg");
       id26 = newImage("images/26.jpg");
       id27 = newImage("images/27.jpg");
       id28 = newImage("images/28.jpg");
       id29 = newImage("images/29.jpg");
       id30 = newImage("images/30.jpg");
       id31 = newImage("images/31.jpg");
       id32 = newImage("images/32.jpg");
       id206 = newImage("images/206.jpg");
       id207 = newImage("images/207.jpg");
       id208 = newImage("images/208.jpg");
       id209 = newImage("images/209.jpg");
       id210 = newImage("images/210.jpg");
       id211 = newImage("images/211.jpg");
       id212 = newImage("images/212.jpg");
       id213 = newImage("images/213.jpg");
       id214 = newImage("images/214.jpg");
       id215 = newImage("images/215.jpg");
       idupover = newImage("images/upover.jpg");
       iddowndown = newImage("images/downdown.jpg");
       iddownover = newImage("images/downover.jpg");
       idupdown = newImage("images/updown.jpg");
       idrightover = newImage("images/rightover.jpg");
       idrightdown = newImage("images/rightdown.jpg");
       idhomeover = newImage("images/homeover.jpg");
       idhomedown = newImage("images/homedown.jpg");
       idleftover = newImage("images/leftover.jpg");
       idleftdown = newImage("images/leftdown.jpg");
       id310over = newImage("images/310over.jpg");
	   id311over = newImage("images/311over.jpg");
	   id312over = newImage("images/312over.jpg");
	   id313over = newImage("images/313over.jpg");
	   preloadFlag = true;
}
}

// -->
//]]>
</script>
<!-- End Preload Script -->
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="preloadImages();">
<?php require(DIR_WS_INCLUDES . 'top_menu.php'); ?>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
 <td valign="top" width="145"><?php require(DIR_WS_INCLUDES . 'left_menu.php'); ?>
       <table border="0" cellspacing="0" cellpadding="2">
          <!-- left_navigation //-->
          <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
          <!-- left_navigation_eof //-->
          </table></td>
 <td valign="top" width="100%">
<!-- START CENTER CONTENT  -->	 
<!-- body //-->
<table border="0" width="100%" cellspacing="0" cellpadding="20">
  <tr>
   <td valign="top">
    <table border="0" width="100%" cellspacing="0" cellpadding="3" valign="top">
     <tr>
      <td valign="top"></td>
<!-- body_text //-->
      <td width="100%" valign="top"><?php echo tep_draw_form('cart_quantity', tep_href_link(FILENAME_PRODUCT_INFO, tep_get_all_get_params(array('action')) . 'action=add_product')); ?>
        <table border="0" width="100%" cellspacing="0" cellpadding="0">
<?php
 if ($product_check['total'] < 1) {
?>
     <tr>
       <td><?php new infoBox(array(array('text' => TEXT_PRODUCT_NOT_FOUND))); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2" class="productListing">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
<?php
 } else {
   $product_info_query = tep_db_query("select p.products_year, p.products_subtitle, p.products_developer, p.products_condition, p.products_id, pd.products_name, cd.categories_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_rating, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_CATEGORIES_DESCRIPTION . " cd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
   $product_info = tep_db_fetch_array($product_info_query);

   tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

   if ($new_price = tep_get_products_special_price($product_info['products_id'])) {
     $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>';
   } else {
     $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id']));
   }

     $products_year = $product_info['products_year'];
     $products_name = $product_info['products_name'];
  $products_subtitle = $product_info['products_subtitle'];
     $products_developer = $product_info['products_developer'];
     $products_condition = $product_info['products_condition'];
     $products_rating_image = '<img src="images/esrb_' . $product_info['products_rating'] . '.jpg" border="0" />';
?>

<?php 

$manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image, mi.manufacturers_url from " . TABLE_MANUFACTURERS . " m left join " . TABLE_MANUFACTURERS_INFO . " mi on (m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'), " . TABLE_PRODUCTS . " p  where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id");
   $manufacturer = tep_db_fetch_array($manufacturer_query);                  
?>
     <tr>	  
       <td>
<!-- START THE BOX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->	       
<table cellpadding="20" width="100%" class="productListing" border="0">
 <tr>
   <td>
  <table width="100%">
       <tr>
	  <td class="mymain" align="left" colspan="2"><?php echo $products_name; ?>  (<?php echo $products_year; ?>)</td>
       </tr> 
	<tr>
         <td class="mymain" align="left" colspan="2"><?php echo $products_subtitle; ?></td>
       </tr> 
       <tr>
	  <td align="left"><?php echo $products_rating_image; ?></td>
	  <td align="center"><?php echo tep_image(DIR_WS_IMAGES_LG . $product_info['products_image'],
$product_info['products_name']); ?></td>
       </tr> 
	<tr>
	  <td></td>
	  <td class="mymain" align="center"><?php echo $products_price; ?></td>
       </tr>
  </table>
     <table width="100%">
       <tr>  
      <td width="50%" class="mysub" align="left">Genre: 
	  <?php $category_name_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = " . (int)$current_category_id . " and language_id = " . (int)$languages_id);
$category_name = tep_db_fetch_array($category_name_query);
echo $category_name['categories_name']; ?></td>
         <td width="50%" class="mysub" align="left">Publisher: <?php echo $manufacturer['manufacturers_name']; ?></td>
       </tr> 
       <tr>  
      <td width="50%" class="mysub" align="left">Condition: <?php echo $products_condition; ?></td>
         <td width="50%" class="mysub" align="left">Developer: <?php echo $products_developer; ?></td>
       </tr>
  </table></td>
 </tr>
</table>
</td>
<!-- END THE BOX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX -->	
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   $reviews_query = tep_db_query("select count(*) as count from " . TABLE_REVIEWS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
   $reviews = tep_db_fetch_array($reviews_query);
   if ($reviews['count'] > 0) {
?>
     <tr>
       <td class="main"><?php echo TEXT_CURRENT_REVIEWS . ' ' . $reviews['count']; ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
<?php
   }

   if ($product_info['products_date_available'] > date('Y-m-d H:i:s')) {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_AVAILABLE, tep_date_long($product_info['products_date_available'])); ?></td>
     </tr>
<?php
   } else {
?>
     <tr>
       <td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>
     </tr>
<?php
   }
?>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_REVIEWS, tep_get_all_get_params()) . '">' . tep_image_button('button_reviews.gif', IMAGE_BUTTON_REVIEWS) . '</a>'; ?></td>
               <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><hr />
<?php
   if ((USE_CACHE == 'true') && empty($SID)) {
     echo tep_cache_also_purchased(3600);
   } else {
     include(DIR_WS_MODULES . FILENAME_ALSO_PURCHASED_PRODUCTS);
   }
 }
?>
       </td>
     </tr>
   </table><table>
 <tr>
   <td class="main">
         <p><?php echo stripslashes($product_info['products_description']); ?></p>
<?php
   $products_attributes_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "'");
   $products_attributes = tep_db_fetch_array($products_attributes_query);
   if ($products_attributes['total'] > 0) {
?>
         <table border="0" cellspacing="0" cellpadding="2" class="productListing">
           <tr>
             <td class="main" colspan="2"><?php echo TEXT_PRODUCT_OPTIONS; ?></td>
           </tr>
<?php
     $products_options_name_query = tep_db_query("select distinct popt.products_options_id, popt.products_options_name from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = popt.products_options_id and popt.language_id = '" . (int)$languages_id . "' order by popt.products_options_name");
     while ($products_options_name = tep_db_fetch_array($products_options_name_query)) {
       $products_options_array = array();
       $products_options_query = tep_db_query("select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pa.options_id = '" . (int)$products_options_name['products_options_id'] . "' and pa.options_values_id = pov.products_options_values_id and pov.language_id = '" . (int)$languages_id . "'");
       while ($products_options = tep_db_fetch_array($products_options_query)) {
         $products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
         if ($products_options['options_values_price'] != '0') {
           $products_options_array[sizeof($products_options_array)-1]['text'] .= ' (' . $products_options['price_prefix'] . $currencies->display_price($products_options['options_values_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) .') ';
         }
       }

       if (isset($cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']])) {
         $selected_attribute = $cart->contents[$HTTP_GET_VARS['products_id']]['attributes'][$products_options_name['products_options_id']];
       } else {
         $selected_attribute = false;
       }
?>
           <tr>
             <td class="main"><?php echo $products_options_name['products_options_name'] . ':'; ?></td>
             <td class="main"><?php echo tep_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $selected_attribute); ?></td>
           </tr>
<?php
     }
?>
         </table>
<?php
   }
?>
    </td>
</tr>
</table></form></td>
<!-- body_text_eof //-->
   </tr>
  </table>
 </td>
</tr>
</table> 		  
<!-- body_eof //-->

<!-- END CENTER CONTENT -->	
          </td>
      <td valign="top" width="155">
    <table border="0" cellspacing="0" cellpadding="2">
        <!-- right_navigation //-->
        <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
        <!-- right_navigation_eof //-->
       </table></td>
</tr>
</table>

<map name="home_Map">
   <area shape="poly" alt="PS3" coords="58,95, 62,98, 74,101, 78,100, 86,97, 91,94, 103,107, 105,108, 100,113, 90,118, 80,121, 61,120, 59,119, 48,114, 41,110, 40,110, 41,106, 54,94" href="ps3.php"
    onmouseover="changeImages('home', 'images/downover.jpg'); return true;" 
 onmouseout="changeImages('home', 'images/home.jpg'); return true;" 
 onmousedown="changeImages('home', 'images/downdown.jpg'); return true;" 
 onmouseup="changeImages('home', 'images/downover.jpg'); return true;" />
   <area shape="poly" alt="Xbox" coords="76,29, 77,28, 79,29, 85,30, 87,31, 95,34, 106,40, 106,43, 101,47, 91,56, 85,53, 79,52, 75,51, 66,52, 64,53, 55,57, 53,56, 51,53, 48,51, 44,46, 40,45, 39,43, 40,41, 44,40, 50,35, 55,33, 55,32, 69,29" href="xbox.php" 
onmouseover="changeImages('home', 'images/upover.jpg'); return true;" 
onmouseout="changeImages('home', 'images/home.jpg'); return true;" 
   onmousedown="changeImages('home', 'images/updown.jpg'); return true;" 
onmouseup="changeImages('home', 'images/upover.jpg'); return true;" />
  <area shape="poly" alt="Forward" coords="110,45, 115,53, 120,67, 118,88, 117,94, 110,105, 106,108, 96,100, 92,93, 92,92, 96,88, 99,80, 98,68, 97,66, 94,61, 92,58, 90,57, 91,55, 93,53, 96,52, 98,50, 106,41"
onmouseover="changeImages('home', 'images/rightover.jpg'); return true;"
onmouseout="changeImages('home', 'images/home.jpg'); return true;"
onmousedown="changeImages('home', 'images/rightdown.jpg'); history.forward(); return true;"
onmouseup="changeImages('home', 'images/rightover.jpg'); return true;">
  <area shape="poly" alt="There's no place like home" coords="82,52, 93,60, 98,70, 97,80, 96,86, 86,98, 80,100, 79,99, 77,100, 65,99, 63,98, 58,95, 56,93, 52,88, 49,80, 50,68, 57,58, 62,54, 70,51" href="index.php"
onmouseover="changeImages('home', 'images/homeover.jpg'); return true;"
onmouseout="changeImages('home', 'images/home.jpg'); return true;"
onmousedown="changeImages('home', 'images/homedown.jpg'); return true;"
onmouseup="changeImages('home', 'images/homeover.jpg'); return true;" />
  <area shape="poly" alt="Back" coords="56,59, 53,63, 50,69, 51,84, 56,94, 46,104, 40,109, 33,101, 30,93, 29,91, 28,87, 27,83, 26,77, 27,65, 30,55, 37,44, 39,42, 40,41"
onmouseover="changeImages('home', 'images/leftover.jpg'); return true;"
onmouseout="changeImages('home', 'images/home.jpg'); return true;"
onmousedown="changeImages('home', 'images/leftdown.jpg'); history.back(); return true;"
onmouseup="changeImages('home', 'images/leftover.jpg'); return true;" />
 </map>

<!-- header //-->
<?php require(DIR_WS_INCLUDES . 'header.php'); ?>
<!-- header_eof //-->

<!-- Start google-analytics -->  
 <script type="text/javascript">
//<![CDATA[
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
//]]>
</script>
<script type="text/javascript">
//<![CDATA[
try {
var pageTracker = _gat._getTracker("UA-7277764-2");
pageTracker._trackPageview();
} catch(err) {}
//]]>
</script>
<!-- End google-analytics -->
</body>
</html>
<!-- close session (store variables) -->
<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

My experience relates to osCommerce Online Merchant v2.2 RC2

Posted
I just plugged it in the way $products_name = $product_info['products_name']; was. It's all about copying, I don't know what I'm doing.

 

It's like Oh, echo $products_name pastes the name? I'll try echo $products_year over there. Then the error says $products_year isn't defined. No? Well where is $products_name defined? $products_name = $product_info['products_name']; Hmmm....$products_year = $product_info['products_year']; ? BINGO! It works.

This has really been helpful. Thanks. Did you also set up your Admin's Categories/Products pages (the page where you add new products) so that it includes the new custom fields?

Posted

I've set up a test CSV file with products_length, products_wattage, etc., but can't get these custom fields to import when using Easy Populate.

Here's what I have for the code to import custom fields in easypopulate.php:

$custom_fields[TABLE_PRODUCTS] = array( 
'products_length' => 'Length', 
'products_end' => 'End', 
'products_wattage' => 'Wattage', 
'products_reflector' => 'Reflector', 
'products_uvb' => 'UVB', 
'products_rated' => 'Rated' );

Does this look correct? I tried to figure out what was wrong before posting.

  • 4 weeks later...
Posted
I've set up a test CSV file with products_length, products_wattage, etc., but can't get these custom fields to import when using Easy Populate.

Here's what I have for the code to import custom fields in easypopulate.php:

$custom_fields[TABLE_PRODUCTS] = array( 
'products_length' => 'Length', 
'products_end' => 'End', 
'products_wattage' => 'Wattage', 
'products_reflector' => 'Reflector', 
'products_uvb' => 'UVB', 
'products_rated' => 'Rated' );

Does this look correct? I tried to figure out what was wrong before posting.

 

Hi,

 

Did you ever solve this issue here. I am stock in the same place.

 

Thanks in advance for the answer.

Posted
Hi,

 

Did you ever solve this issue here. I am stock in the same place.

 

Thanks in advance for the answer.

 

 

Can anyone out there please provide a link to Easy Populate for me? I found it once, but did not save the link, and ALL the search options in this forum do not seem to work for me. ? It appears to be no where...

Posted

Googling for site:addons.oscommerce.com Easy Populate finds it. Or just googling for Easy Populate. Or searching the Contributions area for Easy Populate (although that search returns a lot of irrelevant links as well).

 

Searching the forums for Easy Populate is the wrong way to go about it, as Easy Populate would not be here. At best, you might find the support thread.

Always back up before making changes.

Posted
Googling for site:addons.oscommerce.com Easy Populate finds it. Or just googling for Easy Populate. Or searching the Contributions area for Easy Populate (although that search returns a lot of irrelevant links as well).

 

Searching the forums for Easy Populate is the wrong way to go about it, as Easy Populate would not be here. At best, you might find the support thread.

 

 

Thank you! I Google everything but did not think of that one! I didn't remember how I found it last time...

Posted

I've added custom fields to easypopulate.php but can't seem to get custom fields to import. Are custom fields supposed to be added to easypopulate.php in more than one place? I added them around line 301. Any ideas?

Archived

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

×
×
  • Create New...