Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Page links and back?


hankfrid

Recommended Posts

Posted

Can someone tell me how you specify what action is taken on the "Continue" button for a page?

 

As an example, if I just set up new pages in the Information Box and people click on them, when they click "Continue", it takes them to the default page.

 

Yet, when you go thru checkout, the "Continue" button takes you forward.

 

What I really want to do is set up a link to a new page I created (within osc framework) on the checkout_payment page. But when they click "Continue" on the new page, it takes them to default, instead of back to the checkout_payment page.

 

Is there something I have to specify within the <a href="http://www.site.com/shop/new_page.php"><u>Click here</u></a> in order for it to know how to get back here? Or do I have to do something within the new_page.php module?

 

Just a little lost here on how to control it.

 

Thanks,

HankFrid

If I build it...they will come.

If I don't try to build it.....I will never know!

Posted

Hank,

 

Where the "continue" button takes you is controlled by one of two things....either a direct link or by a redirect on the page.

 

The direct links look like this:

       <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

 

You can change the page by changing the (FILENAME_DEFAULT) to where you want the link to point.

Posted

Birdbrain;

 

Thanks for the quick reply, but here's my problem.

 

The new_page is available thru the "information" box as well as a link I put by the Payment Method header on the checkout_payment screen. If they are going to the new page from the information box (pretty much any screen), then "continue" taking them to default is good. But, if they got there by clicking it on the checkout_payment screen, I need for the "continue" button on the new screen to RETURN them to the checkout_payment screen.

 

How do I do that?

 

The sample code you gave for the direct link looks quite simple to understand. Could you give me an explanation/example of what you mean by a "redirect on the page"??

 

Thanks,

HankFrid

If I build it...they will come.

If I don't try to build it.....I will never know!

Posted

Hank,

 

When I said redirects, I was speaking of this type of statement: (these are from checkout_payment.php)

 

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

 if (!tep_session_is_registered('customer_id')) {

   $navigation->set_snapshot();

   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 }



// 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));

 }



// if no shipping method has been selected, redirect the customer to the shipping method selection page

 if (!tep_session_is_registered('shipping')) {

   tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

 }



// avoid hack attempts during the checkout procedure by checking the internal cartID

 if (isset($cart->cartID) && tep_session_is_registered('cartID')) {

   if ($cart->cartID != $cartID) {

     tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));

   }

 }

 

You will need something similar that checks whether they are logged-in or not. If they are logged in it returns them to the page they came from if they aren't logged in it takes them to the default.

Archived

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

×
×
  • Create New...