Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ship In Cart


Guest

Recommended Posts

Hello Sergey @@spidometrs,

 

It's in:

includes/modules/order_total/ot_total.php:

                              'text' => '<strong>' . $currencies->format($order->info['total'], true, $order->info['currency'], $order->info['currency_value']) . '</strong>',

But this is not specific for the order total module in the shopping cart page. If you change it, it will also apply on all other pages where order totals are shown, like checkout_confirmation.php and account_history_info.php

 

rgds

Rainer

Link to comment
Share on other sites

@@raiwa

 

I found another strange error.

I installed three shipping module.
1. Module Russian Post. For the whole of Russia.
2. Module Express delivery. For one city.
3. Pickup module with zip code. For one city.

If you logged:
- Access to all 3 modules.

If not logged in:
- in Mozilla is available - 3 modules
- in Opera is available - 1 module - Module Russian Post. For the whole of Russia.
- in Chrome - 3 modules available

If not logged in, and reload the page later, then:
 - Available 1 module - Module Russian Post. For the whole of Russia.
 - Other modules are not available, or all 3 are available in Mozilla and Chrome. In the Opera is not available.

This is a complicated error. This error should be catch attention.
But the issue is.

Edited by spidometrs

No outside url's in signatures allowed - thanks

Link to comment
Share on other sites

Hello Sergey @@spidometrs,

 

Please try the folowing:

1. Make sure you entered a Default ZIP code in the shipping estimator module

2. I just uploaded a new version for the store pickup module which solves a compatibility error together with mzmt shipping module and the shipping estimator module:

Store Pickup Shipping Module v1.7

3. If the store pickup works correct with the update and the russian shipping doesn't, compare both module and update the zone and zip check of the russian module to the way it is done in the new store pickup module.

4. If both modules still do not work, try this modification in the shipping estimator module:

in: includes/modules/content/shopping_cart/cm_sc_shipping.php:

find:

		      	// first timer
		      	$cart_country_id = STORE_COUNTRY;
		      	tep_session_register('cart_country_id');
		      	$country_info = tep_get_countries(STORE_COUNTRY,true);
		      	tep_session_register('cart_zip_code');
		      	$order->delivery = array();

and replace by:

                  // first timer
                  $cart_country_id = STORE_COUNTRY;
                $cart_zone = STORE_ZONE;
                $cart_zip_code = MODULE_CONTENT_SC_SHIPPING_DEFAULT_ZIP;
                  tep_session_register('cart_country_id');
                  tep_session_register('cart_zone');
                  tep_session_register('cart_zip_code');
                  $country_info = tep_get_countries(STORE_COUNTRY,true);
                  $order->delivery = array();

If all of this doesn't help and the problem only appears in Opera, I'm sorry, I can't spent more time to debug for a browser which only is used by 1% of all users.

 

rgds

Rainer

Link to comment
Share on other sites

@@spidometrs, please in which files? Just to know which add-ons need the update.

 

Thank you

Rainer

Link to comment
Share on other sites

@@Dan Cole and others,

 

Here the 2-3 page checkout for testing:

 

Not a full package:

 

1. uninstall "Checkout" shopping cart module

2. upload and replace the 2 included modules: cm_sc_checkout.php and cm_sc_shipping.php

3. In: checkout shipping.php at the top below

  require('includes/application_top.php');
  require('includes/classes/http_client.php');

Add:

// Ship in Cart Begin
if (defined('MODULE_CONTENT_SC_CHECKOUT_STATUS') && defined('MODULE_CONTENT_SC_CHECKOUT_LINK') && MODULE_CONTENT_SC_CHECKOUT_LINK != 'checkout_shipping.php' ) tep_redirect(tep_href_link('shopping_cart.php', '', 'SSL'));
// Ship in Cart End

4. Install again "Checkout" shopping cart module.

5. Select: Checkout button Link => checkout_payment.php

 

Please Test

attachicon.gifShip In Cart BS reloaded v3.1.zip

 

regards

Rainer

 

Rainer now that I have my shipping and coupon modules working the way I think they should I thought I'd have a look at bypassing the shipping page again when the customer has already selected the shipping method to use while on the shopping cart page.  Having had a quick look at this I'm wondering if your current version of the shipping module needs to be changed in any way to accommodate this or if you've sense incorporated those changes in the current version?   I understand the need to change and install the undated checkout module.

 

