Jump to content
dmGremlin

[contribution] individual product shipping prices

Recommended Posts

Hi

I have been searching through all the forums amd am totally unable to find the answer to this problem.

 

I have installed the individual prices contribution, which works great, and every product has a shipping amount next to it, however a lot of my customers pick up from the store, thus needing no shipping costs.

 

I have installed the pickup rate module, but it doesnt work alongside the individual price module.

no pickup (ie free) is shown on checkout

 

I have installed all zone rates, table rates - but only individual costs show

 

 

Does any one know how to

 

1 allow customers to choose between shipping costs, or pickup

or

2 remove the shipping cost at the end to make it free.

or

3 suggest a free / local pickup module to work (and i think ive tried them all)

 

I have the gift voucher module installed, and can overide the shipping on that (subtracts the shipping at the end) but I dont want to use this long term

 

there must be a solution somehow, and im desperate for help

 

thanks

Share this post


Link to post
Share on other sites

Please - someone

 

there must be an answer, I have read through all the posts, and I know that the module should deduct the shipping, but I dont know how to do it.

 

It does state on the download of individual shipping that

 

"This means that you can use this module with any other module if you like"

 

which is why I installed it

 

this isnt the case, as every other type of shipping module is ignored.

 

All I want is to allow a free shipping button on checkout page, so that customers dont have to pay shipping costs if they pick up from the store,

 

HELLLPPP

Share this post


Link to post
Share on other sites

What does 'TEXT_PRODUCTS_ZIPCODE' do? It corresponds to 'products_ship_zip'

 

The installation instructions don't mention what it does. Why does it care about the zipcode for a flat-fee shipping item? It's flat-fee, there's no shipping fee to be calculated from the zipcode.

 

I've searched this thread, the entire forums.oscommerce.com site & I've done some google searches. None of the searches told me what this field is for. Someone posted that the answer to this question has already been posted - BUT I CAN'T FIND IT!!!

 

Thanks!

Share this post


Link to post
Share on other sites

For brevity, I'll refer to Individual Product Shipping Prices as IPSP.

 

This is a good contribution, but I was having problems getting it to work in tandem with UPS shipping. My shop has IPSP items and UPS items. If only IPSP items were in the cart everything would work. If only UPS items were in the cart then everything would work.

 

HOWEVER, if both IPSP & UPS items were in the cart then you'd have to select whether you wanted UPS shipping or IPSP shipping at checkout. If you choose IPSP shipping then the checkout total is NOT correct - it drops the UPS shipping. If you choose UPS shipping then the checkout total is correct: UPS + IPSP = Total Shipping. So, if the IPSP shipping option can be hidden in checkout_shipping.php then this problem is solved.

 

Another problem is that if IPSP items in your cart have a weight > 0 then their weight is added to the UPS shipping total. This is not correct behavior.

 

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

To remove IPSP as a selectable shipping option when both UPS & IPSP items are in the cart, do this:

in catalog/checkout_shipping.php

 

Around line 317, AFTER:

