Jump to content
dmGremlin

[contribution] individual product shipping prices

Recommended Posts

I've just successfully tested this mod I've been working on - it's kind of like the other contribution by this name found here http://www.oscommerce.com/community/contributions,367 except with this one, I've created a separate database table to hold individual shipping prices that you can modify in your admin like any other product variable - which means you can keep your 'weight' field and use this contribution with any other shipping modules... such as 'multi vendor shipping' if you were so inclined.

 

If there's enough interest for this, I'll go ahead and package it as a contribution and upload it.


-D. M. 8)

Share this post


Link to post
Share on other sites

Maybe it could help me.

 

I use UPS shipping for all my products, but I want to sell my printed product catalog without any shipping charges.

Will I be able to do this with your code?

Will it only use the individual shipping price if I have typed something in the individuel shipping rate field, and use the usual shipping calculation if the field is empty?

 

Regards

Michael

Share this post


Link to post
Share on other sites

It sounds like for what you're doing, you would just need multi-vendor shipping. You would punch in a code in your product-edit screen to choose what kind of shipping method you would want... free or ups.

 

A mod like mine is only useful if you need individual set prices on each product. If you only need either UPS or free shipping, try multi-vendor.


-D. M. 8)

Share this post


Link to post
Share on other sites

I would like this contribution.

 

I have selling some products and the manufacturers have different rates of shipping and I have different.

 

Would I be able to set different Shipping rates along with the specified Zones.

Share this post


Link to post
Share on other sites

HI,

 

Your contribution, on shipping per price.. would this criteria work... Say i and a price for each of the products, now say if one has to buy 2 of the same products can the second product be at a lower price...

 

 

what i need it, the shipping cost of the first product is higher than the additional product, SO say

 

1st Group 1 prod. = 1.75 , any additional prod = 0.40

1st Group 2 prod. = 0.90 , any additional prod. = 0.20

 

So if i buy 2x group 1 my shipping should be 1.75+0.40 = 2.15

if i buy 1x group1 and 1xgroup 2 = 1.75+0.90 = 2.65

 

if buy 2xgroup 1 and 1 x group 2 then = 1.75+0.40+0.90 = 2.55

if buy 2xgroup 1 and 2 x group 2 then = 1.75+0.40+0.90+0.20= 2.75

 

etc.....

 

 

can that be done with your contrib.

Share this post


Link to post
Share on other sites

No, it can't - but that's an interesting idea.

 

This only sets an individual price for each product, not modified by any quantity of that product.

 

It might be simple to make a mod, but you'd need to add a second field the same way as the first and then in the shopping cart.php do a modification like...

 

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

if $qty => 1 {

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

}

 

and of course, add the second price to the above queries...

 

I.e. after

 

$products_ship_price = $product['products_ship_price'];

 

add

 

$products_ship_price_two = $product['products_ship_price_two'];

 

and then add products_ship_price_two where you added products_ship_price to the query under // products price

 

so, now that I think about it, yes - my contribution can do that... with those mods to shopping_cart.php - the price for one would be the original 'products_ship_price' and the cost for the each product more than one would be 'products_ship_price_two' - basically that would function exactly as you wanted...

 

...so of course you're going to have to add 'products_ship_price_two' to the database the same way you added "products_ship_price" - and install it to the admin/catalog.php the same way you installed the first database field.

 

Actually, now that I think about it, you could repeat this process into infinity, having as many price-by-quantity splits as you have patience for.

 

Hmm... Good idea. I hope this helps.


-D. M. 8)

Share this post


Link to post
Share on other sites

one typo and an error in my math above.

 

it would have to be more like

 

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

if $qty => 1 { 

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

}

 

otherwise it would count one too many.

 

that should do it though.


-D. M. 8)

Share this post


Link to post
Share on other sites

and that would be

 

