Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

back from a preview page


celia_ccs

Recommended Posts

Posted

Hi,

 

I'm developping a new contribution for updating the homepage. But I have a very simple problem.

 

In the admin interface the contrib has quite the same srtucture as the categories.php file. Once done an update or inserted a new element you can preview the results and then go back and edit it again if you want, or save it.

But I struggle to display again the data in the editing page after doing back from the preview.

If it's a new element, nothing appears when I go back.

If it's an updated element, only the older data from the database are displayed.

 

if someone could explain what in the code of categories.php enable that the data appears again when u go from action=new_product_preview back to to new_product.

I mean the updated data or the new data if it's a new product.

 

I don't know if it's clear ? :huh:

 

any help would be useful. Thanks.

Celia

-----------------------------------------

OSCommerce version : MS2

Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate

Posted

make sure the arguments you need in both pages are re-posted. See how he does with the $back_url and $back_url_params appending the values/args.

Posted

ok, I thought so, but I was not sure how to do that.

 

is this part of the code that is used to re-post the information to the previous page?

 

/* Re-Post all POST'ed variables */

      reset($HTTP_POST_VARS);

      while (list($key, $value) = each($HTTP_POST_VARS)) {

        if (!is_array($HTTP_POST_VARS[$key])) {

          echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));

        }

      }

      $languages = tep_get_languages();

      for ($i=0, $n=sizeof($languages); $i<$n; $i++) {

        echo tep_draw_hidden_field('products_name[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_name[$languages[$i]['id']])));

        echo tep_draw_hidden_field('products_description[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_description[$languages[$i]['id']])));

        echo tep_draw_hidden_field('products_url[' . $languages[$i]['id'] . ']', htmlspecialchars(stripslashes($products_url[$languages[$i]['id']])));

      }

      echo tep_draw_hidden_field('products_image', stripslashes($products_image_name));

 

      echo tep_image_submit('button_back.gif', IMAGE_BACK, 'name="edit"') . '  ';

 

      if (isset($HTTP_GET_VARS['pID'])) {

        echo tep_image_submit('button_update.gif', IMAGE_UPDATE);

      } else {

        echo tep_image_submit('button_insert.gif', IMAGE_INSERT);

      }

      echo '  <a href="' . tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . (isset($HTTP_GET_VARS['pID']) ? '&pID=' . $HTTP_GET_VARS['pID'] : '')) . '">' . tep_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>';

?>

-----------------------------------------

OSCommerce version : MS2

Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate

Posted

yes thats the one. now look the tep_draw_form above that code. That should have the action specified.

Posted

Unfortunately it still doesn't work. :( Now it doesn't even go to the editing page after the preview. I've posted the code of my page on the contribution forum. Would be nice if someone could give me a hand there.

 

thanks,

 

http://www.oscommerce.com/forums/index.php?act=ST&f=41&t=172075

-----------------------------------------

OSCommerce version : MS2

Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate

Posted

what are the arguments on the address bar after clicking the back button? Are the sid and action fields set?

 

I cannot get to the link you provided. I get an error here.

Posted

sorry, I had to upload the contribution package for this thread to be available. You can check it again if you wish.

 

thanks :blush:

-----------------------------------------

OSCommerce version : MS2

Contributions installed : AdminMS2, Dynamic Mopics V3, WYSIWYG HTML Area MS2, Easypopulate

Archived

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

×
×
  • Create New...