Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] individual product shipping prices


Recommended Posts

Ok, I have a big problem. I have only ONE item that I want to charge fixed shipping for. Works great. BUT, when a client orders the fixed price item, and another item, with a shipping charge, the FIXED xharge is also added to the regular shipping price. Is there a way to DISACTIVATE the individual shipping when the clients also choses other items ?.

Link to comment
Share on other sites

Where can I change the shipping charge if no cost is entered when entering a product. There is one item I do not want any shipping charge for but if leave the field blank $12.00 shipping is auto completed. I would either like to change the auto insert of $12 to no cost, free or 0.00.

 

any ideas how this can be done?

thanks

Link to comment
Share on other sites

Ok, I have a big problem. I have only ONE item that I want to charge fixed shipping for. Works great. BUT, when a client orders the fixed price item, and another item, with a shipping charge, the FIXED xharge is also added to the regular shipping price. Is there a way to DISACTIVATE the individual shipping when the clients also choses other items ?.

 

 

That is the way it is supposed to work. Fixed shipping is FIXED no matter what other items they buy. They are added the total shipping if other products have other shipping. If you don't want a fixed shipping price remove it.

 

Where can I change the shipping charge if no cost is entered when entering a product. There is one item I do not want any shipping charge for but if leave the field blank $12.00 shipping is auto completed. I would either like to change the auto insert of $12 to no cost, free or 0.00.

 

any ideas how this can be done?

thanks

 

If you do not add an Indv shipping price to a product the active shipping methods will take over whether it is UPS USPS or anything else. If you want free shipping for that product add a '0.00' to shipping that should work.

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

That is the way it is supposed to work. Fixed shipping is FIXED no matter what other items they buy. They are added the total shipping if other products have other shipping. If you don't want a fixed shipping price remove it.

 

Let me explain more.... I have small items, that I can send in an envellope. For say 50 cents. Larger items have other shipping rates. When a client purchases the small item, no problem. But when they also purchase a larger item WITH the small item, the other shipping rate has the 50 cents added to it.....

 

Is there any way to avoid then the XX.XX has been added to your purchase ?

Link to comment
Share on other sites

Is there any way to avoid then the XX.XX has been added to your purchase ?

 

Not sure what you mean other item already has 50 cents added but to remove the line

Remove that statement from shopping_cart

 

Individual Product Shipping Prices 4.3

 

This has homewetbar changes, some bug fixes and ability to add '0' shipping price.

There are changes to indvship.php.

Includes

Instructions for 4.1/4.2 and new install.

indvship.php file (goes in modules/shipping)

 

http://www.oscommerce.com/community/contributions,1333

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

Not sure what you mean other item already has 50 cents added but to remove the line

Remove that statement from shopping_cart

 

 

Let me explain more ! ;-p

 

Item 1, Fixed shipping of 50 cents.

Item 2, Fixed Shipping of ZERO

 

Clients buys item one, pays 50 cents, works great. Client buys item 2, is offered the other shipping methods. Problem is, when client purchases BOTH items 1 and 2, he is givin the other shipping methods, but also sees the message " (This item requires additional shipping of $0.50 for the first item + regular shipping costs.)

 

I would like to remove that feature, and I have tried, but it gets errors when I remove the part in shopping_cart... Ca you please be more specific ?

Link to comment
Share on other sites

Absolutely cannot get this mod to work correctly. I've been over the changes like 50 times.

 

Everything seems fine... on the product info page the correct additional shipping cost shows up.

 

But on the check_shipping.php this text shows up:

 

You have 2 product(s) in your order which require additional shipping. $0 will be ADDED to the shipping method selected.

 

Always the correct number of products, but the total to be added is always $0

 

Any ideas, this thing is driving me insane :\

Link to comment
Share on other sites

Could some offer some advise please on this I have installed the mod but when I got to the Admin and go to shipping modules I just get the below message.

 

Fatal error: Cannot redeclare class indvship in /www/includes/modules/shipping/indvship.php on line 14

 