if $qty > 1 {

instead of

if $qty => 1 {

 

and so on and so forth.. ahem


-D. M. 8)

Share this post


Link to post
Share on other sites

Hi,

thanks for the feedback i will try and let you know.. Just another question... do i need to make anychanges to the indvship.php files...

Share this post


Link to post
Share on other sites

About the Admin/catalog.php -- is not admin/caegories.php? do i have to add products_ship_price_two line to every code that has products_ship_price_two.

 

...so of course you're going to have to add 'products_ship_price_two' to the database the same way you added "products_ship_price" - and install it to the admin/catalog.php the same way you installed the first database field.

Share this post


Link to post
Share on other sites

FINALLY IT WORKS -BRILLIANT Contribution.....

thank you so much it.. it's a relief... i have it working.....

 

Though i must add that in the code

CODE:

 

if $qty > 1 {

 

YOu need to have it like this:

 

if ($qty > 1) {

 

Then it will work else you will get a error on the page..

My input to your contribute :lol: ( I'm a happy man)

Share this post


Link to post
Share on other sites

You're most welcome, Genius! :) It sounds like you've got it all figured out, but just for the sake of the forums, yes - I did mean admin/categories.php instead of admin/catalog.php


-D. M. 8)

Share this post


Link to post
Share on other sites

Thanks so much for this contribution! Your timing was impeccable as I was about to give ProdRate a go. I visited the contribs section to make sure it was compatible with the version of osC that I had installed, and low and behold there was Indvship freshly added.

 

I can't comment on ProdRate as I never did install it, but your mod is exactly what I was looking for. Great documentation for ease of install. I'm new to osC and this contrib convinced me to go with it (if I couldn't get individual shipping prices, I would have had to look for another cart solution).

 

Thanks again!

Share this post


Link to post
Share on other sites

Hi dmGremlin

 

I have installed the contribution and it works great.

 

I would need to ask you one thing .

 

When I specify an Individual Shipping for a product, it comes along with the zones rates.

 

It shows both the Individual shipping and Zones Rates on Checkout_shipping.php

 

I would like to know as if its possible to use this with Zones Rates enabled.

For ex. If I specify an individual shipping for a product, it should Just use that individual shipping cost and leave out the Zone Rates cost.

 

Is this possible

Share this post


Link to post
Share on other sites

This contrib works just fine with MS2 with minor alterations.

 

You may want to update the instructions (install.wri) to reflect the changes :)

 

Example: (original install.wri)

-> Find



tep_db_query("insert into " . TABLE_PRODUCTS . " (products_quantity, products_model, 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'] . "', '" . $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, 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'] . "')");

 

You'll notice in MS2 that all the values now use the function tep_db_input()

 

... so you're edit will look something like this:

 

            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 ('" . tep_db_input($product['products_quantity']) . "', '" . tep_db_input($product['products_model']) . "', /*changes indvship*/ '" . tep_db_input($product['products_ship_price']) . "', '" . tep_db_input($product['products_image']) . "', '" . tep_db_input($product['products_price']) . "',  now(), '" . tep_db_input($product['products_date_available']) . "', '" . tep_db_input($product['products_weight']) . "', '0', '" . (int)$product['products_tax_class_id'] . "', '" . (int)$product['manufacturers_id'] . "')");

 

And secondly:

 

-> Find



           <td class="main"><?php echo TEXT_PRODUCTS_PRICE; ?></td>

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

         </tr>



-> Add this right below the </tr> tag



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

 

You'll notice that you won't "find" the lines it tells you to find, because they are slightly different.

 

<td class="main"><?php echo TEXT_PRODUCTS_PRICE; ?></td>

 

does not exist in MS2.

 

Instead that section of code now looks like this:

          <tr bgcolor="#ebebff">

           <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>

         </tr>

         <tr bgcolor="#ebebff">

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>

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

         </tr>

         <tr bgcolor="#ebebff">

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>

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

         </tr>

 

Just add the code the instructions tell you to after all this :)

 

Do the "find" on:

<td class="main"><?php echo TEXT_PRODUCTS_PRICE

 

Your resulting code will look like this:

          <tr bgcolor="#ebebff">

           <td class="main"><?php echo TEXT_PRODUCTS_TAX_CLASS; ?></td>

           <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . ' ' . tep_draw_pull_down_menu('products_tax_class_id', $tax_class_array, $pInfo->products_tax_class_id, 'onchange="updateGross()"'); ?></td>

         </tr>

         <tr bgcolor="#ebebff">

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_NET; ?></td>

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

         </tr>

         <tr bgcolor="#ebebff">

           <td class="main"><?php echo TEXT_PRODUCTS_PRICE_GROSS; ?></td>

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

         </tr>

         

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

Share this post


Link to post
Share on other sites

Hi DM,

 

Thanks for taking the time to make this available. I would like to use this to assign a handling charge per product item rather than a shipping charge. And still assign either Weight, Zone, or Table rate based Shipping charges.

 

Can your contribution be used in this way, in combination with the other shipping modules to effectively provide Product based handling charges?

 

Thanks in advance,

Mike

Share this post


Link to post
Share on other sites
you will need to use the multi vendor shipping contribution found here: http://www.oscommerce.com/community/contributions,969

 

to do what you're trying to do.

 

Gramlin, I tried to install Multi Vendor but it does not work with MS 2.2. I emailed the author but he said that he doesnt have any plans to update it.

 

I was wondering if you could combine Multi vendor with Individual Shipping Mod.

 

Is it possible ?

Share this post


Link to post
Share on other sites

May I confirm if this module is built for MS 2.1? Thanks in advance! :)


Best regards,

 

Elmo

Share this post


Link to post
Share on other sites

May I ask what do you mean by it does not work? You mean you installed both but the features don't show up in the admin panel?

 

 

you will need to use the multi vendor shipping contribution found here: http://www.oscommerce.com/community/contributions,969

 

to do what you're trying to do.

 

Gramlin, I tried to install Multi Vendor but it does not work with MS 2.2. I emailed the author but he said that he doesnt have any plans to update it.

 

I was wondering if you could combine Multi vendor with Individual Shipping Mod.

 

Is it possible ?


Best regards,

 

Elmo

Share this post


Link to post
Share on other sites

Hi

 

Thanks for the contrib...it seems to work fine!

 

I am looking at doing the following and wondered if anyone could help?

 

I have the following three contributions installed and want to incorporate the Individual Shipping Rates field in Quick Add Products and Quick Price Updates:

 

http://www.oscommerce.com/community/contributions,1333(Individual Shipping)

 

http://www.oscommerce.com/community/contri...ns,1281/page,14 (Quick Add Products)

 

http://www.oscommerce.com/community/contri...ons,122/page,14 (Quick Price Updates 2.4)

 

 

Can anyone shed some light? Thanks in advance!!! :roll:


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

"You are what you eat"... www.ukhealthwise.com

email: info@ukhealthwise.com

Share this post


Link to post
Share on other sites

Something is not clear to me. Maybe I am a little dense :lol:

 

I have products that range from 1 lb to 200 lbs. I have a UPS account that I use to ship everything up to their maximum. (I think this is 75 lbs, but I know they have a maximum they will handle). I want to use UPS as my primary carrier. I have a module installed that collects shipping charges from UPS and displays them at checkout. I am looking for a module that will allow me to over ride the UPS option and FORCE the customer to choose the alternative shipper for any items over the maximum weight for UPS. I do not mind entering the heavy items manually as there are only about 10 items like this in my store. Can you tell me which contribution will be best suited for this purpose?

 

 

Thank You!

 

Mark

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

×