Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Header Tags Controller Admin Install Issue


zboyblue

Recommended Posts

The instructions say to replace the following BUT my code is a little different. This is the code that the instructions say I should have:

 

<?php
 } elseif ($action == 'new_product_preview') {
   if (tep_not_null($HTTP_POST_VARS)) {
     $pInfo = new objectInfo($HTTP_POST_VARS);
     $products_name = $HTTP_POST_VARS['products_name'];
     $products_description = $HTTP_POST_VARS['products_description'];
     $products_url = $HTTP_POST_VARS['products_url'];
  } else {
     $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . $HTTP_GET_VARS['pID'] . "'");
     $product = tep_db_fetch_array($product_query);
   }

 

This is the code that I HAVE:

 

<?php
 } elseif ($action == 'new_product_preview') {
   if (tep_not_null($HTTP_POST_VARS)) {
     $pInfo = new objectInfo($HTTP_POST_VARS);
     $products_name = $HTTP_POST_VARS['products_name'];
     $products_description = $HTTP_POST_VARS['products_description'];
     $products_url = $HTTP_POST_VARS['products_url'];
   } else {
     $product_query = tep_db_query("select p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "'");
     $product = tep_db_fetch_array($product_query);

     $pInfo = new objectInfo($product);
     $products_image_name = $pInfo->products_image;
   }

 

Difference is the last 2 lines. Can someone please tell me what I should do here? I have other mods but I don't know what I would have done to add these lines. I don't want to mess anything up. Your help is greatly appreciated.

 

Thanks!

 

Craig

Link to comment
Share on other sites

I think I made it work. I dissected the code the instructions suggested to replace MY code and and added the changes to my file and left those two last lines and it works.

 

If anyone knows what those lines are for PLEASE let me know, I don't want to have code that does something unexpected. The two lines that I left in my file are:

 

$pInfo = new objectInfo($product);

$products_image_name = $pInfo->products_image;

 

Once I got past that I finally got it to work (after several errors and starting over and over .... and over : ). The last and largest problem was a missing ) at the end of one of the code snips I had to add. Once I added that whalla, it works.

 

Now the only thing is in the admin for an item I now have the text "TEXT_PRODUCT_METTA_INFO" above the other two language description boxes. I am going to try to figure out the code but if you know how to fix it please let me know!

 

Thanks!!

 

Craig

Link to comment
Share on other sites

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.

×
×
  • Create New...