Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PWA addon Problem


deveeqo

Recommended Posts

I installed PWA 0.82 and it's working fine. Istalled PWA addon and recieve page not found proceeding to check-out. I'm running osc 2.2. Would appreciate some help. Thanks

 

 

if you mean the redirect.php add-on, lose it as it is totally unnecessary and only complicates the process..

Treasurer MFC

Link to comment
Share on other sites

Can you tell me what line of code i need  in login.php that is needed to make it work. Thanks

 

 

after successful login, you normally are directed to either your account or checkout_shipping if the cart contains items :

 

if (sizeof($navigation->snapshot) > 0) {

$origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())));

 

$navigation->clear_snapshot();

tep_redirect($origin_href);

} elseif ($cart->count_contents() > 0) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING));

} else {

tep_redirect(tep_href_link(FILENAME_ACCOUNT));

}

 

 

and that is ok.

 

so in the top of checkout shipping you need to check what to do.

 

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART), 'NONSSL'); // to the empty shopping cart

}

 

 

// if the customer is not logged on, redirect them to the login page or order info page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

if ((PWA_ON == 'true') and ($cart->count_contents() > 0)) {

tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL')); // to PWA order information

} else {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); // to login page

}

}

Treasurer MFC

Link to comment
Share on other sites

after successful login, you normally are directed to either your account or checkout_shipping if the cart contains items :

 

        if (sizeof($navigation->snapshot) > 0) {

          $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())));

 

          $navigation->clear_snapshot();

          tep_redirect($origin_href);

        } elseif ($cart->count_contents() > 0) {

            tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING));

          } else {

            tep_redirect(tep_href_link(FILENAME_ACCOUNT));

          }

and that is ok.

 

so in the top of checkout shipping you need to check what to do.

// if there is nothing in the customers cart, redirect them to the shopping cart page

  if ($cart->count_contents() < 1) {

    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART), 'NONSSL'); // to the empty shopping cart

  }

// if the customer is not logged on, redirect them to the login page or order info page

  if (!tep_session_is_registered('customer_id')) {

    $navigation->set_snapshot();

    if ((PWA_ON == 'true') and ($cart->count_contents() > 0)) {

      tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));  // to PWA order information

    } else {

        tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));  // to login page

    }

  }

 

I guess what I'm attempting to do is go from shopping_cart.php to Order_info.php and bypass login.php using PWA.

Link to comment
Share on other sites

I guess what I'm attempting to do is go from shopping_cart.php to Order_info.php and bypass login.php using PWA.

 

 

 

exactly, that is the reason why you put the redirect condition in checkout_shipping.php as all checkout buttons lead to there. As such you can leave the button code alone.

 

in checkout_shipping.php you should have this code :

 

 

// if there is nothing in the customers cart, redirect them to the shopping cart page

if ($cart->count_contents() < 1) {

tep_redirect(tep_href_link(FILENAME_SHOPPING_CART), 'NONSSL'); // to the empty shopping cart

}

// if the customer is not logged on, redirect them to the login page or order info page

if (!tep_session_is_registered('customer_id')) {

$navigation->set_snapshot();

if (PWA_ON == 'true') {

tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL')); // to PWA order information

} else {

tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL')); // to login page

}

}

 

that means:

 

1) nothing in the cart -> shopping cart

2) guest -> PWA ON -> order_info.php for PWA data entry

3) guest -> NO PWA -> login.php or if you wish create_account.php

4) customer -> continue with checkout_shipping.php

 

FILENAME_CHECKOUT should be set to "order_info.php" ofcourse.

Treasurer MFC

Link to comment
Share on other sites

exactly, that is the reason why you put the redirect condition in checkout_shipping.php as all checkout buttons lead to there. As such you can leave the button code alone.

 

in checkout_shipping.php you should have this code :

// if there is nothing in the customers cart, redirect them to the shopping cart page

  if ($cart->count_contents() < 1) {

    tep_redirect(tep_href_link(FILENAME_SHOPPING_CART), 'NONSSL'); // to the empty shopping cart

  }

// if the customer is not logged on, redirect them to the login page or order info page

  if (!tep_session_is_registered('customer_id')) {

    $navigation->set_snapshot();

    if (PWA_ON == 'true') {

      tep_redirect(tep_href_link(FILENAME_CHECKOUT, '', 'SSL'));  // to PWA order information

    } else {

        tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));  // to login page

    }

  }

 

that means:

 

1) nothing in the cart -> shopping cart

2) guest -> PWA ON ->  order_info.php for PWA data entry

3) guest -> NO PWA -> login.php or if you wish create_account.php

4) customer -> continue with checkout_shipping.php

 

FILENAME_CHECKOUT should be set to "order_info.php" ofcourse.

 

thanks for the help

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...