Jump to content
Sign in to follow this  
Farrukh

[Contribution Update] Individual Shipping Price v 2.0 MS 2.2

Recommended Posts

Hi

 

I have just updated the Individual Product Shipping Prices v1.0 by dm.gremlin for Milestone 2.2

 

I have added all the necessary files.

 

Added Feature:

 

If the Individual Shipping Prices is enabled and the price set in the Admin => Categories => Products

 

At checkout_shipping.pho page, only Individual Shipping Module will be visible and available. And if the Individual Price is not set for a product. You will get other Shipping Modules which you might be running besides Individual Shipping Mod.

 

 

Download here:

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

Share this post


Link to post
Share on other sites

Ok here is my situation

can you see if can accomplish this or how to by the contribution(s)

 

it is a floral and gift website

http://www.secretgardenflowers.com

 

A) normal products i send by canada post i am using the canada post mod for this

 

B) all floral arrangements are sent either by local courier or by wire service

probably will just be a flat rate doesn't matter where it is shipping to

 

C) some products are too large or too heavy to ship via canada post and i will ship via an alternate carrier based on area i think i can use zone based shipping for this

 

any idea how to accomplish this?

 

for C the canada post module will automatically display that it is too heavy to ship so this is not really a concern as the customer will not be able to select it

Share this post


Link to post
Share on other sites
Give b and c items individual prices

 

will individual prices do zone based shipping?

 

i thought it was a flat rate per item

Share this post


Link to post
Share on other sites

i just installed this mod on my test site (i love it by the way).

 

i was wondering tho....

 

say i have item A at shipping 1.75

and i have item B at shipping 1.98

 

i know that's what they cost just because i know the weights.

 

i want to add a base price of 1.00 to every order (for overhead) so that when a customer orders item A and item B together, the total shipping price is 1.00+1.75+1.98.

 

please advise

Share this post


Link to post
Share on other sites

Hi, am having problems calculating tax on the shipping component. (it also happens with prodrate contrib). If I select Flat rate shipping, then the shipping cost is included for tax calculation purposes - so I assume something within the contribution is different?

 

I've got the order total set up so you have (in the following order) Sub total, Shipping, Tax & total - this works ok with flatrate shipping as I've said. When I enable Individual shipping (the shipping amount does not include tax). The tax (or VAT in my case) total does not include the shipping cost for tax calculation purposes. I need to show VAT on shipping within the Total tax amount for my customers in the UK.

 

Am working off 13th August Snapshot

 

Hope someone can point me in the right direction - it's probably me just being dumb!

 

Thanks

 

Steve

Share this post


Link to post
Share on other sites

Open indvship.php and find the following lines:

// mod indvship 

  // first mod ok  $this->shiptotal += ($products_ship_price * $qty); 

  $this->shiptotal += ($products_ship_price); 

  if ($qty > 1) { 

  $this->shiptotal += ($products_ship_price_two * ($qty-1)); 

  } 

  // end indvship

 

and Change it to

 

 

// mod indvship 

  // first mod ok  $this->shiptotal += ($products_ship_price * $qty); 

  $this->shiptotal += ($products_ship_price); 

    if ($qty > 1) { 

     if ($products_ship_price_two > 0) { 

    $this->shiptotal += ($products_ship_price_two * ($qty-1)); 

    } else { 

     $this->shiptotal += ($products_ship_price * ($qty-1)); 

    } 

} 

  // end indvship

 

This has been posted by dm.Gremlin and Chuck

 

By Ryno Chuck == This mod adds to the table in the product page so that you can not only add the individual shipping cost, but add the each additional shipping cost as well..

NOTE* - If you have a shipping rate in the indv. shipping field and its the same shipping no matter how many they buy.. You have to put the same amount in for each additional as well - else everything after one will default to 0 or whatever is in that 'each additional' field.

Share this post


Link to post
Share on other sites

Wow - thanks for the prompt response. I never cease to be amazed at the power of opensource development!

 

I tried to do the changes you suggested:

 

1) I cannot find this code in indvship.php. The closest I can find is within /includes/classes/shopping_cart.php:

 

// mod indvship

$this->shiptotal += ($products_ship_price * $qty);

// end indvship

 

2) I notice that in the contribution that you include /checkout_shipping.php & it includes a statetment at the top.

 

// BOF: Individual Shipping

if (tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS') and $shiptotal) {

tep_session_unregister('shipping');

}

// EOF: Individual Shipping

 

If I upload this file, I get the following error:

 

Fatal error: Call to undefined function: tep_get_configuration_key_value() in /xxxxxx/xxxxx/catalog/checkout_shipping.php on line 17

 