Also when I goto the store and proceed to checkout I just get the below message

 

Parse error: parse error, unexpected '}' in /www/checkout_shipping.php on line 381

 

Sorry if this has been asked for already I have done some search's but it keeps coming back with loads of pages that dont seem related to this contr.

 

Thanks in advance

Link to comment
Share on other sites

Please post what version you are using when asking questions 3+, 4.1, 4.2, 4.3....

 

Thanks

 

Sorry, another question. I see the new version has support for the Free Shipping mod..... Can you post WHICH one please ?

No mod really just allows you to add '0' as shipping price.

 

There are instructions for freeshipper in 4.1 and 4.3 if you have it.

 

NOTE

If you use other shipping methods you may need to modify those shipping methods individually to NOT count the products with indiv shipping in their total.

HOW?

the way I was going to do it.

Write a function to detect what products have the indiv shipping. Then in each shipping modules method of getting the products, weight, price...or whatever that module uses to calc shipping exclude those products from the method.

Why didn't I add it?

I haven't started it yet. It was just a note I wrote in my notebook. and also having to support EACH shipping module is ridiculous. I can probably write a function to get product_id of each indiv shipping product and people can modify their own shipping modules.

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

Hi, Sorry if you meant me I am using 4.3 or trying to anyway. All I want to do is just offer free P&P on a certain catagory and the items are still being posted so I still want it to come of stock and have them fill in the shipping details. If there is a better way to do this could some one please offers some advice.

 

Thanks

Dave

Link to comment
Share on other sites

I'm using version 4.3 (newest version)

 

Everything seems to work until the checkout, at which point, the individual shipping cost is simply not calculated.

 

Any clues where the problem my lie? I've been through the checkout_shipping.php and class/shipping.php a million times :\

 

Absolutely cannot get this mod to work correctly. I've been over the changes like 50 times.

 

Everything seems fine... on the product info page the correct additional shipping cost shows up.

 

But on the check_shipping.php this text shows up:

 

You have 2 product(s) in your order which require additional shipping. $0 will be ADDED to the shipping method selected.

 

Always the correct number of products, but the total to be added is always $0

 

Any ideas, this thing is driving me insane :\

Edited by dave111
Link to comment
Share on other sites

I'm using version 4.3 (newest version)

 

Everything seems to work until the checkout, at which point, the individual shipping cost is simply not calculated.

 

Any clues where the problem my lie? I've been through the checkout_shipping.php and class/shipping.php a million times :\

 

make a file called print_array.php with the following in it

