Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modify the shipping-procedure


transmechanicus

Recommended Posts

A friend of mine asked me to modify the shipping-procedure. The costs of shipping now depends on country and ordervalue. Well to calculate the shipping-cost is pretty easy but I don't know the oscommerce very well so may be you can help me with several questions:

 

1. In which file can I find the os-shipping-calculations?

2. Which variables has to be returned to the main script?

3. Is there an global variable which tells me the total order value?

4. Which variable includes the type of shipping?

 

I know, a lot of stupid questions but it would spare me a lot of time, if you could help me with this!

Link to comment
Share on other sites

A friend of mine asked me to modify the shipping-procedure. The costs of shipping now depends on country and ordervalue. Well to calculate the shipping-cost is pretty easy but I don't know the oscommerce very well so may be you can help me with several questions:

 

1. In which file can I find the os-shipping-calculations?

2. Which variables has to be returned to the main script?

3. Is there an global variable which tells me the total order value?

4. Which variable includes the type of shipping?

 

I know, a lot of stupid questions but it would spare me a lot of time, if you could help me with this!

 

1. calculation is done is the modules/shipping files you have enabled ... could be table.php, zones.php ...

2. global variable shipping

3. $cart->show_total()

4. // load all enabled shipping modules

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping;

the actual variable is "shipping"

if (!tep_session_is_registered('shipping')) tep_session_register('shipping');

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

At first thank you for your answer. Just a few more questions, so I understand it correctly:

 

I can preset the content of the enabled shipping file (zone, table etc.) completely, if the script set the correct shipping-cost to the global variable $shipping?

 

You said the variable $shipping contains the type of shipping (prepayment and so on, question 4). How can this be, if I return "$shipping" transmit the cost of shipping? Is there none other variable like "payment" to request if it is an prepayment or cod-order?

Link to comment
Share on other sites

At first thank you for your answer. Just a few more questions, so I understand it correctly:

 

I can preset the content of the enabled shipping file (zone, table etc.) completely, if the script set the correct shipping-cost to the global variable $shipping?

 

You said the variable $shipping contains the type of shipping (prepayment and so on, question 4). How can this be, if I return "$shipping" transmit the cost of shipping? Is there none other variable like "payment" to request if it is an prepayment or cod-order?

 

do not confuse shipping and payment. That is currently 2 pages and 2 global values that have to be filled, otherwise you'd be redirected over and over in the same loop.

 

Let me show you an example of prefilling the payment value, as this client of mine only offered one payment module anyway and no choice. We filled it at the top of the file checkout_payment.php, and redirected to checkout confirmation.

 

if (!tep_session_is_registered('payment')) tep_session_register('payment');
//mod by Monika so we are not directed to shipping and payment now
$payment = 'protx_form';
tep_redirect(tep_href_link(FILENAME_CHECKOUT_CONFIRMATION, '', 'SSL'));
// end mod

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

  • 2 months later...

Ok after a long time without any internet-connection I hope you'll help me with a last problem.

 

The calculation of shipping and confirmation works fine BUT: I integrated this directly in the checkout_confirmation.php - File. All I have to do now is to echo this variable at the right place. To be honest I have completely no idea where exactly I have to place this order or which variable has to be preset by the new calculated value...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...