I had to use the original versions to enable correct running of the rest of the store.

 

I thought that since this code is looking for a configuration entry you may be using a new entry omitted from the sql file in the zip archive - is this the case?

 

I assume I am using the correct version of your contribution (uploaded from the url at the beginning of this thread).

 

Thanks

Share this post


Link to post
Share on other sites
06 August 2003 by:

-C. R. (chuck@rynoweb.com)



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



** Step 1 ** 

Backup your database, and all files to be modified. 





** Step 2 **

Using PHPmyadmin, or however you like to do it, run this SQL command on your database:



ALTER TABLE products ADD products_ship_price_two DECIMAL(15,4) NOT NULL;





** Step 3 **



-> Open catalog/includes/classes/shopping_cart.php



-> find this from indv.ship install

// mod indvship

$this->shiptotal += ($products_ship_price * $qty);

// end indvship



-> replace with

// mod indvship 

  // first mod ok  $this->shiptotal += ($products_ship_price * $qty); 

  $this->shiptotal += ($products_ship_price); 

    if ($qty > 1) { 

     if ($products_ship_price_two > 0) { 

    $this->shiptotal += ($products_ship_price_two * ($qty-1)); 

    } else { 

     $this->shiptotal += ($products_ship_price * ($qty-1)); 

    } 

} 

  // end indvship





-> Find



$products_ship_price = $product['products_ship_price'];



-> Add after



$products_ship_price_two = $product['products_ship_price_two'];





-> Find



// products price - indvship added products_ship_price

       $product_query = tep_db_query("select products_id, products_price, products_ship_price, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id='" . tep_get_prid($products_id) . "'");



-> Add products_ship_price_two to query (same one you previously added products_ship_price to)



// products price - indvship added products_ship_price and products_ship_price_two

       $product_query = tep_db_query("select products_id, products_price, products_ship_price, products_ship_price_two, products_tax_class_id, products_weight from " . TABLE_PRODUCTS . " where products_id='" . tep_get_prid($products_id) . "'");



-> Save and close file





** Step 4 **



-> Open admin/categories.php





-> Find



$sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),

   // mod indvship

   'products_ship_price' => tep_db_prepare_input($HTTP_POST_VARS['products_ship_price']), //indvship

   'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),

   'products_image' => (($HTTP_POST_VARS['products_image'] == 'none') ? '' : tep_db_prepare_input($HTTP_POST_VARS['products_image'])),

   'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),

   'products_date_available' => $products_date_available,

   'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),

   'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),

   'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),

   'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id']));

   

Insert a new line UNDER the line with 'products_ship_price'. Copy the line below onto the new line.



'products_ship_price_two' => tep_db_prepare_input($HTTP_POST_VARS['products_ship_price_two']), //indvship2



-> Find



$product_query = tep_db_query("select /*mod indvship*/ products_ship_price, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . tep_db_input($products_id) . "'");



-> Change it to Add products_ship_price_two



$product_query = tep_db_query("select /*mod indvship*/ products_ship_price, /*mod indvship2*/ products_ship_price_two, products_quantity, products_model, products_image, products_price, products_date_available, products_weight, products_tax_class_id, manufacturers_id from " . TABLE_PRODUCTS . " where products_id = '" . tep_db_input($products_id) . "'");



-> Find



tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, /*changes indvship*/ products_ship_price, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . $product['products_quantity'] . "', '" . $product['products_model'] . "', /*changes indvship*/ '" . $product['products_ship_price'] . "', '" . $product['products_image'] . "', '" . $product['products_price'] . "',  now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id'] . "')");



-> Change it to add products ship method (there are two changes). You do not want to just replace the line as it will interfere with any other mods you might have installed.



tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, /*changes indvship*/ products_ship_price, /*changes indvship2*/ products_ship_price_two, products_image, products_price, products_date_added, products_date_available, products_weight, products_status, products_tax_class_id, manufacturers_id) values ('" . $product['products_quantity'] . "', '" . $product['products_model'] . "', /*changes indvship*/ '" . $product['products_ship_price'] . "', /*changes indvship2*/ '" . $product['products_ship_price_two'] . "' '" . $product['products_image'] . "', '" . $product['products_price'] . "',  now(), '" . $product['products_date_available'] . "', '" . $product['products_weight'] . "', '0', '" . $product['products_tax_class_id'] . "', '" . $product['manufacturers_id'] . "')");



-> Find



$product_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['pID'] . "' and p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "'");



-> Add p.products_ship_price_two to the query like this



$product_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, /*changes indvship2*/ p.products_ship_price_two, pd.products_name, (ect... rest of query here)



