Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

changing buy now link target


Madinson

Recommended Posts

Posted

I need a little help:

 

If I get the productlisting of the index.php there is the buy now- Button at the right site of each product which is listed.

 

 

I want the "Buy now"-Button to get the linktarget to the checkout_shipping.php instead of the site shopping_cart.php.

 

I want the user to choose JUST ONE product (to add just one product to the bascet) and redirect him directly to the Checkout shipping page.

 

But I don't know which file generates the linktarget...

At the adminmenue I can activate/daectivate the buy now-buttons.

 

But I can't find the part where the link is generated........

just create...and sell..sell...sell.....

Posted

In catalog/includes/application_top.php around line 370 (the "buy now" block of code) look for this:

 

tep_redirect(tep_href_link($goto, tep_get_all_get_params($parameters)));

 

Change it to this:

 

tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, tep_get_all_get_params($parameters)));

 

Thus the entire buy now block of code should look like this:

 

      // performed by the 'buy now' button in product listings and review page
     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(FILENAME_CHECKOUT_SHIPPING, tep_get_all_get_params($parameters)));
                             break;

Posted

thx a lot chemo.

 

That works. Great!!!

 

 

thx a lot...I think I'll post it as a contribution...soon.

just create...and sell..sell...sell.....

Posted

Post it as a contribution? Why? It's only one line of code changed...actually, part of a line of code.

 

Upload it as a contribution if you want...

Posted

Yep...

 

I combined it with another contribution..called buy with one click.

 

It works great because there is the complete functionallity of OSC but less steps...

 

 

Is it as easy to change the generated link in product_info.php?

There we have a button called "button_in_cart.gif"...if I click this I get the shopping_cart.php but I want this Button to get the linktarget to the checkout_shipping.php...

just create...and sell..sell...sell.....

Posted

It is a waste of server resources to make a very simple line change into a contrib. It is not needed.

David Amherst

Posted

why don't you read the whole text?????

 

 

I never said that I just want to change one line...and make a contribution ....

 

....so u could say sorry...because it means you think I'm totally stupid!!

 

Thats what I say. Have a look at chemo...he gave me a helpful tip...u just write, why I really don't know.

just create...and sell..sell...sell.....

Posted

Is it as easy to change the generated link in product_info.php???

 

 

There we have a button called "button_in_cart.gif"...if I click this I get the shopping_cart.php but I want this Button to get the linktarget to the checkout_shipping.php...

just create...and sell..sell...sell.....

Posted

well you have allready moded your case buy now succesfully!!!

simple do the some you require with

      // customer adds a product from the products page

      case 'add_product' :

 

greetz john

Posted

before you ask ;-)

 

      // customer adds a product from the products page
     case 'add_product' :    if (isset($HTTP_POST_VARS['products_id']) && is_numeric($HTTP_POST_VARS['products_id'])) {
                               $cart->add_cart($HTTP_POST_VARS['products_id'], $cart->get_quantity(tep_get_uprid($HTTP_POST_VARS['products_id'], $HTTP_POST_VARS['id']))+1, $HTTP_POST_VARS['id']);
                             }
                             tep_redirect(tep_href_link(FILENAME_CHECKOUT_SHIPPING, tep_get_all_get_params($parameters)));
                             break;

 

greetz john

Posted

oops..

 

thx...

 

 

I think I'm really a bit stupid...... ;-)))))))))))))))))

just create...and sell..sell...sell.....

Posted
thx a lot chemo.

 

That works. Great!!!

 

 

thx a lot...I think I'll post it as a contribution...soon.

 

I for one object to someone posting someone else's fix as their own contribution.

 

Vger

Archived

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

×
×
  • Create New...