Jump to content

Recommended Posts

Hi,

 

I would like to know if anyone has made a Item Specific Shipping Module as I am wanting to use a shipping module linked to one item that I offer to my customers.

 

E.G. Item + Specific Shipping Module = Checkout.

 

As I want to only use this option on this item I need it to be item specific so that it isn't available to use with any other items in the store.

 

If anyone can help with this matter your help will be greatly appreciated.

Share this post


Link to post
Share on other sites

I am currently looking at the Free Shipping with Zero Weight module but don't understand where to put the information located in the INSTALL_README.txt.

 

As I have a modified checkout_shipping.php file how do I go about merging the new file with the one already installed?

 

Have included a link to the module I am looking at below:

 

http://addons.oscommerce.com/info/3867

 

Appreciate any help offered. As I am new to PHP I need very simple instructions please.

Share this post


Link to post
Share on other sites

you have to amend or revise or update the files it tells you to in the read me and download

 

1. is catalog/checkout shipping.php

2. is catalog/includes/classes/shopping cart.php

 

--you may not have "catalog," depends on how you uploaded oSc

 

Do you know where to find 1, 2 on your host's server or control panel, or how to use something like FireFTP? If so, **make the changes to those files in the add on download (or just upload the entire file in the download as is) and save them or FTP to the server (you might want to keep back ups of the original php files before the changes in case something goes wrong).

 

If I were you I'd get notepad++ (free) and compare your existing php file (1, 2 above) before the changes to the ones in the add on download using the notepad++ plugin-compare feature. The reason being that if you made any other changes to 1, 2 you don't want to lose them with the new changes you will make from the downloded add on files (follow me?)

 

If you never made changes then no need to bother with comparing...I always do it because I have modified my store a great deal

 

**basically all you have to do

Edited by ErikMM

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

I am trying to compare the two files but don't know what is important to keep in the original and what to replace in the new file.

 

Is there any chance @@ErikMM you can take a look at them and see what has to be replaced please?

 

I don't want to screw up my store as it is up and running and don't want to have to put the store in "WORKING ON STORE" mode. e.g. hide it from our customers.

 

If you can look over them and change what needs to be changed without screwing up the files I would be very grateful.

 

Please let me know if you are able to do this and inbox me your details for me to send the documents to you.

 

Regards,

 

Craig.

Share this post


Link to post
Share on other sites

I forgot to mention that I need to have global free shipping on this item. If anyone can help with this matter I will be very grateful as I am not able to work it out myself.

Share this post


Link to post
Share on other sites

I am trying to compare the two files but don't know what is important to keep in the original and what to replace in the new file.

 

Is there any chance @@ErikMM you can take a look at them and see what has to be replaced please?

 

I don't want to screw up my store as it is up and running and don't want to have to put the store in "WORKING ON STORE" mode. e.g. hide it from our customers.

 

If you can look over them and change what needs to be changed without screwing up the files I would be very grateful.

 

Please let me know if you are able to do this and inbox me your details for me to send the documents to you.

 

Regards,

 

Craig.

have you ever made changes to those files?

 

if not then just replace them with the downloaded files

 

there is a way to create a mirror of your site somehow so screw-ups will be seen and not affect the store, but I can't tell you how

 

as far as doing it for you, I'd rather not...


Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

@@ErikMM I have modified those files, that is the reason I am not sure I would be able to change them myself.

 

As for creating a mirror site I would like any information that anyone can help with this so in the future I can work on the mirrored site when making changes so as to not screw up my active site.

 

Is there a section in the forums where I can ask if someone can help me with modifying these files or get them to do it for me?

 

Also is there a section or thread here that explains how to create a mirrored site that you know of?

 

Thank you for your support and being very patient with me so far.

Share this post


Link to post
Share on other sites

1. http://www.clubosc.com/mirror-site-oscommerce.html

2. http://forums.oscommerce.com/topic/199681-mirror-site/

 

also, I think you can compare 3 files with notepad++ (not sure)-- a clean 2.3.3 file, your exsiting working modified files, and a modified of the existing per the changes...you should be able to figure out from there-- good luck

Edited by ErikMM

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

1. http://www.clubosc.com/mirror-site-oscommerce.html

2. http://forums.oscommerce.com/topic/199681-mirror-site/

 

also, I think you can compare 3 files with notepad++ (not sure)-- a clean 2.3.3 file, your exsiting working modified files, and a modified of the existing per the changes...you should be able to figure out from there-- good luck

word of caution here, you may want another database as db changes could affect the live site, so perhaps 1. a subdomain on your host, 2. a mirror database copied from the live, 3. all live folders/files to the mirror

 

I'm guessing this is better than trying 'offline' as there could be differences between your machine and the "real" server.

Edited by ErikMM

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

@@ErikMM Thanks for all that, as I use a iMAC is it going to be an issue to download the site onto my HD to run a mirrored site on this?

 

I do have a Windows machine but it is very slow and would rather not use it to work through the sites issues.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Is it possible to edit the below shipping module to put a specific item as permanently selected, allowing only that item to only be allowed on the free shipping option? If I can find the specific item I am wanting to use for this option I will post later so you can see which item I am talking about.

 