-> Find



<!-- mod indvship -->

<tr>

           <td class="main"><?php echo 'Indv. Shipping Price:'; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_ship_price', $pInfo->products_ship_price); ?></td>

         </tr>

<!-- end indvship -->



-> Replace With



<!-- mod indvship -->

  <tr>

           <td class="main"><?php echo 'Indv. Shipping Price:'; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_ship_price', $pInfo->products_ship_price); ?></td>

         </tr>

  <tr>

    <td class="main"><?php echo 'Each Additional Price:'; ?></td>

    <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_input_field('products_ship_price_two', $pInfo->products_ship_price_two); ?></td>

  </tr>

<!-- end indvship -->



-> Find



$product_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, p.products_id, pd.language_id, pd.products_name, pd.products_description, pd.products_url, p.products_quantity, p.products_model, p.products_image, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p.manufacturers_id  from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = pd.products_id and p.products_id = '" . $HTTP_GET_VARS['pID'] . "'");



-> Add p.products_ship_price_two to the query like this



$product_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, /*changes indvship2*/ p.products_ship_price_two, p.products_id, pd.language_id, (ect.... rest of query goes here)



-> Find



     $products_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by pd.products_name");

   } else {

     $products_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");

   }



-> Add p.products_ship_price_two to BOTH queries using the same method as above



     $products_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, /*changes indvship2*/ p.products_ship_price_two, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status, p2c.categories_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and pd.products_name like '%" . $HTTP_GET_VARS['search'] . "%' order by pd.products_name");

   } else {

     $products_query = tep_db_query("select /*changes indvship*/ p.products_ship_price, /*changes indvship2*/ p.products_ship_price_two, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c where p.products_id = pd.products_id and pd.language_id = '" . $languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = '" . $current_category_id . "' order by pd.products_name");

   }



-> Save and close file

Share this post


Link to post
Share on other sites

What happens if I order one product with an individual shipping price and one without?

Or, what happens if I order two products with individual shipping prices?

 

Can someone please tell me "before" I install it? Maybe it wouldn't be what I need.

 

Thanks in advance

Manfred

Share this post


Link to post
Share on other sites

Hi there

Thanx for this contrib but i have a few errors.

 

On checkout_shipping.php this happens

 

Fatal error: Call to undefined function: tep_get_configuration_key_value() in C:filesweb sites filescatalogcheckout_shipping.php on line 17

 

This is the code from that area

 

  require('includes/application_top.php');

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



// BOF: Individual Shipping 

if (tep_get_configuration_key_value('MODULE_SHIPPING_INDVSHIP_STATUS') and $shiptotal) {

 tep_session_unregister('shipping');

}

// EOF: Individual Shipping 

// if the customer is not logged on, redirect them to the login page

 if (!tep_session_is_registered('customer_id')) {

   $navigation->set_snapshot();

   tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));

 

and in the admin area when i go to update the product wth new ship price this happens.

 

1054 - Unknown column 'products_ship_method' in 'field list'



update products set products_quantity = '0', products_ship_method = '', products_model = 'L7VMM2', products_price = '103.0000', products_retail_price = '149.00', products_date_available = null, products_weight = '0.00', products_status = '1', products_tax_class_id = '1', manufacturers_id = '', products_image = 'l7vmm2v11.jpg', products_last_modified = now() where products_id = '44'



[TEP STOP]

 

i have triple checked the code to make sure i did t right using a fle comparing program and they are perfect. same as yours.

 

version MS2

 

any ideas?

 

Thanx heaps.

Share this post


Link to post
Share on other sites

Farrukh :

 

im stll gettng an error in checkout_shipping.php on line 36

 

Fatal error: Call to undefined function: tep_get_configuration_key_value() in C:filesweb sites filescatalogincludesclassesshipping.php on line 36

 

code from that area

 