Dan

Link to comment
Share on other sites

Link to comment
Share on other sites

  • 1 month later...

Greetings! Thanks for the great work on this.

I've installed v3.5 on my 2.34 BS (on Apache) and the Order Total Estimator portion of it uses the wrong shipping amount. My main shipping module is CanadaPost and the Order Total always uses a larger shipping amount than the shipping level selected (120% - 150% larger so it's not taxes). I'm not sure where it gets the amount. It's not another shipping level offered by my shipping module. The shipping quote is correct in the Shipping Estimator portion of it, and is the quote available on checkout_shipping, and the total is correct on checkout_confirm using the correct, lower, shipping quote.

 

It looks like the totals come from the regular order_total module and are just being displayed here by the Order Total Estimator module, so why would it use the wrong shipping amount here and be fine further along in the process?

Any help in making the Order Total module use the correct shipping amount would be greatly appreciated.

 

Cheers!

Edited by cinolas
Link to comment
Share on other sites

Hello Nicolas @@cinolas,

 

Please check and make sure that the sort order of the order totals module is set higher than the shipping module. The order totals must be after the shipping module.

 

If this doesn't solve your issue, please post a screenshot with example data and post the Canada Post shipping module you are using and also the shipping quotes setup.

 

rgds

Rainer

Link to comment
Share on other sites

Hi, thanks for the quick help!

The sort order is indeed correct with the default values of 400 and 1000 for the shipping and total modules respectively.

 

Here's the Canada Post module I use: http://addons.oscommerce.com/info/7900

The shipping quote is very simple, we charge the rates we get from the Canada Post server, with no handling fees. The rest is done on the CanadaPost server. We also use two other shipping modules: store pickup (as seen in screen grab) and snail mail when the product size allows (doesn't apply here).

 

Here's the screen shot with example data. Thanks!

 

post-48186-0-56101200-1481921633_thumb.gif

Edited by cinolas
Link to comment
Share on other sites

Hello Nicolas @@cinolas,

 

One easy thing you could check is to make sure to use the latest version 1.7 of the store pickup module:

http://addons.oscommerce.com/info/164

There was an incompatibility in earlier versions with shipping estimator, it was not exact what you report, but who knows.

 

Another question, the screenshot shows data for a not logged in user. Is it the same for logged in users?

 

I had a look on the canada shipping module. It is very custom coded and has nothing to do with standard shipping modules. I also can't do any testing and research without canada post customer account which is needed to setup the module.

 

Even with the customer account, I believe that the research on the error is far beyond normal support for the shipping estimator add-on.

As a fast and easy workaround I would recomend you to disable the order totals estimation module on the shopping cart page and use only the shipping estimator module.

 

 

rgds

Rainer

Edited by raiwa
Link to comment
Share on other sites

Hi, thanks for the quick help!

 

The sort order is indeed correct with the default values of 400 and 1000 for the shipping and total modules respectively.

 

Here's the Canada Post module I use: http://addons.oscommerce.com/info/7900

 

The shipping quote is very simple, we charge the rates we get from the Canada Post server, with no handling fees. The rest is done on the CanadaPost server. We also use two other shipping modules: store pickup (as seen in screen grab) and snail mail when the product size allows (doesn't apply here).

 

Here's the screen shot with example data. Thanks!

 

Untitled-1.gif

You may want to test with the newer REST Canada Post module - their sellonline service is slated to be discontinued (not sure when).

 

I have this working with http://addons.oscommerce.com/info/8887

Link to comment
Share on other sites

  • 3 weeks later...

Hi Guys,

 

I'm really hoping someone can help me out here. I have this fantastic module working well with the Modular Shopping Cart. However, I have noticed that when an order qualifies for free shipping. There is NO shipping displayed in the Order Total box. It DOES show shipping if shipping costs are applicable. I would like to make it so that it shows either FREE SHIPPING, or at the very least, display Shipping: 0.00.

 

Can anyone help me with this?

Link to comment
Share on other sites

Hello William @@NuDreamer,
 
I just checked on my demostore and it shows the free shipping in order totals.
You can try yourself:
http://www.oscaddons.com/demostore
Just add anything over 50$ and you'll see. (There is still the warning text no shipping options in place, but that's another issue).
 
I suppose you are using the free shipping option in ot_shipping and the latest Ship In Cart BS reloaded version 3.5?

Another question, does it show in checkout confirmation?
 
If you are using another free shipping module, please let me know which one and your exact settings.
 
rgds
Rainer

Edited by raiwa
Link to comment
Share on other sites

Hi @@raiwa,

 

For Shipping I am using the Table Rate Shipping module that comes standard with OsC. I charge certain amount of shipping per dollar amount, until the basket reaches $88, at which point the Free Shipping kicks in. I am using Ship in Cart BS Reloaded 3.5. The Shipping option shows as Shipping: 0.00 on the checkout, and checkout confirmation pages, it just does not seem to show in the Order Totals box on the Shopping Cart for some reason.

 

What is the Free Shipping option you spoke of in ot_shipping?

Link to comment
Share on other sites

@@raiwa

 

Well what do you know.. I fixed it! Your comment about ot_shipping got me thinking.. so I checked it. For anyone else with this issue, here is the process. 

 

Regardless of the fact I was using Table Rate Shipping, I still needed to go into "Modules > Order Total > Shipping" in the Admin panel (I am using osCommerce 2.3.4 Bootstrap Gold). I enabled Allow Free Shipping, and set the Free Shipping Amount.

 

Thanks for the assist!

Link to comment
Share on other sites

@@raiwa @@greasemonkey thank you both. It is indeed far beyond the scope of expected support :) I'll figure out something.

 