for ($i=0, $n=sizeof($quotes); $i<$n; $i++) {

 

INSERT:

if ($quotes[$i][id]=="indvship" && $n>1) continue; //don't display IPSP shipping option

 

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

To have UPS shipping calculation NOT include the weight of IPSP items, do this:

in catalog/includes/classes/shopping_cart.php

 

Around line 221, CHANGE:

$product_query = tep_db_query("select products_id, products_price........

TO:

$product_query = tep_db_query("select products.products_id, products.products_price, products.products_tax_class_id, products.products_weight, products_shipping.products_ship_price from products LEFT JOIN products_shipping on products.products_id =  products_shipping.products_id where products.products_id = '" . (int)$products_id . "'");

 

Around line 235, CHANGE:

$this->weight += ($qty * $products_weight);

$this->total += tep_add_tax($products_price, $products_tax) * $qty;

 

To this:

if (is_null($product['products_ship_price'])) { //NOT an IPSP price - so add to weight
$this->weight += ($qty * $products_weight);
}
$this->total += tep_add_tax($products_price, $products_tax) * $qty;

 

I think these changes would also allow IPSP to 'play nicely' w/ USPS shipping module too. I don't use USPS so I haven't tried.

Share this post


Link to post
Share on other sites

Hey all, I have searched and searched and I just can't get this contrib to work for me. I keep getting one errror after another. My latest is:

 

Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/chasmag/public_html/subscribe/includes/classes/order.php on line 173

 

Any ideas?

Share this post


Link to post
Share on other sites

It should be defined in includes/application_top.php like this:

 

function tep_get_configuration_key_value($lookup) {

$configuration_query_raw= tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='" . $lookup . "'");

$configuration_query= tep_db_fetch_array($configuration_query_raw);

$lookup_value= $configuration_query['configuration_value'];

return $lookup_value;

}

Share this post


Link to post
Share on other sites

Looks like you're missing your get_shiptotal definition. Check post 449. He posted his shipping.php and it includes the definition. Search for 'function get_shiptotal() {'

Share this post


Link to post
Share on other sites

I had the same problem. It's most likely you left something out of your admin/categories.php file. Do you have this line in it's entirety;

 

$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));//psm

 

 

 

Mine is around line 289. Hope this helps.

Share this post


Link to post
Share on other sites

If you have the Purchase Without Account 1.0.x contribution installed and install this contribution (v4.3a) over the top, it works but the shipping cost disappears halfway through checkout. The fix for this is luckily very simple.

 

In the instructions (step 5, editing classes/order.php), it asks you to add a block of code below this line:

 

$tax_address = tep_db_fetch_array($tax_address_query);

 

If you look up the code about 12 lines above the aformentioned line, you'll notice these two lines correlating to the PWA patch:

 

} else {

// Ingo PWA Ende

 

Add the block of code first where the instructions ask you to, and then again above the else statement. You should be golden once this is in place.

 

Thanks to gripmedia.net for hiring me to figure this out.

Edited by colinblack

Share this post


Link to post
Share on other sites

Kevin, I don't know if some of those fixes were directed at me, but I kept at the contrib, reviewing the code and making sure I pasted correctly and I finally have it at the point where there are no errors.

 

HOWEVER, it doesn't appear to work at all. I see no IPS module under shipping modules in the admin and I am experiencing the same issue as Prodigo on the previous page (top post).

 

I too would like to be able to set certain products to "free shipping."

 

Any ideas?

Share this post


Link to post
Share on other sites

Hi Everyone. This is a great contribution and I've had it running fo almost a year now. However, it never worked right with the free shipping per item mod that I had. So, I got rid of the free shipping and now use the free_shipper.php that comes with OS. Since my shipping was all messed up by months of trying to get the free shipping to work I uninstalled this contribution and reinstalled it again. which brings me to the problem.

 

Now that IPP is installed again, it is not showing anything when there is an IPP item in the checkout_shipping screen. instead I get:

 

This is currently the only shipping method available to use on this order.

 

and nothing else. As a result it is impossible to check out because there are no radio buttons checked (no radio buttons at all really) and when you click continue it kicks you back to the shipping page again and will not allow you to continue to the payment page.

 

I've gone over this code for several days not and I cannot find the source of the error. Does anyone know what might be causeing this?

Share this post


Link to post
Share on other sites

If you get a 1064 mySQL error with the copy to in admin->categories/products when trying to copy a product with individual shipping prices enabled then try this fix:

 

Find:

 

//bof shipping//hadir
$shipping_query = tep_db_query("select products_ship_methods_id, products_ship_zip from " . TABLE_PRODUCTS_SHIPPING . " where products_id = '" . (int)$products_id . "'");
while ($shipping = tep_db_fetch_array($shipping_query)) {
tep_db_query("insert into " . TABLE_PRODUCTS_SHIPPING . " (products_id, products_ship_methods_id, products_ship_zip) values ('" . (int)$dup_products_id . "', '" . tep_db_input($shipping['products_ship_methods_id']) . "', '" . tep_db_input($shipping['products_ship_zip']) . "'");
} //eof shipping//hadir

 

 

replace with:

 

 

			//bof shipping//hadir
$shipping_query = tep_db_query("select products_ship_methods_id, products_ship_zip from " . TABLE_PRODUCTS_SHIPPING . " where products_id = '" . (int)$products_id . "'");
while ($shipping = tep_db_fetch_array($shipping_query)) {
tep_db_query("insert into " . TABLE_PRODUCTS_SHIPPING . " (products_id, products_ship_methods_id, products_ship_zip) values ('" . (int)$dup_products_id . "', '" . tep_db_input($shipping['products_ship_methods_id']) . "', '" . tep_db_input($shipping['products_ship_zip']) . "')");
} //eof shipping//hadir

 

there is a parenthesis missing towards the end e.g. . "')");

 

Regards,

Simon

Share this post


Link to post
Share on other sites

Has anyone worked this out? I need help setting it up this way. Any help would be greatly appreciated. Thank you.

 

http://forums.oscommerce.com/index.php?s=&...ndpost&p=716479 and the one after that. It can be done but not on its own.

 

IDEA:

copy indvship.php how many times you want to add shipping methods and rename to indvship_METHOD.php.

like indvship_Ground.php, indvship_Next_day.php, indvship_2day.php....

in admin/categories you would have to add the code to setup and update those methods just like it is now for indvship, renaming indv to indv_METHOD. The code in catolog side would have to be changed too to allow for selecting the methods.

If(indiv_methods) show check boxs...then add that total to end.

 

Just a thought now idea how it would really work.

 

Might work on that later.

 

I will be out of the country for about a month due to family emergency. I do not know if I will have much time to get online. So if someone who has got this down (I volunteer Keith "homewetbar") maybe they would pitch in and help out.

Share this post


Link to post
Share on other sites

I think I have this set up now. I can see in admin, and it tells me my individual shipping cost at checkout, but it doubles the shipping rate at the confirm page.

 