Or even put an option to add specific items in the admin section of this Module so you can go though the items you have for sale and select a specific item to use for this module. As the item will be shipped worldwide I can't use a tax class or shipping zone.

 

Please find below the module I would like to edit.

 

Per Item Shipping Module

 

 

 

<?php

/*

$Id$

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2008 osCommerce

 

Released under the GNU General Public License

*/

 

class item {

var $code, $title, $description, $icon, $enabled;

 

// class constructor

function item() {

global $order;

 

$this->code = 'item';

$this->title = MODULE_SHIPPING_ITEM_TEXT_TITLE;

$this->description = MODULE_SHIPPING_ITEM_TEXT_DESCRIPTION;

$this->sort_order = MODULE_SHIPPING_ITEM_SORT_ORDER;

$this->icon = '';

$this->tax_class = MODULE_SHIPPING_ITEM_TAX_CLASS;

$this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);

 

if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_ITEM_ZONE > 0) ) {

$check_flag = false;

$check_query = tep_db_query("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_ITEM_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");

while ($check = tep_db_fetch_array($check_query)) {

if ($check['zone_id'] < 1) {

$check_flag = true;

break;

} elseif ($check['zone_id'] == $order->delivery['zone_id']) {

$check_flag = true;

break;

}

}

 

if ($check_flag == false) {

$this->enabled = false;

}

}

}

 

// class methods

function quote($method = '') {

global $order;

 

$number_of_items = $this->getNumberOfItems();

 

$this->quotes = array('id' => $this->code,

'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE,

'methods' => array(array('id' => $this->code,

'title' => MODULE_SHIPPING_ITEM_TEXT_WAY,

'cost' => (MODULE_SHIPPING_ITEM_COST * $number_of_items) + MODULE_SHIPPING_ITEM_HANDLING)));

 

if ($this->tax_class > 0) {

$this->quotes['tax'] = tep_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);

}

 

if (tep_not_null($this->icon)) $this->quotes['icon'] = tep_image($this->icon, $this->title);

 

return $this->quotes;

}

 

function check() {

if (!isset($this->_check)) {

$check_query = tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_ITEM_STATUS'");

$this->_check = tep_db_num_rows($check_query);

}

return $this->_check;

}

 

function install() {

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Item Shipping', 'MODULE_SHIPPING_ITEM_STATUS', 'True', 'Do you want to offer per item rate shipping?', '6', '0', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_ITEM_COST', '2.50', 'The shipping cost will be multiplied by the number of items in an order that uses this shipping method.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Handling Fee', 'MODULE_SHIPPING_ITEM_HANDLING', '0', 'Handling fee for this shipping method.', '6', '0', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_ITEM_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'tep_get_tax_class_title', 'tep_cfg_pull_down_tax_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_ITEM_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'tep_get_zone_class_title', 'tep_cfg_pull_down_zone_classes(', now())");

tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_ITEM_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())");

}

 

function remove() {

tep_db_query("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");

}

 

function keys() {

return array('MODULE_SHIPPING_ITEM_STATUS', 'MODULE_SHIPPING_ITEM_COST', 'MODULE_SHIPPING_ITEM_HANDLING', 'MODULE_SHIPPING_ITEM_TAX_CLASS', 'MODULE_SHIPPING_ITEM_ZONE', 'MODULE_SHIPPING_ITEM_SORT_ORDER');

}

 

function getNumberOfItems() {

global $order, $total_count;

 

$number_of_items = $total_count;

 

if ($order->content_type == 'mixed') {

$number_of_items = 0;

 

for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {

$number_of_items += $order->products[$i]['qty'];

 

if (isset($order->products[$i]['attributes'])) {

reset($order->products[$i]['attributes']);

while (list($option, $value) = each($order->products[$i]['attributes'])) {

$virtual_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad where pa.products_id = '" . (int)$order->products[$i]['id'] . "' and pa.options_values_id = '" . (int)$value['value_id'] . "' and pa.products_attributes_id = pad.products_attributes_id");

$virtual_check = tep_db_fetch_array($virtual_check_query);

 

if ($virtual_check['total'] > 0) {

$number_of_items -= $order->products[$i]['qty'];

}

}

}

}

}

 

return $number_of_items;

}

}

?>

 

 

Any help will be greatly appreciated.

Edited by FantasyArt

Share this post


Link to post
Share on other sites

Sure it is possible, but I don't know or have the desire to find out.

 

I gave up on shipping modules, and just use zones rates as a lot if the modules were a pain in the arse to me (rate changes, updates etc.).

 

Rather than sweat it I added a little to where I ship most, listed "free shipping" as a hook, and was done. I included zone rates for areas outside my country and a note or asterisk by the word "free" and never looked back. Did the same for taxes. Easy-peasee.

Edited by ErikMM

Web Developer, Firebug, and Notepad++ are powerful free tools for web design.

Share this post


Link to post
Share on other sites

Thanks, is there a site/forum section where I can work out how to code properly? I would love to be able to do what I pre-mentioned in the earlier post about adding a specific item to the code above to be bought for free postage.

 