Here's another question that's even further out of the scope of expected support... but asking never hurt and maybe it's a quick tweak. I copied the order total content module and turned it into a payment content module, so as to display the order total on the payment page. It seemed like a logical place to display the total, after selecting the shipping method, and while the user chooses how to pay for that amount.

 

The totals display as expected but for one thing: the taxes on the shipping amount are not included, while they are on the confirmation page.

 

Here's the code, essentially a direct copy of the shipping content module, do you guys see a reason why the shipping taxes are omitted?

 

Thanks!

<?php
/*
  $Id: cm_pa_order_total.php
  $Loc: catalog/includes/modules/content/payment/

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  2015 Order Totals 3.3 BS by @[member=raiwa] [email protected]

  based on: shipping estimator
  Original version: Edwin Bekaert (edwin@[member=ednique].com)

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/


  class cm_pa_order_total {
    var $code;
    var $group;
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function __construct() {
      $this->code = get_class($this);
      $this->group = basename(dirname(__FILE__));

      $this->title = MODULE_CONTENT_PA_ORDER_TOTAL_TITLE;
      $this->description = MODULE_CONTENT_PA_ORDER_TOTAL_DESCRIPTION;
      $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>';

      if ( defined('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS') ) {
        $this->sort_order = MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER;
        $this->enabled = (MODULE_CONTENT_PA_ORDER_TOTAL_STATUS == 'True');
      }
    }

    function execute() {
      global $oscTemplate, $cart, $order, $customer_default_address_id, $billto, $sendto;

      $content_width = (int)MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH;

      if (($cart->count_contents() > 0)) {     	
      	// BOF get taxes if not logged in
		    if ( !tep_session_is_registered('customer_id') ) { //guest
		    	if ( $cart->get_content_type() == 'virtual') {
		    		tep_session_register('billto');
		    		$billto = array('firstname' => null,
		    		 	 						  'lastname' => null,
		    		 	 						  'company' => null,
		    		 	 						  'street_address' => null,
		    		 	 						  'suburb' => null,
		    		 	 						  'postcode' => null,
		    		 	 						  'city' => null,
		    		 	 						  'zone_id' => STORE_ZONE,
		    		 	 						  'zone_name' => null,
		    		 	 						  'country_id' => STORE_COUNTRY,
		    		 	 						  'country_name' => null,
		    		 	 						  'country_iso_code_2' => null,
		    		 	 						  'country_iso_code_3' => null,
		    		 	 						  'address_format_id' => null,
		    		 	 						  'zone_name' => null
		    		 	 						  );
		    		 if (!class_exists('order')) {
		    		 	require('includes/classes/order.php');
		    		 }
		    		 $order = new order;
		      } elseif (defined('MODULE_CONTENT_SC_SHIPPING_STATUS') && MODULE_CONTENT_SC_SHIPPING_STATUS == 'True') {
		    		$products = $cart->get_products();
		    		for ($i=0, $n=sizeof($products); $i<$n; $i++) {
		    			$products_tax = tep_get_tax_rate($products[$i]['tax_class_id'], $order->delivery['country_id'], $order->delivery['zone_id']);
		    			$products_tax_description = tep_get_tax_description($products[$i]['tax_class_id'], $order->delivery['country_id'], $order->delivery['zone_id']);
		    			if ( DISPLAY_PRICE_WITH_TAX == 'true' ) {
		    				//Modified by Strider 42 to correct the tax calculation when a customer is not logged in
		    				$tax_val = (($products[$i]['final_price']/100)*$products_tax)*$products[$i]['quantity'];
		    			} else {
		    				$tax_val = (($products[$i]['final_price']*$products_tax)/100)*$products[$i]['quantity'];
		    			}
		    			if ( !empty($order->info['tax']) ) {
		    				$order->info['tax'] += $tax_val;
		    			} else {
		    				$order->info['tax'] = $tax_val;
		    			}
		    			if ( !empty($order->info['tax_groups']) ) {
		    				$order->info['tax_groups']["$products_tax_description"] += $tax_val;
		    			} else {
		    				$order->info['tax_groups']["$products_tax_description"] = $tax_val;
		    			}
		    			
		    			// Modified by Strider 42 to correct the order total figure when shop displays prices with tax
		    			if ( DISPLAY_PRICE_WITH_TAX == 'true' ) {
		    				$order->info['total'];
		    			} else {
		    				$order->info['total']+=$tax_val;
		    			}
		    		}
		      } else {
		      	if (!tep_session_is_registered('sendto')) {
		      		tep_session_register('sendto');
		      		$sendto = array('firstname' => null,
		    		 	 						  	'lastname' => null,
		    		 	 						  	'company' => null,
		    		 	 						  	'street_address' => null,
		    		 	 						  	'suburb' => null,
		    		 	 						  	'postcode' => null,
		    		 	 						  	'city' => null,
		    		 	 						  	'zone_id' => STORE_ZONE,
		    		 	 						  	'zone_name' => null,
		    		 	 						  	'country_id' => STORE_COUNTRY,
		    		 	 						  	'country_name' => null,
		    		 	 						  	'country_iso_code_2' => null,
		    		 	 						  	'country_iso_code_3' => null,
		    		 	 						  	'address_format_id' => null,
		    		 	 						  	'zone_name' => null
		    		 	 						  	);
		    		 	if (!class_exists('order')) {
		    		 		require('includes/classes/order.php');
		    		 	}
		    		 	$order = new order;
		    		}
		    	}
		    } else {
		    	if ( $cart->get_content_type() == 'virtual' && (!defined('MODULE_CONTENT_SC_SHIPPING_STATUS') || (defined('MODULE_CONTENT_SC_SHIPPING_STATUS') && MODULE_CONTENT_SC_SHIPPING_STATUS != 'True')) ) {
		    		tep_session_register('billto');
		    		$billto = $customer_default_address_id;
		    	}
		    	if (!class_exists('order')) {
		    		require('includes/classes/order.php');
		    	}
		    	$order = new order;
		    }
		    	
		    	// EOF get taxes if not logged in (seems like less code than in order class)
		    	require('includes/classes/order_total.php');
		    	$order_total_modules = new order_total;
		    	$order_total_modules->process();

		    	if ( MODULE_ORDER_TOTAL_INSTALLED ) {
		    		$pa_order_total .= '	<div class="panel-body">';
		    		$pa_order_total .= '		<table class="pull-right">';
		    		$pa_order_total .= 			$order_total_modules->output();
		    		$pa_order_total .= '		</table>';
		    		$pa_order_total .= ' </div>'; // end body
 		    	}

		  
      ob_start();
        include('includes/modules/content/' . $this->group . '/templates/order_total.php');
        $template = ob_get_clean();

        $oscTemplate->addContent($template, $this->group);
		  } // Use only when cart_contents > 0
    }

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS');
    }

    function install() {
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Order Total Module', 'MODULE_CONTENT_PA_ORDER_TOTAL_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.<br>Recommended to show this module last.', '6', '3', now())");
   }

    function remove() {
      tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS', 'MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH', 'MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER');
    }
  }

Link to comment
Share on other sites

In an effort to get a friendly hint I'll sum it down to where my no-knowledge of php stops. My first thought obv was to find where in there the taxes on shipping were calculated, but it doesn't seem to be part of this contribution. So I'm guessing it's pulling this mechanic from an existing file. The only file the contrib seems to rely on is the order class, which doesn't seem to handle shipping taxes either. Regardless, I couldn't adjust the tax calculation in a central file or it would also affect places where the totals are shown correctly. So my guess is that the problem is with the context of the code, makes sense since I copied the code out of its context to do that.

 

So part of the code above fails because it's out of context and so the shipping tax isn't carried over.
If my understanding is correct so far, then this contrib takes that same totals and tax mechanic from an existing file and uses it (successfully) out of context on the shopping cart page. So what's the difference in context between the shopping cart and checkout_payment? the shipping has been selected, and not taken from the input fields. Yet the actual amount for the shipping level that was selected does show up, as it does on the checkout_confirm, so it's getting that part of the shipping data. Just not the tax.

 

That's where I'm lost. Any hints as to where or how this contrib gets the shipping amount and passes it to the order class, or any hints at all really, would be greatly appreciated (from any willing soul, as the dev pointed out this FAR beyond expected support).

Edited by cinolas
Link to comment
Share on other sites

@@cinolas,

 

Without having a deeper look, I would rather use the coding of the checkout confirmation page for the order totals as it's more close to the checkout status at the checkout payment page.

Then you could also try to switch error reporting to "error_reporting(E_ALL);" in application top to see if and which variables may be undefined.

Then echo all variables by var_dump to see which fails.

 

rgds

Rainer

Link to comment
Share on other sites

@@cinolas,

 

Without having a deeper look, I would rather use the coding of the checkout confirmation page for the order totals as it's more close to the checkout status at the checkout payment page.

Then you could also try to switch error reporting to "error_reporting(E_ALL);" in application top to see if and which variables may be undefined.

Then echo all variables by var_dump to see which fails.

 

rgds

Rainer

 

@@raiwa

 

Thanks again for the tips.

 

I've changed the code in my payment content module to the call for the order total module that I found in the checkout_confirmation page and it gives exactly the same result. So I did as you suggested and looked at the variables (that tip is going to make my osC debugging so much easier!). It appears that the "tax" variable is simply set to the tax without the tax on shipping when on the checkout_payment page (the "total" variable is also calculated without it) , and by the time you get to checkout_confirmation the "tax" variable has been changed to include the tax on shipping, and the "total" adjusted accordingly. There is no missing or unset variable, or error, the tax on shipping really is supposed to go in the tax variable, it just hasn't, at that point. Some process must do that between the two pages.

 

 

I have no idea how, when, and through which process.

 

I don't want to modify a central function, that doesn't make sense. Is there any way I can, in my content module code, alter the order "tax" variable to be what it is plus: whatever the current tax rate times "shipping_cost". Then alter "total" by the same difference. THEN call the order total module? I might be able to figure that out, but I can't seem to find a defined variable for the current tax rate, other than within the product array. I'd rather not use that because I'd have to arbitrarily chose a product, and it might be tax exempt for some reason.

 

Again, feel free to tell me I'm on my own here. This has nothing to do with your contrib, other than I'm trying to do something similar. It's beyond what I can accomplish with my current level of understanding of osC php et al so any tips (from anyone) is VERY much appreciated :D

Edited by cinolas
Link to comment
Share on other sites

In trying to circumvent the problem I created a different Tax Class for the tax on shipping. If I give it a different description then the tax on shipping shows up on a different line, at least on checkout_confirm. On checkout_payment, the ot_tax order total module only reports the tax on the goods, where it is reporting both on checkout_confirm.

 

So again, this means that the tax on shipping is added after the payment page.

 

I figured another easier workaround would be to add a line after the order_total modules output, that says something like :
+ $0.58 tax on shipping
TOTAL: $184.38

 

Then there's no need to alter any core functions, or set variables ahead of time, all I need to do is calculate the tax on shipping and a new super-total and display those after the order total module output.

I tried a few naive things, mostly copying promising bits of code from other places, but it all failed miserably. My content module now looks like this (I've removed the long part about taxes when not logged in since that just doesn't apply on the payment page):

 

<?php
/*
  $Id: cm_pa_order_total.php
  $Loc: catalog/includes/modules/content/payment/

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  2015 Order Totals 3.3 BS by @[member='raiwa'] [email protected]

  based on: shipping estimator
  Original version: Edwin Bekaert (edwin@[member='ednique'].com)

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/


  class cm_pa_order_total {
    var $code;
    var $group;
    var $title;
    var $description;
    var $sort_order;
    var $enabled = false;

    function __construct() {
      $this->code = get_class($this);
      $this->group = basename(dirname(__FILE__));

      $this->title = MODULE_CONTENT_PA_ORDER_TOTAL_TITLE;
      $this->description = MODULE_CONTENT_PA_ORDER_TOTAL_DESCRIPTION;
      $this->description .= '<div class="secWarning">' . MODULE_CONTENT_BOOTSTRAP_ROW_DESCRIPTION . '</div>';

      if ( defined('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS') ) {
        $this->sort_order = MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER;
        $this->enabled = (MODULE_CONTENT_PA_ORDER_TOTAL_STATUS == 'True');
      }
    }

    function execute() {
      global $oscTemplate, $cart, $order, $customer_default_address_id, $billto, $sendto;

      $content_width = (int)MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH;

      if (($cart->count_contents() > 0)) {     	
      	
		    	require('includes/classes/order_total.php');
		    	$order_total_modules = new order_total;
		    	$order_total_modules->process();
				
			$shiptaxrate = tep_get_tax_rate('1', $customer_country_id, $customer_zone_id);
			$shiptax = ($shipping['cost'] * $shiptaxrate);

		    	if ( MODULE_ORDER_TOTAL_INSTALLED ) {
		    		$pa_order_total .= '	<div class="panel-body">';
		    		$pa_order_total .= '		<table class="pull-right">';
		    		$pa_order_total .= 			$order_total_modules->output();
				$pa_order_total .= '           <tr><td align="right" class="main">+ tax (' . $shiptaxrate . ') on shipping</td><td align="right" class="main">' . $shiptax . '</td></tr>';
		    		$pa_order_total .= '		</table>';
		    		$pa_order_total .= ' </div>'; // end body
 		    	}

		  
      ob_start();
        include('includes/modules/content/' . $this->group . '/templates/order_total.php');
        $template = ob_get_clean();

        $oscTemplate->addContent($template, $this->group);
		  } // Use only when cart_contents > 0
    }

    function isEnabled() {
      return $this->enabled;
    }

    function check() {
      return defined('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS');
    }

    function install() {
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Order Total Module', 'MODULE_CONTENT_PA_ORDER_TOTAL_STATUS', 'True', 'Do you want to add the module to your shop?', '6', '1', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Content Width', 'MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH', '12', 'What width container should the content be shown in?', '6', '2', 'tep_cfg_select_option(array(\'12\', \'11\', \'10\', \'9\', \'8\', \'7\', \'6\', \'5\', \'4\', \'3\', \'2\', \'1\'), ', now())");
      tep_db_query("insert into configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER', '1000', 'Sort order of display. Lowest is displayed first.<br>Recommended to show this module last.', '6', '3', now())");
   }

    function remove() {
      tep_db_query("delete from configuration where configuration_key in ('" . implode("', '", $this->keys()) . "')");
    }

    function keys() {
      return array('MODULE_CONTENT_PA_ORDER_TOTAL_STATUS', 'MODULE_CONTENT_PA_ORDER_TOTAL_CONTENT_WIDTH', 'MODULE_CONTENT_PA_ORDER_TOTAL_SORT_ORDER');
    }
  }

Go ahead, have a laugh :)

So tep_get_tax_rate('1', $customer_country_id, $customer_zone_id); returns 0, and so does $shipping['cost']

 

Any idea how I might be able to summon those 2 variables, that is the tax rates for the customer's country and zone, and the shipping cost, from the context of a checkout_payment content module?

 

Cheers!

Edited by cinolas
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...