// if no shipping destination address was selected, use the customers own address as default

 if (!tep_session_is_registered('sendto')) {

   tep_session_register('sendto');

   $sendto = $customer_default_address_id;

 } else {

// verify the selected shipping address

   $check_address_query = tep_db_query("select count(*) as total from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int)$customer_id . "' and address_book_id = '" . (int)$sendto . "'");

   $check_address = tep_db_fetch_array($check_address_query);



   if ($check_address['total'] != '1') {

     $sendto = $customer_default_address_id;

     if (tep_session_is_registered('shipping')) tep_session_unregister('shipping');

   }

 }

 

also the admin part doesnt have errors now but its not updating the tables.

 

any ideas?

 

oohh also i am using "retail price" mod, would this be clashing with it?

Thanx heaps

Share this post


Link to post
Share on other sites
Fixed some minor bugs.

 

Now it also supports Additional Shipping Prices per product.

This adds the ability for each additional product after the first to have a lower or different shipping price. (By chuck)

 

Download it here:http://www.oscommerce.com/community/contributions,1333

 

I am using v1.0 of this contrib since I am not running Milestone 2.2. Are any of these bug fixes applicable to v1.0 of this contrib?

Share this post


Link to post
Share on other sites

Help! Having a problem with IndividualShip-v3.0.

Followed all installation, twice now and i'm gettin the same error each time at the top of the Catagories section in Admin.

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

1054 - Unknown column 'p.products_ship_price' in 'field list'

 

select p.products_ship_price, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name

 

[TEP STOP]

 

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

Maybe i'm missing something obvious but i'm quite new at this. Anyone having the same problem.

 

Russ Clarke

Share this post


Link to post
Share on other sites
Help! Having a problem with IndividualShip-v3.0.  

Followed all installation, twice now and i'm gettin the same error each time at the top of the Catagories section in Admin.  

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

1054 - Unknown column 'p.products_ship_price' in 'field list'

 

select p.products_ship_price, p.products_id, pd.products_name, p.products_quantity, p.products_image, p.products_price, p.products_date_added, p.products_last_modified, p.products_date_available, p.products_status from products p, products_description pd, products_to_categories p2c where p.products_id = pd.products_id and pd.language_id = '1' and p.products_id = p2c.products_id and p2c.categories_id = '0' order by pd.products_name  

 

[TEP STOP]

 

You did not run the SQL File

 

 

 

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

Maybe i'm missing something obvious but i'm quite new at this. Anyone having the same problem.  

 

Russ Clarke

Share this post


Link to post
Share on other sites

Farrukh :

Thank you for the fixes,

 

still wont update the tables in hte admin part but if i enter a value with phpmyadmin it will pull the values out and display them.

 

no errors in checkout_shipping but i have one question about it,

 

when i buy a product with indiv ship pricing by its self its fine , but i i buy 2 products, one wth indiv ship and one wth a flatrate, it ignores the flatrate one and only charges the indiv ship product, if i buy a product with flatrate and nothing else its also fine, is it supposed to do that?

 

Have a play at my site to see what i mean, http://net-tech.net.nz

 

Thanx heaps.

Share this post


Link to post
Share on other sites
i just installed this mod on my test site (i love it by the way).

 

i was wondering tho....

 

say i have item A at shipping 1.75

and i have item B at shipping 1.98

 

i know that's what they cost just because i know the weights.

 

i want to add a base price of 1.00 to every order (for overhead) so that when a customer orders item A and item B together, the total shipping price is 1.00+1.75+1.98.

 

please advise

 

i installed the upgrade, but its still not quite what i need in my life. any ideas on how i can acheive the above shipping? with the current upgrade, a customer must buy 2 of the same item in order to get the reduced additional shipping. i was hoping that they could buy any item , or any item that had the same ship price and get the reduced additional shipping.

Share this post


Link to post
Share on other sites

Well, if nothing else :-) I'm getting a crash course in PHP and mySQL. These contribs are definately great for teaching/learning.

 

I'm trying to install Indv Ship 3.1 and I'm getting the following error in my Admin Panel:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/tubbyta/public_html/test/admin/includes/functions/database.php on line 99

 

 

I have gone back through my files and all of the code in the readme files. Was there another contrib I was supposed to install first? I have only tried to install the Indv. Ship 3.1 - there is reference to a Multi-Vendor, but I haven't installed that yet.

 

Anyone have any ideas on what I've broken?

 

Thanks!

 

Khim~


Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup :-)

Share this post


Link to post
Share on other sites

Oh grumble!

 

Whatever I did while trying to install Indiv. Ship 3.1, broke my Header Tag install :/

 

Back to the drawing board :/

 

Khim~


Do not meddle in the affairs of Dragons, for you are crunchy and good with ketchup :-)

Share this post


Link to post
Share on other sites

Hi,

 

I have some trouble with the contribute "Individual Product Shipping Prices". The Installation was okay and now I have two groups of products to ship: One group for free and free shipping und the other with a fixed price and a defined shipping charge of 2?. All is okay, if I order every productgroup for itself.

 

Now I can't mix these groups, I can't do what my customers probably will: They will order a free product and one or more from the other group. Now if I have a free product and another one in my basket, the free one will hit the shipping charge to zero. What's that??

 

Is there anyone, who has an idea. Thanks

Guntram

Edited by gunwalt

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×