For example. I have a product that is $6.00 with an Indiv. Ship charge of $3.00.

 

However, when I get to the checkout page, the total is $12.00.

 

any ideas?

Share this post


Link to post
Share on other sites
YAY! it works :D :D (Thanks so much for the help)

 

For some reason my checkout_shipping.php code looked 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'],
'invcost' => $shipping_modules->get_shiptotal());

 

But i changed it to the code you pasted, and worked fine.

 

(Your code)

 $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());

 

Update:

 

What the hell....they are the same with just an extra comment area...... WEIRD :D oh well it works now :D

 

My problem was that I had this same code repeated. hence double shipping.

 

Not sure how that happened,but that's the fix...

Share this post


Link to post
Share on other sites

Hi

I have just downloaded a clean version of OSC into a sub-domain of mine with its own MySQL. The OSC works fine and I have now added this contribution v.3.2 which appears to work okay except when adding individual postage to stock. It appears in the preview and if I "back" it is still showing but when I "update" and return to edit the product again it is back to 0.0000.

 

Also in the catalogue it appears as ?0.00 - checked and doubled checked - seems okay - has anyone any ideas where I should look.

 

Also in admin how can I show the 0.0000 as simply 0.00?

 

John

Share this post


Link to post
Share on other sites
Hi

I have just downloaded a clean version of OSC into a sub-domain of mine with its own MySQL. The OSC works fine and I have now added this contribution v.3.2 which appears to work okay except when adding individual postage to stock. It appears in the preview and if I "back" it is still showing but when I "update" and return to edit the product again it is back to 0.0000.

 

Also in the catalogue it appears as ?0.00 - checked and doubled checked - seems okay - has anyone any ideas where I should look.

 

Also in admin how can I show the 0.0000 as simply 0.00?

 

John

 

 

Can anyone help - checked it again today and this is now bugging me - also I need to change the ?0.0000 to simply ?0.00 - any ideas where that is generated. Please

Share this post


Link to post
Share on other sites

LATEST UPDATE

I have now got the mod to work - having re-installed it all from scratch.

 

BUT - does anyone know how I can lose the ?0.0000 in the mod so it only shows ?0.00.

 

The OSC is configured to show ?0.00 but the mod insists on adding the extra zero's. If this was confined to the admin section I would not bother so much, but I have included the mod that puts the postage automatically on to the product page and it looks untidy there.

 

I can not find where the 0.0000 is actually generated from - please help.

 

John

Share this post


Link to post
Share on other sites

Yep - I've got it all sorted by adjusting the values in MySQL (duh!)

 

Okay can any one help me with the following:

Given that I have the option to charge a different shipping rate for subsequent numbers of the same item (one costs ?1.00 - any more and the shipping is ?0.50p)

 

What I would like to do is reflect that on the product info page to read:

 

Postage for this item = ?1.00

 

Postage for additional items = ?0.50

 

 

I have already installed the mod that shows the shipping on the product info page but it does not show the postage for additional items.

 

What would I need to alter to make this happen (I am not very good with scripting although I can add mods etc..)

 

Here is the readme of the mod if it helps:

 

********************************************************************************

*********

 

This changes will show shipping price per item in products page buttom, right before "This product was added..."

 

 

 

Step 1:

 

-> Open file product_info.php in the root OSC directory.

 

Find the line (around line 72):

 

$product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

Change with:

 

$product_info_query = tep_db_query("select p.products_ship_price, select p.products_ship_price2, p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

 

 

 

 

 

-> Find the 3 lines (around line 197):

 

<tr>

 

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>

 

</tr>

 

Change with:

 

<tr>

 

<td class="ship_Price"><?php echo sprintf(TEXT_SHIP_PRICE, ($product_info['products_ship_price'])); ?></td>

 

</tr>

 

<tr>

 

<td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>

 

</tr>

 

<tr>

 

<td align="center" class="smallText"><?php echo sprintf(TEXT_DATE_ADDED, tep_date_long($product_info['products_date_added'])); ?></td>

 

</tr>

 

-> Save the file and upload.

 

Step 2:

 

->Open the file product_info.php in your language directory ( for example: /includes/languages/english/ )

 

Add the line:

 

define('TEXT_SHIP_PRICE', 'Shipping cost for this item: %s.');

 

Before the ?> sign so it would look like this:

 

define('TEXT_SHIP_PRICE', 'Shipping cost for this item: %s.');

 

?>

Share this post


Link to post
Share on other sites

IPSP is not showing anything when there is an IPP item in the checkout_shipping screen. instead I get:

 

"This is currently the only shipping method available to use on this order"

 

and nothing else. As a result it is impossible to check out because there are no radio buttons checked (no radio buttons at all really) and when you click continue it kicks you back to the shipping page again and will not allow you to continue to the payment page.

 

Any help, please??


osCommerce MS2

SPPC incl. Specials By Category, Prices By Category

Vendors, Easy Populate, UPS XML, USPS Methods

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

×