If someone can point me in the right direction or help me with coding this I will truly be grateful.

 

As I am very new to coding I am still working out a lot on my own but when it comes to doing something like this I struggle, also am not confident enough to work through merging two files to create a new edit of the updated file.

 

Would love to see if there is a site where I can learn how to do the coding myself and learn a lot more about PHP, rather then annoying you all with these seemingly silly questions all the time.

Share this post


Link to post
Share on other sites

In setting up this file I have worked out that it needs a IF (FILE.PHP) IS CALLED, THEN POSTAGE = 0.00

IF (FILE.PHP + ANY OTHER ITEM), THEN POSTAGE = 0.00 + POSTAGE CALCULATED FOR OTHER FILE

 

I know that this is not the right way to type this code but you should be able to see what I am trying to work out. I need to add FILE.PHP = specific file when called = 0.00 postage, when FILE.PHP + ANY OTHER ITEM = 0.00 + postage calculated for other item.

 

I hope you understand this and someone can help me with this. Need to sort something out as I need to setup this so I can place this item in my online store with 0.00 Postage Worldwide. Although if you the ITEM is purchased with another item then postage needs to be calculated only on the other items leaving the first item (Item = Free Postage) free postage costs.

 

I have been tossing up the idea of trying to put 0.00 weight on the specific item that requires to be postage free. This way if the item is purchased with any other item with a weight specified then there shouldn't be any extra postage added for the initial item.

 

On a different matter I need to know how to setup ZONE POSTAGE for another set of items. How would I setup a zone postage option that only shows with these items with the zones UK = FREE POSTAGE, Europe = small = 9.20, medium = 11.20, large = 13.00, International = small = 12.00, medium = 14.20, large = 15.00. As I haven't used ZONE POSTAGE before I am unfamiliar with setting it up so need all the help I can get.

 

Sorry for dumping all this on you all but would appreciate all the help I can get on these matters.

Share this post


Link to post
Share on other sites

Hello, thought i'd jump in. I'm making a shipping module that reduces shipping by qty, price, or weight! not only that, but it is close to being able to separate products by category or per product! If you try the table module in Oscommerce 2.2 it produces the wrong results! My module produces the proper results such as if you have 100 items to ship and the shipping per product is supposed to be $1.00 total shipping would cost $100.00

 

pm me for details!!


Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

Share this post


Link to post
Share on other sites

I 2 main items that I wish to create shipping modules for.

 

Firstly item 1 has to ship worldwide FREE OF CHARGE.

 

Secondly item 2 has a variable shipping rate dependant on where the customer lives, (UK, Europe, International) and also the size of the item, small, medium and large.

 

I currently use Ozpost MultiQuote and Flat Shipping, (which I modified the text to show free pickup in local area). Flat shipping isn't really what I want to use as the way it is currently modified as it still shows up even if the customer isn't in the local area.

 

I need item #1 to show up worldwide Free shipping when that item alone is placed in the shopping cart.

 

As it stands Ozpost MultiQuote takes care of all items that has Shipping Fees associated with it.

 

I also need item #1 to be able to show as NO SHIPPING FEE when placed in the shopping cart with another item that has shipping fees attached to it.

 

Item #2 has to show shipping rates associated with size of product. e.g. Small, Medium or Large.

 

Plus it has to show up FREE SHIPPING when the customer is in the UK.

 

Another charge amount dependant on whether they are located in Europe or International.

 

This shipping has to show when the item/s are placed into a cart by itself and also when it is placed in a shopping cart with another item located in the store that charges shipping dependant on its weight.

 

That is the best way I can describe what I need @@burt can possibly clean it up with help regarding what I need to happen if this isn't sufficient.

Share this post


Link to post
Share on other sites

What coding do I have to put in the Ozpost MultiQuote to only make it show up for items over a certain weight please?

 

e.g. Customer places an item in the cart that weighs 150grams - Zone Shipping shows with a shipping price for this item ONLY.

 

At the moment both Ozpost MultiQuote and Zone Shipping module (which is yet to be configured properly), show up for this weight.

 

I want Ozpost MultiQuote to handle everything over 5kg.

 

Zone Shipping Module to handle anything under this weight.

 

Also would like to know which are the common grouped shipping zones for shipping from Australia to overseas destinations please?

 

As I understand when setting up the Zone Shipping module I should be able to set 0:Free Shipping, 0.50:4.00,1:8.00,.... and so on.

 

Could you please let me know if I am correct on this assumption as I don't want to go through setting it all up and it tell me that I have done something wrong and not be able to work out what it is.

 

Thank you in advance.

Share this post


Link to post
Share on other sites

Got the per item thing sorted out! just need to de-buggify the code and upload a package!


Always backup your files! You will be glad you did

My add-ons :

SSPP Seperate Shipping Per Product v2.5| Support
Gift vouchers for SPPC 4.22 v2.1 | Support |
Catalog Infobox v1.0 | Sorry no support for Catalog Infobox |
HTML Mail v2.0 | Support |




Upcoming Add ons:

Addon Manager |
Separate Pricing Per Product Qty |
Coupon Populate |
EZ-PDF Catalog

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

×