Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Forced page redirect?


cyrill666

Recommended Posts

Hi,

 

I'm busy modifying a standard install to work with a florist site I'm developing. One thing I'm trying to achieve is to force a specified category summary page to be shown after the user has added an item to their cart:

 

1) Customer picks flowers

2) Clicks "Buy Now" from category summary list.

3) Item added to cart and shown specified category summary list (of extras).

 

So far I "think" I've found the code I need to alter in application_top.php:

 

      case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

 

 

I believe it's the last tep_redirect that needs modifying.

 

I've tried to repalce it with this hardcoded redirect

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=21'));

... but it generates a 404 error.

 

Confused... any help would be appreciated at this point.

 

Kind regards,

Gary.

Link to comment
Share on other sites

Hi,

 

I'm busy modifying a standard install to work with a florist site I'm developing. One thing I'm trying to achieve is to force a specified category summary page to be shown after the user has added an item to their cart:

 

1) Customer picks flowers

2) Clicks "Buy Now" from category summary list.

3) Item added to cart and shown specified category summary list (of extras).

 

So far I "think" I've found the code I need to alter in application_top.php:

 

      case 'buy_now' :        if (isset($HTTP_GET_VARS['products_id'])) {
                               if (tep_has_product_attributes($HTTP_GET_VARS['products_id'])) {
                                 tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id']));
                               } else {
                                 $cart->add_cart($HTTP_GET_VARS['products_id'], $cart->get_quantity($HTTP_GET_VARS['products_id'])+1);
                               }
                             }
                             tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));
                             break;

I believe it's the last tep_redirect that needs modifying.

 

I've tried to repalce it with this hardcoded redirect

 

tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=21'));

 

... but it generates a 404 error.

 

Confused... any help would be appreciated at this point.

 

Kind regards,

Gary.

 

 

sure you have a FILENAME_CATEGORIES defined, sure it is not FILENAME_DEFAULT ?

Treasurer MFC

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...