Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[contribution] individual product shipping prices


Recommended Posts

  • 2 weeks later...

I have also asked this question in Order Editor support forum.

 

I am using Individual Product Shipping 4.3 and can not get the shipping price per product to show in Order Editor or Manual Order Maker. On this forum I have found the following code changes: However, I do not have that exact code. Can anyone help?

 

Recommended code change:

 

Find (around line 32) in indvship.php:

 

 

$shiptot = $cart->get_shiptotal();

 

 

Replace with:

 

 

	  $currpage = $_SERVER['PHP_SELF'];
  if ($currpage == "/admin/edit_orders.php") {
  }
	elseif ($currpage == "/admin/edit_orders_ajax.php") {
	}
	  elseif ($currpage == "/admin/edit_orders_add_product.php") {
	  }
		else {
		$shiptot = $cart->get_shiptotal();
		}

 

 

The closest code I have to that is this:

 

   function quote($method = '') {
  global $order, $cart, $shipping_modules;
  $shiptotal = $shipping_modules->get_shiptotal();
  $indvcount = $shipping_modules->get_indvcount();
if (tep_not_null($shiptotal) || tep_not_null($indvcount) || $shiptotal == '0'){
  $this->quotes = array('id' => $this->code,
						'module' => MODULE_SHIPPING_INDVSHIP_TEXT_TITLE,
						'methods' => array(array('id' => $this->code,
												 'title' => MODULE_SHIPPING_INDVSHIP_TEXT_WAY,
												 'cost' => $shiptotal)));

Link to comment
Share on other sites

My friend (a UK art dealer) wants to be able to manually enter the shipping cost of each item in the admin section when he lists it.

 

He does not want to use any automatic shipping module, as he only sells 2 or 3 high-value items in a week & they often require special treatment - it's easier to just go the carrier's office, or call them. All he needs is for the shipping price to be added to the item price at checkout. You excellent contribution looks as if it can do this.

 

My question is, can we enter the UK shipping price for a given item then modify it for other countries, eg US + 20%, rest of the world + 25%, JP + 30%?

 

This contribution could enable a lot of people who sell 'one of a kind' items to use OSC - I have almost built my friend's shop using Zen Cart, but I will switch to OS Commerce & start again, if it can do what he needs - they have no equivalent.

 

Thanks for your attention,

 

Rgds

MIke

Link to comment
Share on other sites

  • 4 weeks later...

Hi All.

 

I'm having a problem the indv shipping is being added to the total, but when i use paypal as payment option the indv shipping charge is not being passed only sub total+tax?

 

Anyone else had this or know how to fix it?

 

Thanks in advance

Steve

Edited by steve_s
Link to comment
Share on other sites

Hi All.

 

I'm having a problem the indv shipping is being added to the total, but when i use paypal as payment option the indv shipping charge is not being passed only sub total+tax?

 

Anyone else had this or know how to fix it?

 

Thanks in advance

Steve

Hi All,

 

I found the proble for any other having same problem

I found the problem, what i did was

includes/modules/payment/paypal.php

 

find

	function process_button() {
  global $order, $currencies, $currency;

changed that to

	function process_button() {
  global $order, $currencies, $currency,$shipping;

 

find

							   tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .
						   tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .

 

change it to

							   tep_draw_hidden_field('amount', number_format(($order->info['total'] ) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .
						   tep_draw_hidden_field('shipping', number_format(0 * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .

 

Hope that helps you out for any other payment mods,

Link to comment
Share on other sites

hi i have installed individual shipping v4.4 on my oscommerce 2.2rc2a but i received this message while testing at checkout_shipping.php

 

Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\mystore\includes\classes\shipping.php:1) in C:\xampp\htdocs\mystore\includes\functions\general.php on line 33

 

I read some threads that i should remove the whitespace at shipping.php I already did but still have the same issue.

 

Anyone can help me pls? help!

Link to comment
Share on other sites

  • 2 weeks later...

I need some help with code changes. I am trying to add 2 more individual shipping prices, so it works like this:

 

ship price xxx for first item

ship price two xxx for 2nd item

ship price three xxx for 3rd item

ship price four xxx for each additional item.

 

Can this be done? or is there already a contribution that does that?

Link to comment
Share on other sites

  • 2 weeks later...

I am having a problem with this contribution. Once in a while when I add a new product, it doesnt always add the individual shipping to the order, even though it is stored in the database. It doesnt happen all the time, and it doesnt happen in a certain category. Most of the time, 99% it works fine. Any ideas?

Link to comment
Share on other sites

  • 2 weeks later...

That error s often caused by characters appearing before or after the php tags. Check your files and make sure there s nothing (no spaces, no extra blank lines) before the start tag (<?php) or after the end php tag (?>). you dontl need to worry about ever tag, ust the ones at the top and bottom of files like application_top.php and checkout_shipping.php.

Link to comment
Share on other sites

  • 1 month later...

Is it possible to have multiple choice of shipping service with this module?

 

at this moment created shipping modules:

indvship.php - defult existing

indvship1.php - new with table fields products_ship_price1 & products_ship_price_two1

indvship2.php - new with table fields products_ship_price2 & products_ship_price_two2

indvship3.php - new with table fields products_ship_price3 & products_ship_price_two3

 

Modified admin/categories.php to manage edit the shipping price. But the problem is now how to display this services for shoppers?

Could you point to right direction, please?

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites

  • 1 month later...

I just installed v4.5. When I enter the price I would like to set the shipping at in the categories/products section, the info is not saved when I try to save it. So in my cart the shipping shows up as 0.00. Also, in the same place where I put the prices, there is null to the right of the text boxes.

 

Ex.

Shipping zip code (text box) null

Shipping price (text box) null

Each additional price (text box) null

 

 

Any ideas?

 

Thanks,

 

Ben

Link to comment
Share on other sites

  • 2 weeks later...

I've installed this individual item shipping contribution but when a product has been added to the cart and I click on checkout it takes me to a page not found page. Any ideas please?

 

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

 

If you have a modified cart and are having issues where you do not see a price (0.00) on the checkout shipping page after check out, I believe I have your answer.

 

Redo your admin/categories.php page. The one out of the box works but each time I added it to a modified admin/categories.php it would nomatter what price I put in the admin product ship price it would not show up.

 

I also found that you can tell if it is not working properly because in admin product the shipping and zip does not show up in the boxes when you go back into the admin product page. It should permanently capture your zip, ship1 and ship 2 prices.

 

Charles

Link to comment
Share on other sites

Hi everybody - i'm new here - helping someone build a website and we've run into a little snag

 

we installed this contribution and haven't even got to test it yet and we have errors.

 

When we logged into shop admin and went to the payment modules we received these lovely greetings...

 

Warning: include(/home/*******/public_html/shop/includes/languages/english/modules/payment/paypal_standard-backup.php)
[function.include]: failed to open stream: No such file or directory in /home/*******/public_html/shop/admin/modules.php on line 166

Warning: include() [function.include]: Failed opening
'/home/*******/public_html/shop/includes/languages/english/modules/payment/paypal_standard-backup.php' for inclusion
(include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/*******/public_html/shop/admin/modules.php on line 166

Fatal error: Cannot redeclare class paypal_standard
in /home/*******/public_html/shop/includes/modules/payment/paypal_standard.php on line 13

 

Since the first two errors dealt with the same file and line we went there first and found the line in question...

 

include(DIR_FS_CATALOG_LANGUAGES . $language . '/modules/' . $module_type . '/' . $file);

 

Unfortunately, we don't know jack about coding so this was pretty much heiroglyphics to us.

 

But, since the error was there wasnt a paypal_standard-backup.php file, we created one

 

FYI - To back up our edited files, all we did was copy the original and rename it original-backup.php

 

FYI #2 - we use paypal web standard as our only payment method.

 

We weren't really sure why this code would be looking for the backup instead of the "active" file, and since paypal_standard.php wasn't amended in the first place, all we did was make an exact duplicate and rename it ***-backup.php, and it got rid of the first two errors, go fig

 

The third error however, we don't have a clue as to how to get rid of.

 

Here is the code again...

 

Fatal error: Cannot redeclare class paypal_standard in /home/*******/public_html/shop/includes/modules/payment/paypal_standard.php on line 13

 

and here is line 13/14 of the paypal_standard.php

 

ln13:  class paypal_standard {
ln14:   var $code, $title, $description, $enabled;

 

Can someone help?

 

Thanks in advance

Link to comment
Share on other sites

^---> Issue Resolved.

 

Here's what i did.

 

I changed my shop/includes/modules/payment/paypal_standard-backup.php to a txt file.

 

Snce that fixed the 3rd error, i wanted to see if that was the problem for the first two

errors as well and deleted the straight copy i did: shop/includes/languages/english/modules/payment/paypal_standard-backup.php

 

and that worked.

 

Why did i change the "real" backup to a txt file?

 

I googled -> PHP Help Cannot redeclare class, and read up on what that error meant.

 

Basically the file paypal_standard.php was trying to declare a class that was already being declared (quite obvious when i look at it now <_<)

 

Anyway, the only file that could be declaring the exact same class would be the backup file

since it was the original. I checked, saw the class being declared and realized i needed to

get rid of the coding.

 

But since i didn't want to delete anything (since i don't know jack about coding), and its the original file just in case anything goes wrong, i thought i'd just turn it into a text file.

 

By doing that, i keep the original file, with the original coding but i also remove it from being recognized as php coding.

 

Hopefully that helps someone else who is a dense as we are... if there is such a person :-"

Link to comment
Share on other sites

  • 2 weeks later...

Just installed this and there appears to be a BIG bug which may have been caused by a previous revision. If you have an item set at an individual shipping price and another that is set to use your normal shipping module (say UPS). If the 2 items are in the cart together the customer can checkout with only paying the shipping for the individual shipping.

 

It should work as follows

 

-Item with Individual Shipping Price only in cart - Display all options (UPS, Individual shipping price etc)

-Item with No Individual shipping price, normal weight/dimensions setup (Display UPS only, do not display Individual Shipping Price)

-1 Item with Individual shipping Price set and 1 with the normal weight/dimensions (Display UPS only, do not display Individual Shipping Price)

 

I suck at code so I probably won't be able to fix this myself but hoping someone else can

Link to comment
Share on other sites

For those having issues with the price entered being multiplied make sure you look at the following admin area.

 

Under Admin -> Config -> Shipping/Packaging there is an option for multiplying the rate if the zone is not the one for your country. It is likely set to 3 and your home country probably isn't set either.

 

For those who are having the issue where the entered price isn't staying when you edit and update a product and then is showing $0.00 no matter what I found this was caused by the instructions being unclear.

 

In /catalog/admin/categories.php

 

Where it says find: (There are multiple instances of this code in this file and I believe people are placing the code in the wrong space because of this)

if (USE_CACHE == 'true') {
				tep_reset_cache_block('categories');
				tep_reset_cache_block('also_purchased');
			}

 

Add Before:

// start indvship
         $sql_shipping_array = array('products_ship_zip' => tep_db_prepare_input($_POST['products_ship_zip']),
'products_ship_methods_id' => tep_db_prepare_input($_POST['products_ship_methods_id']),
'products_ship_price' => round(tep_db_prepare_input($_POST['products_ship_price']),4),
'products_ship_price_two' => round(tep_db_prepare_input($_POST['products_ship_price_two']),4));
         $sql_shipping_id_array = array('products_id' => (int)$products_id); 
         $products_ship_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_SHIPPING . " WHERE products_id = " . (int)$products_id);
         if(tep_db_num_rows($products_ship_query) >0) {
           if (($_POST['products_ship_zip'] == '')&&($_POST['products_ship_methods_id'] == '')&&($_POST['products_ship_price'] == '')&&($_POST['products_ship_price_two'] == '')){
             tep_db_query("DELETE FROM " . TABLE_PRODUCTS_SHIPPING . " where products_id = '" . (int)$products_id . "'");
           } else {
             tep_db_perform(TABLE_PRODUCTS_SHIPPING, $sql_shipping_array, 'update', "products_id = '" . (int)$products_id . "'");
           }
         } else {
           if (($_POST['products_ship_zip'] != '')||($_POST['products_ship_methods_id'] != '')||($_POST['products_ship_price'] != '')||($_POST['products_ship_price_two'] != '')){
             $sql_ship_array = array_merge($sql_shipping_array, $sql_shipping_id_array);
             tep_db_perform(TABLE_PRODUCTS_SHIPPING, $sql_ship_array, 'insert');
           }
         }
         // end indvship

 

It Should say Find:

if (USE_CACHE == 'true') {
           tep_reset_cache_block('categories');
           tep_reset_cache_block('also_purchased');
         }

         tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
       }
       break;
     case 'copy_to_confirm':

Link to comment
Share on other sites

  • 4 weeks later...

For those having issues with the price entered being multiplied make sure you look at the following admin area.

 

Under Admin -> Config -> Shipping/Packaging there is an option for multiplying the rate if the zone is not the one for your country. It is likely set to 3 and your home country probably isn't set either.

 

For those who are having the issue where the entered price isn't staying when you edit and update a product and then is showing $0.00 no matter what I found this was caused by the instructions being unclear.

 

In /catalog/admin/categories.php

 

Where it says find: (There are multiple instances of this code in this file and I believe people are placing the code in the wrong space because of this)

if (USE_CACHE == 'true') {
				tep_reset_cache_block('categories');
				tep_reset_cache_block('also_purchased');
			}

 

Add Before:

// start indvship
         $sql_shipping_array = array('products_ship_zip' => tep_db_prepare_input($_POST['products_ship_zip']),
'products_ship_methods_id' => tep_db_prepare_input($_POST['products_ship_methods_id']),
'products_ship_price' => round(tep_db_prepare_input($_POST['products_ship_price']),4),
'products_ship_price_two' => round(tep_db_prepare_input($_POST['products_ship_price_two']),4));
         $sql_shipping_id_array = array('products_id' => (int)$products_id); 
         $products_ship_query = tep_db_query("SELECT * FROM " . TABLE_PRODUCTS_SHIPPING . " WHERE products_id = " . (int)$products_id);
         if(tep_db_num_rows($products_ship_query) >0) {
           if (($_POST['products_ship_zip'] == '')&&($_POST['products_ship_methods_id'] == '')&&($_POST['products_ship_price'] == '')&&($_POST['products_ship_price_two'] == '')){
             tep_db_query("DELETE FROM " . TABLE_PRODUCTS_SHIPPING . " where products_id = '" . (int)$products_id . "'");
           } else {
             tep_db_perform(TABLE_PRODUCTS_SHIPPING, $sql_shipping_array, 'update', "products_id = '" . (int)$products_id . "'");
           }
         } else {
           if (($_POST['products_ship_zip'] != '')||($_POST['products_ship_methods_id'] != '')||($_POST['products_ship_price'] != '')||($_POST['products_ship_price_two'] != '')){
             $sql_ship_array = array_merge($sql_shipping_array, $sql_shipping_id_array);
             tep_db_perform(TABLE_PRODUCTS_SHIPPING, $sql_ship_array, 'insert');
           }
         }
         // end indvship

 

It Should say Find:

if (USE_CACHE == 'true') {
           tep_reset_cache_block('categories');
           tep_reset_cache_block('also_purchased');
         }

         tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id));
       }
       break;
     case 'copy_to_confirm':

 

Bump. I just installed the latest version 4.5 of this and everything seems to work fine but the shipping price is not carrying through to the checkout_shipping.php page. It is fine in the database (fixed with the above change) but I get a zero in the 'Shipping Total'. I just read through about 20 pages of this thread and see many people have had the same issue. What am I missing? I cant figure out what I have wrong. Help please...

Link to comment
Share on other sites

Bump. I just installed the latest version 4.5 of this and everything seems to work fine but the shipping price is not carrying through to the checkout_shipping.php page. It is fine in the database (fixed with the above change) but I get a zero in the 'Shipping Total'. I just read through about 20 pages of this thread and see many people have had the same issue. What am I missing? I cant figure out what I have wrong. Help please...

 

Anyone? I've been through the code and am sure I am missing something simple. Need help!!! Thanks...

Link to comment
Share on other sites

Anyone? I've been through the code and am sure I am missing something simple. Need help!!! Thanks...

 

Never mind. Seems the shipping module from version 4.4 is the correct version to use as it fixed my issue when I used it instead. So, hint for any new installations. Use the 4.4 shipping module at least to prevent the error of zero's displaying in the shipping totals box...

Link to comment
Share on other sites

  • 4 weeks later...

Hi

I've just tried to put 4.5 into our shop. I've activated the module and the relevant boxes appear on the product page but they have 'null' written next to them and the amount I enter into the boxes is obviously not saved when I update it?

 

Kind regards

Mike

Link to comment
Share on other sites

  • 2 weeks later...

I'm having trouble utilizing this module with standard shipping. The problem is that it is adding (in this case table shipping) to products which have a fixed shipping rate as specified by the Individual Shipping Prices module.

 

Can anyone tell me how to fix this so that items with Fixed shipping prices are excluded from being charged for table shipping (or other shipping)?

 

Saw this entry around page 20 of the forum, but saw no reply or code unfortunately (and I'm pretty new to this stuff).

 

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

 

Anyone got a quick line of code to make that happen without much trouble?

 

Many thanks!!!

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