I've found some troubles with the users that click on the browser back button to return to revision from the payment web. This causes repeated order number on the payment. I've added the following line to the commerce_sermepa_order_form function and solved for me.

drupal_add_http_header('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0');

Comments

facine’s picture

Status: Active » Closed (won't fix)

This is problem of commerce and there are incidents in this regard.

#1621210: Add to cart form submit + redirect + user presses back button = broken ajax on cart form

candelas’s picture

Issue summary: View changes

@marcrh I am having this problem too and I took a look to #1621210: Add to cart form submit + redirect + user presses back button = broken ajax on cart form but the bug isn't solved jet.

Did you do this?

  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Redirect to Sermepa platform'),
    '#attached' => array(
      'drupal_add_http_header' => array(
        array('Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0')
      ),
    ),
  );

Thanks

candelas’s picture

At the end I used the module https://www.drupal.org/project/context_cache and for Safari in the theme js i added on the window.ready

     if($("body").hasClass('page-cart') || $("body").hasClass('page-checkout') ){
      $("body").attr("onunload", "");
    }