<?php
/* FIRETAIL-print_array
*'Beautified' By Hadir M. Elba 12 Jan 2005
* Copyright (C) 1999 Scott Parish
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/

//This is are two little functions that I made to quickly debug my arrays
//while making php scripts.  You can pass these things any variable (both
//arrays and non arrays), and it will print out everything that is in it.
//It will even print out embedded arrays, so if you have arrays in arrays
//in arrays, it will print all that out in a consice enough format that you
//will know exactly what is in that variable.
//
//You should get output with "key => val", which should look something like
//the following:
//
// admin =>
//		 user		   => 1
//		 screwball	  => 2
//		 admin		  => 4
//		 . . .
// is	=>
//		 student worker => 1
//		 hacker		 => 2
//		 nerd		   => 4
//		 admin		  => 8
// . . .
//
//call it like the following (where $testVar is a variable of you choice)
//
//  print_array($testVar);
//
//if your array contains any html code, you may want to call it instead as:
//
//  print_array($testVar,"<xmp>","</xmp>");
//
//Should be very easy to throw in your code and use...hope you find it useful
//			Scott Parish <[email protected]> 1998/02/24

// require('includes/application_top.php'); //hadir//for oscommerce arrays

if(!$GLOBALS["PRINT_ARRAY"]) {

 $GLOBALS["PRINT_ARRAY"]=true;
 function print_array($a,$btag="",$etag="") {
if(is_array($a)) {
  printf("<table cellpadding=0 cellspacing=0>");
  while(list($one,$two)=each($a)) {
	printf("\n<tr valign=baseline><td><font color='#800000'>$btag$one$etag</font></td><td>".
		   "<font color='#800000'>?$btag=>$etag</font></td>".
		   "<td align=right>?%s</td></tr>\n"
		   ,sprint_array($two,$btag,$etag));
  }
  printf("</table>");
}
else {
  printf("%s%s%s",$btag,$a,$etag);
}
 }




 function sprint_array($a,$btag="",$etag="") {
if(is_array($a)) {
// $rows = 0;
  $out=sprintf("<table cellpadding=0 cellspacing=0>");
	$bg=1;
  while(list($one,$two)=each($a)) {
//row bgcolor//hadir
 if(round($bg/2) == $bg/2) {
 $bgcolor="#F4F2F4";
 }
 else { $bgcolor="#E8E3E8"; }
$bg++;//eof row bgcolor//hadir
   $out .= sprintf("\n<tr valign=baseline bgcolor=$bgcolor><td><font color='#008000'>$btag$one$etag</font></td><td>".
					"
?$btag=>$etag</td>".
					"<td align=right><font color='#000080'>?%s</font></td></tr>\n"
					,sprint_array($two,$btag,$etag));
  }
  $out .= "</table>";
  return 'Size of Array='.sizeof($a). $out.'<hr>';
}
else {
  return sprintf("%s%s%s",$btag,$a,$etag);
}
 }
}
// print_array($order_total->process()); //hadir//for oscommerce arrays
//$cart->get_products()//$order_total_array
?>

 

upload to your catalog directory

at the bottom of application_bottom.php

add

//for testing purposes comment out when live//Hadir
if(isset($shipping_modules)){
  $indvcount = $shipping_modules->get_indvcount();
  $shiptotal = $shipping_modules->get_shiptotal();
if (($shiptotal=='0')||($shiptotal)){ echo '$shiptotal==0)||($shiptotal-'.$shiptotal.'indvcount-'.	$indvcount.'<br>'; }else {	$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
  echo 'shiptotal-'.$shiptotal.  'indvcount-'.	$indvcount.'<br>';}}
require('print_array.php'); //hadir//for oscommerce arrays
if($cart->get_products()){
echo sizeof($cart->get_products());
echo '<br />cart->get_products<br>'; //hadir//for oscommerce arrays
print_array($cart->get_products());
if($cart->get_content_type()){
echo '<br />cart->get_content_type<br />'; //hadir//for oscommerce arrays
print_array($cart->get_content_type());}
 if(strpos($REQUEST_URI, 'checkout_payment.php')){
echo '$order_total_modules->process<br>'.print_array($order_total_modules->process()).'<br>'; } //hadir//for oscommerce arrays

echo '<br />products $order->products<br>'; //hadir//for oscommerce arrays
print_array($order->products); 
echo '<br />shipping methods<br>'; //hadir//for oscommerce arrays
print_array($shipping_modules->modules);
echo '<br />quotes<br>';
print_array($quotes);
/*some arrays
$cart->get_products()  order_total->process() = $order_total_array*/
echo '<br />order->content_type<br><b>'; //hadir//for oscommerce arrays
print_array($cart->show_weight());echo '</b><br>';}
}

 

go to site add itmes to cart. go to shoppigcart/checkout and copy past the bottom of your page here. (make it readable please ) should look like this

