[contribution] individual product shipping prices
#1
Posted 07 July 2003, 01:00
If there's enough interest for this, I'll go ahead and package it as a contribution and upload it.
#2
Posted 07 July 2003, 12:17
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
#3
Posted 07 July 2003, 16:22
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.
#4
Posted 07 July 2003, 19:19
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.
#5
Posted 07 July 2003, 19:21
#6
Posted 08 July 2003, 04:30
http://www.oscommerce.com/community/contributions,1333
Be nice everyone, this is my first contribution. Let me know how it works for you.
#7
Posted 08 July 2003, 10:47
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.
#8
Posted 08 July 2003, 17:03
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.
#9
Posted 08 July 2003, 21:12
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.
#10
Posted 08 July 2003, 22:56
if $qty > 1 {
instead of if $qty => 1 {
and so on and so forth.. ahem
#11
Posted 09 July 2003, 10:05
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...
#12
Posted 09 July 2003, 10:27
...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.
#13
Posted 09 July 2003, 11:11
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
#14
Posted 09 July 2003, 17:33
#15
Posted 09 July 2003, 22:59
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!
#16
Posted 19 July 2003, 17:59
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
#17
Posted 19 July 2003, 22:29
to do what you're trying to do.
#18
Posted 19 July 2003, 22:41
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 -->
#19
Posted 31 July 2003, 00:03
http://www.oscommerce.com/community/contri...ions,818/page,3 ?
Many thanks!
#20
Posted 31 July 2003, 03:50
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