$shiptotal==0)||($shiptotal-0indvcount-2
3
cart->get_products
0  =>  Size of Array=17id  =>  56 
name  =>  ....
model  =>  ....
image  =>  .....
price  =>  $.....
quantity  =>  1 
weight  =>  0.00 
final_price  =>  0 
attributes_price  =>  0 
tax_class_id  =>   
products_ship_methods_id  =>  0 
products_ship_price  =>  0 
products_ship_price_two  =>  0 
products_ship_zip  =>   
attributes  =>   

--------------------------------------------------------------------------------

1  =>  Size of Array=17id  =>  12 
name  =>  .....
model  =>  .....
image  =>  dvd/die_hard_3.gif 
price  =>  $19.99
quantity  =>  1 
weight  =>  7.00 
final_price  =>  0 
attributes_price  =>  0 
tax_class_id  =>   
products_ship_methods_id  =>   
products_ship_price  =>   
products_ship_price_two  =>   
products_ship_zip  =>   
attributes  =>   

--------------------------------------------------------------------------------

2  =>  Size of Array=17id  =>  52 
name  =>  .....
model  =>  .....
image  =>   
price  =>  $4.97
quantity  =>  1 
weight  =>  0.00 
final_price  =>  0 
attributes_price  =>  0 
tax_class_id  =>   
products_ship_methods_id  =>  0 
products_ship_price  =>  0 
products_ship_price_two  =>  1 
products_ship_zip  =>   
attributes  =>   

--------------------------------------------------------------------------------


cart->get_content_type
physical
products $order->products
0  =>  Size of Array=12qty  =>  1 
name  =>  .....
model  =>  .....
tax  =>  0 
tax_description  =>  Unknown tax rate 
price  =>  $27.50
attributes_price  =>  0 
final_price  =>  0 
weight  =>  0.00 
id  =>  56 

--------------------------------------------------------------------------------

1  =>  Size of Array=12qty  =>  1 
name  =>  Die Hard With A Vengeance 
model  =>  DVD-DHWV 
tax  =>  0 
tax_description  =>  Unknown tax rate 
price  =>  $19.99
attributes_price  =>  0 
final_price  =>  0 
weight  =>  7.00 
id  =>  12 

--------------------------------------------------------------------------------

2  =>  Size of Array=12qty  =>  1 
name  => .....
model  =>  .....
tax  =>  0 
tax_description  =>  Unknown tax rate 
price  =>  $4.97
attributes_price  =>  0 
final_price  =>  0 
weight  =>  0.00 
id  =>  52 

--------------------------------------------------------------------------------


shipping methods
0  =>  usps.php 
1  =>  table.php 
2  =>  ups.php 
3  =>  mzmt.php 
4  =>  freeshipper.php 
5  =>  indvship.php 

quotes
0  =>  Size of Array=3id  =>  table 
module  =>  Table Rate 
methods  =>  Size of Array=10  =>  Size of Array=3id  =>  table 
title  =>  Best Way 
cost  =>  5.5 

--------------------------------------------------------------------------------


1  =>  Size of Array=4id  =>  mzmt 
module  =>  MZMT3 ( lbs) 
methods  =>  Size of Array=10  =>  Size of Array=3id  =>  table1 
title  =>  3 
cost  =>  13.635 

--------------------------------------------------------------------------------


icon  =>   

--------------------------------------------------------------------------------

2  =>  Size of Array=3id  =>  indvship 
module  =>  Individual Shipping - Zone 1 
methods  =>  Size of Array=10  =>  Size of Array=3id  =>  indvship 
title  =>  Shipping Rate 
cost  =>  0 

--------------------------------------------------------------------------------


order->content_type
7

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

Thanks Here is the print out i get:

 

Vehicle Power Adapter Original is a product not using individual price.

And

HS801 Bluetooth Headset is set to use an $8 individual price, and $5 for each additional.

(i added in the ----------s to make it easy to read)

 

$shiptotal==0)||($shiptotal-0indvcount-1
2

cart->get_products
0	=>	Size of Array=14
id	=>	54
name	=>	Vehicle Power Adapter Original
model	=>	SYN0780A
image	=>	v60 car charger.jpg
price	=>	14.9500
quantity	=>	1
weight	=>	0.11
final_price	=>	14.95
tax_class_id	=>	0
products_ship_methods_id	=>	
products_ship_price	=>	
products_ship_price_two	=>	
products_ship_zip	=>	
attributes	=>	

-----------------------------------------------------------

1	=>	Size of Array=14
id	=>	50
name	=>	HS801 Bluetooth Headset
model	=>	SJ0041A / CH
image	=>	hs801 headset.jpg
price	=>	69.9900
quantity	=>	1
weight	=>	1.00
final_price	=>	69.99
tax_class_id	=>	0
products_ship_methods_id	=>	0
products_ship_price	=>	8
products_ship_price_two	=>	5
products_ship_zip	=>	1
attributes	=>	

=======================================

cart->get_content_type
physical
products $order->products

0	=>	Size of Array=9
qty	=>	1
name	=>	Vehicle Power Adapter Original
model	=>	SYN0780A
tax	=>	0
tax_description	=>	Unknown tax rate
price	=>	14.9500
final_price	=>	14.95
weight	=>	0.11
id	=>	54

---------------------------------------------------------------------

1	=>	Size of Array=9
qty	=>	1
name	=>	HS801 Bluetooth Headset
model	=>	SJ0041A / CH
tax	=>	0
tax_description	=>	Unknown tax rate
price	=>	69.9900
final_price	=>	69.99
weight	=>	1.00
id	=>	50

================================================

shipping methods
0	=>	ups.php
1	=>	flat.php
2	=>	indvship.php

================================================


quotes

0	=>	Size of Array=4
id	=>	ups
module	=>	United Parcel Service (1 x 2.11lbs)
methods	=>	Size of Array=5
0	=>	Size of Array=3
id	=>	1DA
title	=>	Next Day Air
cost	=>	43.13
1	=>	Size of Array=3
id	=>	1DP
title	=>	Next Day Air Saver
cost	=>	40.03
2	=>	Size of Array=3
id	=>	2DA
title	=>	2nd Day Air
cost	=>	20.79
3	=>	Size of Array=3
id	=>	3DS
title	=>	3 Day Select
cost	=>	15.17
4	=>	Size of Array=3
id	=>	GND
title	=>	Ground
cost	=>	10.35
icon	=>	United Parcel Service
1	=>	Size of Array=3
id	=>	flat
module	=>	Flat Rate
methods	=>	Size of Array=1
0	=>	Size of Array=3
id	=>	flat
title	=>	Best Way
cost	=>	5.00
2	=>	Size of Array=3

id	=>	indvship
module	=>	Individual Shipping
methods	=>	Size of Array=1
0	=>	Size of Array=3
id	=>	indvship
title	=>	Flat Shipping Rate
cost	=>	0

order->content_type
1.11

Edited by dave111
Link to comment
Share on other sites

Hmm but isnt $shiptotal ==0 in the demo printout that you pasted?

 

I think this is where the $shiptotal comes from includes/classes/shipping.php

 

// class constructor
function shipping($module = '') {
  global $language, $PHP_SELF, $cart;
// BOF: Individual Shipping Prices//phpmom.com
$products = $cart->get_products();
$shiptotal = $this->get_shiptotal();
$indvcount = $this->get_indvcount();
// EOF: Individual Shipping Prices

  if (defined('MODULE_SHIPPING_INSTALLED') && tep_not_null(MODULE_SHIPPING_INSTALLED)) {
	$this->modules = explode(';', MODULE_SHIPPING_INSTALLED);

 

Does that look correct? Or should i be looking at a different file?

Link to comment
Share on other sites

Almost there, i now have go it to show up correctly in the checkout_shipping.php

 

	You have 1 product(s) in your order which require additional shipping. $8 will be ADDED to the shipping method selected.

 

Now the only problem is that is $8 does not actually add to the shipping, when you get the checkout_confirmation is shows just whatever price you picked in the shipping options.

 

To get this far i had to change this in classes/shipping.php:

//BOF Indv shipping modifications//Hadir@phpmom
function get_shiptotal() {
global $cart, $order;
$this->shiptotal = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// mod indvship//modified hadir
if (tep_not_null($products[$i]['products_ship_price'])) {
$products_ship_price = $products[$i]['products_ship_price'];
$products_ship_price_two = $products[$i]['products_ship_price_two'];
$products_ship_zip = $products[$i]['products_ship_zip'];
$qty = $products[$i]['quantity'];
if(tep_not_null($products_ship_price) ||tep_not_null($products_ship_price_two)){
$this->shiptotal += ($products_ship_price);
if ($qty > 1) {
if (tep_not_null($products_ship_price_two)) {
$this->shiptotal += ($products_ship_price_two * ($qty-1));
} else {
$this->shiptotal += ($products_ship_price * ($qty-1));
}
}
if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {
$this->shiptotal *= INDIVIDUAL_SHIP_INCREASE;
} }
}
}// CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN
//if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {
//$this->shiptotal = ($this->shiptotal) * INDIVIDUAL_SHIP_INCREASE;
//}
return $this->shiptotal;
}

 

To this:

 

//BOF Indv shipping modifications//Hadir@phpmom
function get_shiptotal() {
global $cart, $order;
$this->shiptotal = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
// mod indvship//modified hadir
if (tep_not_null($products[$i]['products_ship_price'])) {
$products_ship_price = $products[$i]['products_ship_price'];
$products_ship_price_two = $products[$i]['products_ship_price_two'];
$products_ship_zip = $products[$i]['products_ship_zip'];
$qty = $products[$i]['quantity'];
if(tep_not_null($products_ship_price) ||tep_not_null($products_ship_price_two)){
$this->shiptotal += ($products_ship_price);
if ($qty > 1) {
if (tep_not_null($products_ship_price_two)) {
$this->shiptotal += ($products_ship_price_two * ($qty-1));
} else {
$this->shiptotal += ($products_ship_price * ($qty-1));
}
}
//if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {			<-------COMMENTED OUT THESE LINES
//$this->shiptotal *= INDIVIDUAL_SHIP_INCREASE;
//}
}
}
}// CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN
//if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {
//$this->shiptotal = ($this->shiptotal) * INDIVIDUAL_SHIP_INCREASE;
//}
return $this->shiptotal;
}

 

Update again:

 

It now works fine if there are only individually priced products in the cart.

 

But if there are some unindividually priced products in the cart, then it says that it is going to add the $$ to whichever is selected, but it doesnt actually add it in.

Edited by dave111
Link to comment
Share on other sites

Did you add INDIVIDUAL_SHIP_HOME_COUNTRY and INDIVIDUAL_SHIP_INCREASE to your database configuration table and did you update it in admin.

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

I have them setup to:

Indiv Ship Home Country: 223

Indiv Ship Outside Home Increase: 3

(Default Values)

 

Its weird, that its just not getting added in. :\

 

(Thanks for all the help)

 

Ok think i just might have found what i've missed:

 

In the instructions 7-9 just say this:

7- catalog/checkout_confirmation.php

8- catalog/checkout_process.php

9- catalog/checkout_paypalipn.php

if you get an object error You will have to move

require(DIR_WS_CLASSES . 'shipping.php');

$shipping_modules = new shipping($shipping);

above

require(DIR_WS_CLASSES . 'order.php');

$order = new order;

 

Do you have to edit these files, if so what do i need to do to them?

Link to comment
Share on other sites

Why didn't I add it?

I haven't started it yet. It was just a note I wrote in my notebook. and also having to support EACH shipping module is ridiculous. I can probably write a function to get product_id of each indiv shipping product and people can modify their own shipping modules.

 

 

No prob, I can do that... Any help would be appreciated though.....

Link to comment
Share on other sites

ok first 4.3 bug fix

4.2 had it right..I don't remember why I moved it but I WAS WRONG

move // CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN....... back where it was in 4.2

function get_shiptotal in classes/shipping should look like this

 

	function get_shiptotal() {
  global $cart, $order;
$this->shiptotal = '';
$products = $cart->get_products();
for ($i=0, $n=sizeof($products); $i<$n; $i++) {
	// mod indvship//modified hadir
	if (tep_not_null($products[$i]['products_ship_price'])) {
$products_ship_price = $products[$i]['products_ship_price'];//}
$products_ship_price_two = $products[$i]['products_ship_price_two'];
$products_ship_zip = $products[$i]['products_ship_zip'];
$qty = $products[$i]['quantity'];
if(tep_not_null($products_ship_price) ||tep_not_null($products_ship_price_two)){
  $this->shiptotal += ($products_ship_price);
 if ($qty > 1) {
  if (tep_not_null($products_ship_price_two)) {
 $this->shiptotal += ($products_ship_price_two * ($qty-1));
 } else {
  $this->shiptotal += ($products_ship_price * ($qty-1));
 }
} /////////////NOT HERE <<------------
}
}
 }// CHECK TO SEE IF SHIPPING TO HOME COUNTRY, IF NOT INCREASE SHIPPING COSTS BY AMOUNT SET IN ADMIN  /////////////move back here <<------------
if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {
if(INDIVIDUAL_SHIP_INCREASE > '0' || $this->shiptotal > '0') //NEW
$this->shiptotal *= INDIVIDUAL_SHIP_INCREASE;
else $this->shiptotal += INDIVIDUAL_SHIP_INCREASE; //NEW
}
return $this->shiptotal;
}

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

can change above to suit needs

I have

if (($order->delivery['country']['id']) != INDIVIDUAL_SHIP_HOME_COUNTRY) {

if(INDIVIDUAL_SHIP_INCREASE > '0' && $this->shiptotal > '0')

$this->shiptotal *= INDIVIDUAL_SHIP_INCREASE;

else $this->shiptotal += INDIVIDUAL_SHIP_INCREASE* $this->get_indvcount();

}

 

so if shiptotal is '0' it multiplies the indiv count by the INDIVIDUAL_SHIP_INCREASE.

The one I wrote above just add INDIVIDUAL_SHIP_INCREASE to the '0' shiptotal

Edited by crashwave

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

It is still not adding the additional shipping :'(

 

I add 2 items to cart.

1 item has $8 individual shipping

1 item has no individual shipping

 

I get to Check_shipping and see:

UPS Option (List of prices)

Flat Rate Option ($5)

Below these is says:

You have 1 product(s) in your order which require additional shipping. $8 will be ADDED to the shipping method selected.

 

Ok, looks fine, so choose a shipping option and continue.

 

Heres the problem: Whatever shipping option was select is the shipping cost shown on the confirmation page. The $8 just doesnt get added.

 

Which part of the code (in which file) actually adds the Individual Price to the Regular shipping option?

 

Because this addition doesnt seems to be my only problem :'(

Link to comment
Share on other sites

Try this

I forgot to add a step in new install

4.3 fix #2

in checkout_shipping

add

'invcost' => $shipping_modules->get_shiptotal()

under

'cost' => $quote[0]['methods'][0]['cost']

like this

			  $shipping = array('id' => $shipping,
							'title' => (($free_shipping == true) ?  $quote[0]['methods'][0]['title'] : $quote[0]['module'] . ' (' . $quote[0]['methods'][0]['title'] . ')'),
							'cost' => $quote[0]['methods'][0]['cost'],
							/////////INDV SHIP/////////
							'invcost' => $shipping_modules->get_shiptotal());

 

still checking other things I might have forgot to add to instr. Tell me if that fixes your problem.

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

Link to comment
Share on other sites

Ok I went through everything and except for those two fixes everything is in instructions. The last post adding 'invcost' => $shipping_modules->get_shiptotal() is actually what caused the shipping to not be included in confirmation page. So it should all work now. Will post fix in contrib page.

 

Thanks David for pointing this out.

q_|_|| _|9~~J >-o>-o q_|_|| )| q_|| )

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...