Zen Cart Logo
Forums / Addon Shipping Modules / Canada Post Issue with Items Shipped in Orginal Box

Canada Post Issue with Items Shipped in Orginal Box

Views: 1,923

Results 1 to 11 of 11
7 Jun 2014, 2:48 PM
#1
tsicogs avatar

tsicogs

New Zenner

Join Date:
Jun 2014
Location:
St Catharines, Ontario Canada
Posts:
5
Plugin Contributions:
0

Canada Post Issue with Items Shipped in Orginal Box

Hi there

Really having an issue with this and i have searched the forums with no luck. If i have missed please just send me the url. As i have attached, i am missing this section for Canada Post and Products and i have just recently updated Zen Cart and added the lastest module. Have i missed a file somewhere?

Thanks

Steve Fulton UE

Attachment 14140

8 Jun 2014, 4:50 AM
#2
thomasjj avatar

thomasjj

New Zenner

Join Date:
Jun 2014
Posts:
11
Plugin Contributions:
0

Re: Canada Post Issue with Items Shipped in Orginal Box

Steve I don't see anything missing in your attachment image. That's how it is supposed to look. That's exactly how it looks in my admin and the CP module works perfectly for me (with one exception, which I am here to inquire about shortly...).

8 Jun 2014, 11:04 AM
#3
tsicogs avatar

tsicogs

New Zenner

Join Date:
Jun 2014
Location:
St Catharines, Ontario Canada
Posts:
5
Plugin Contributions:
0

Re: Canada Post Issue with Items Shipped in Orginal Box

Sorry, i may not have been clear. I am not getting that. That does not show up for me.

9 Jun 2014, 3:40 AM
#4
thomasjj avatar

thomasjj

New Zenner

Join Date:
Jun 2014
Posts:
11
Plugin Contributions:
0

Re: Canada Post Issue with Items Shipped in Orginal Box

If that section of the products page isn't even showing up then I would be willing to bet you made an error in the CP Module installation somewhere along the way, or something went wrong when you updated Zen Cart its self. If it were me, I'd backup the website and database (seperately), install a fresh copy of Zen Cart 1.5.1 and import your old database into the new database, then try installing the module again. Can't hurt to try. Sorry that I couldn't be of more help to you.

10 Jun 2014, 3:48 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Canada Post Issue with Items Shipped in Orginal Box

It's the /admin/includes/modules/XXXXXXXX/collect_info.php files that you've forgotten to merge.

15 Jun 2014, 12:08 PM
#6
tsicogs avatar

tsicogs

New Zenner

Join Date:
Jun 2014
Location:
St Catharines, Ontario Canada
Posts:
5
Plugin Contributions:
0

Re: Canada Post Issue with Items Shipped in Orginal Box

Thanks for the help, added the files even though i thought i did and still nothing. Anything else i could be missing?

15 Jun 2014, 12:33 PM
#7
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Canada Post Issue with Items Shipped in Orginal Box

TSICOGS:

Anything else i could be missing?

No, not really. As DrByte has stated, "It's the /admin/includes/modules/XXXXXXXX/collect_info.php files that you've forgotten to merge".

If it is of any help, the "admin" needs to be the name of your admin folder.
The 'XXXXXXXX' will be the folder called "product" (assuming this is a regular product).

If you need the additional fields to show up for other product types, eg, documents or music, then you will need to merge the collect_info.php in the relevant folders as well (relevant folders being 'document_general', 'document_product', 'product_music', etc, etc).

Cheers
RodG

15 Jun 2014, 2:58 PM
#8
tsicogs avatar

tsicogs

New Zenner

Join Date:
Jun 2014
Location:
St Catharines, Ontario Canada
Posts:
5
Plugin Contributions:
0

Re: Canada Post Issue with Items Shipped in Orginal Box

Thanks for your help, let's just say Newbie Mistake. One other question if i can ask, how do i change them all in one shot to have the box unchecked for shipping in original container

Thanks

15 Jun 2014, 3:26 PM
#9
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Canada Post Issue with Items Shipped in Orginal Box

TSICOGS:

Thanks for your help, let's just say Newbie Mistake.

Nothing to be ashamed of. We were all newbies at one stage, and the only ones that haven't made a newbie mistake are those that haven't tried to do anything.

TSICOGS:

One other question if i can ask, how do i change them all in one shot to have the box unchecked for shipping in original container

I've never used this particular module, but I would have assumed that since this required a new field in the database then by default it would be unchecked for all products anyway.

Are you saying that they are being checked by default?
If this IS the case then you will probably need to make a small change to the /admin/includes/modules/update_product.php file.

Although I can't be precise, you will be looking for a pair of lines that read something like

 $tmp_value = zen_db_prepare_input($_POST['products_originalContainer']);
    $products_originalContainer = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 1) ? 1 : $tmp_value;

You will need to change this to:

 $tmp_value = zen_db_prepare_input($_POST['products_originalContainer']);
    $products_originalContainer = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value;

The stuff I've highlighted in BLUE almost certainly WON'T be what you'll find, you will need to identify the field name that is used for yourself. DON'T CHANGE THESE.

The NUMBERS I've highlighted in RED are what you'll need to change. IF in doubt please post this portion of your update_product.php file so that I (or someone else) can give more explicit information.

Cheers
RodG

15 Jun 2014, 3:49 PM
#10
tsicogs avatar

tsicogs

New Zenner

Join Date:
Jun 2014
Location:
St Catharines, Ontario Canada
Posts:
5
Plugin Contributions:
0

Re: Canada Post Issue with Items Shipped in Orginal Box

Thanks for your help. Once the Canada Post Module worked, i noticed the check box was on by default. I have searched the MYSQL Database for the value to no luck. I have included the file requested. Thanks agian

<?php /** * @package admin * @copyright Copyright 2003-2011 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: update_product.php 18695 2011-05-04 05:24:19Z drbyte $ */ if (!defined('IS_ADMIN_FLAG')) { die('Illegal Access'); } if (isset($_GET['pID'])) $products_id = zen_db_prepare_input($_GET['pID']); if (isset($_POST['edit_x']) || isset($_POST['edit_y'])) { $action = 'new_product'; } elseif ($_POST['products_model'] . $_POST['products_url'] . $_POST['products_name'] . $_POST['products_description'] != '') { $products_date_available = zen_db_prepare_input($_POST['products_date_available']); $products_date_available = (date('Y-m-d') < $products_date_available) ? $products_date_available : 'null'; // Data-cleaning to prevent MySQL5 data-type mismatch errors: $tmp_value = zen_db_prepare_input($_POST['products_quantity']); $products_quantity = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_price']); $products_price = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_weight']); $products_weight = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['manufacturers_id']); $manufacturers_id = (!zen_not_null($tmp_value) || $tmp_value=='' || $tmp_value == 0) ? 0 : $tmp_value; // CANADA POST MODULE changes below: $tmp_value = zen_db_prepare_input($_POST['products_weight_type']); $products_weight_type = (!zen_not_null($tmp_value) || $tmp_value=='') ? SYSTEM_WEIGHT_UNITS : $tmp_value; $tmp_value = zen_db_prepare_input($_POST['products_dim_type']); $products_dim_type = (!zen_not_null($tmp_value) || $tmp_value=='') ? SYSTEM_DIMENSION_UNITS : $tmp_value; $sql_data_array = array('products_quantity' => $products_quantity, 'products_type' => zen_db_prepare_input($_GET['product_type']), 'products_model' => zen_db_prepare_input($_POST['products_model']), 'products_price' => $products_price, 'products_date_available' => $products_date_available, 'products_weight' => $products_weight, // CANADA POST MODULE changes below: 'products_weight_type' => $products_weight_type, 'products_dim_type' => $products_dim_type, 'products_length' => (float)zen_db_prepare_input($_POST['products_length']), 'products_width' => (float)zen_db_prepare_input($_POST['products_width']), 'products_height' => (float)zen_db_prepare_input($_POST['products_height']), 'products_ready_to_ship' => (int)zen_db_prepare_input($_POST['products_ready_to_ship']), 'products_status' => zen_db_prepare_input((int)$_POST['products_status']), 'products_virtual' => zen_db_prepare_input((int)$_POST['products_virtual']), 'products_tax_class_id' => zen_db_prepare_input((int)$_POST['products_tax_class_id']), 'manufacturers_id' => $manufacturers_id, 'products_quantity_order_min' => zen_db_prepare_input($_POST['products_quantity_order_min']), 'products_quantity_order_units' => zen_db_prepare_input($_POST['products_quantity_order_units']), 'products_priced_by_attribute' => zen_db_prepare_input($_POST['products_priced_by_attribute']), 'product_is_free' => zen_db_prepare_input((int)$_POST['product_is_free']), 'product_is_call' => zen_db_prepare_input((int)$_POST['product_is_call']), 'products_quantity_mixed' => zen_db_prepare_input($_POST['products_quantity_mixed']), 'product_is_always_free_shipping' => zen_db_prepare_input((int)$_POST['product_is_always_free_shipping']), 'products_qty_box_status' => zen_db_prepare_input($_POST['products_qty_box_status']), 'products_quantity_order_max' => zen_db_prepare_input($_POST['products_quantity_order_max']), 'products_sort_order' => (int)zen_db_prepare_input($_POST['products_sort_order']), 'products_discount_type' => zen_db_prepare_input($_POST['products_discount_type']), 'products_discount_type_from' => zen_db_prepare_input($_POST['products_discount_type_from']), 'products_price_sorter' => zen_db_prepare_input($_POST['products_price_sorter']) ); // when set to none remove from database // is out dated for browsers use radio only $sql_data_array['products_image'] = zen_db_prepare_input($_POST['products_image']); $new_image= 'true'; if ($_POST['image_delete'] == 1) { $sql_data_array['products_image'] = ''; $new_image= 'false'; } if ($_POST['image_delete'] == 1) { $sql_data_array['products_image'] = ''; $new_image= 'false'; } if ($action == 'insert_product') { $insert_sql_data = array( 'products_date_added' => 'now()', 'master_categories_id' => (int)$current_category_id); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); zen_db_perform(TABLE_PRODUCTS, $sql_data_array); $products_id = zen_db_insert_id(); // reset products_price_sorter for searches etc. zen_update_products_price_sorter($products_id); $db->Execute("insert into " . TABLE_PRODUCTS_TO_CATEGORIES . " (products_id, categories_id) values ('" . (int)$products_id . "', '" . (int)$current_category_id . "')"); /////////////////////////////////////////////////////// //// INSERT PRODUCT-TYPE-SPECIFIC *INSERTS* HERE ////// //// *END OF PRODUCT-TYPE-SPECIFIC INSERTS* //////// /////////////////////////////////////////////////////// } elseif ($action == 'update_product') { $update_sql_data = array( 'products_last_modified' => 'now()', 'master_categories_id' => ($_POST['master_category'] > 0 ? zen_db_prepare_input($_POST['master_category']) : zen_db_prepare_input($_POST['master_categories_id']))); $sql_data_array = array_merge($sql_data_array, $update_sql_data); zen_db_perform(TABLE_PRODUCTS, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "'"); // reset products_price_sorter for searches etc. zen_update_products_price_sorter((int)$products_id); /////////////////////////////////////////////////////// //// INSERT PRODUCT-TYPE-SPECIFIC *UPDATES* HERE ////// //// *END OF PRODUCT-TYPE-SPECIFIC UPDATES* //////// /////////////////////////////////////////////////////// } $languages = zen_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $language_id = $languages[$i]['id']; $sql_data_array = array('products_name' => zen_db_prepare_input($_POST['products_name'][$language_id]), 'products_description' => zen_db_prepare_input($_POST['products_description'][$language_id]), 'products_url' => zen_db_prepare_input($_POST['products_url'][$language_id])); if ($action == 'insert_product') { $insert_sql_data = array('products_id' => (int)$products_id, 'language_id' => (int)$language_id); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array); } elseif ($action == 'update_product') { zen_db_perform(TABLE_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'"); } } // add meta tags $languages = zen_get_languages(); for ($i=0, $n=sizeof($languages); $i<$n; $i++) { $language_id = $languages[$i]['id']; $sql_data_array = array('metatags_title' => zen_db_prepare_input($_POST['metatags_title'][$language_id]), 'metatags_keywords' => zen_db_prepare_input($_POST['metatags_keywords'][$language_id]), 'metatags_description' => zen_db_prepare_input($_POST['metatags_description'][$language_id])); if ($action == 'insert_product_meta_tags') { $insert_sql_data = array('products_id' => (int)$products_id, 'language_id' => (int)$language_id); $sql_data_array = array_merge($sql_data_array, $insert_sql_data); zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $sql_data_array); } elseif ($action == 'update_product_meta_tags') { zen_db_perform(TABLE_META_TAGS_PRODUCTS_DESCRIPTION, $sql_data_array, 'update', "products_id = '" . (int)$products_id . "' and language_id = '" . (int)$language_id . "'"); } } // future image handler code define('IMAGE_MANAGER_HANDLER', 0); define('DIR_IMAGEMAGICK', ''); if ($new_image == 'true' and IMAGE_MANAGER_HANDLER >= 1) { $src= DIR_FS_CATALOG . DIR_WS_IMAGES . zen_get_products_image((int)$products_id); $filename_small= $src; preg_match("/.*\/(.*)\.(\w*)$/", $src, $fname); list($oiwidth, $oiheight, $oitype) = getimagesize($src); $small_width= SMALL_IMAGE_WIDTH; $small_height= SMALL_IMAGE_HEIGHT; $medium_width= MEDIUM_IMAGE_WIDTH; $medium_height= MEDIUM_IMAGE_HEIGHT; $large_width= LARGE_IMAGE_WIDTH; $large_height= LARGE_IMAGE_HEIGHT; $k = max($oiheight / $small_height, $oiwidth / $small_width); //use smallest size $small_width = round($oiwidth / $k); $small_height = round($oiheight / $k); $k = max($oiheight / $medium_height, $oiwidth / $medium_width); //use smallest size $medium_width = round($oiwidth / $k); $medium_height = round($oiheight / $k); $large_width= $oiwidth; $large_height= $oiheight; $products_image = zen_get_products_image((int)$products_id); $products_image_extension = substr($products_image, strrpos($products_image, '.')); $products_image_base = preg_replace('/'.$products_image_extension.'/', '', $products_image); $filename_medium = DIR_FS_CATALOG . DIR_WS_IMAGES . 'medium/' . $products_image_base . IMAGE_SUFFIX_MEDIUM . '.' . $fname[2]; $filename_large = DIR_FS_CATALOG . DIR_WS_IMAGES . 'large/' . $products_image_base . IMAGE_SUFFIX_LARGE . '.' . $fname[2]; // ImageMagick if (IMAGE_MANAGER_HANDLER == '1') { copy($src, $filename_large); copy($src, $filename_medium); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $large_width . " " . $filename_large); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $medium_width . " " . $filename_medium); exec(DIR_IMAGEMAGICK . "mogrify -geometry " . $small_width . " " . $filename_small); } } zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . (isset($_POST['search']) ? '&search=' . $_POST['search'] : '') )); } else { $messageStack->add_session(ERROR_NO_DATA_TO_SAVE, 'error'); zen_redirect(zen_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&pID=' . $products_id . (isset($_GET['page']) ? '&page=' . $_GET['page'] : '') . (isset($_POST['search']) ? '&search=' . $_POST['search'] : '') )); }
16 Jun 2014, 8:40 AM
#11
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: Canada Post Issue with Items Shipped in Orginal Box

TSICOGS:

Thanks for your help. Once the Canada Post Module worked, i noticed the check box was on by default. I have searched the MYSQL Database for the value to no luck. I have included the file requested. Thanks agian

OK, I didn't see what I was expecting to see in that file, so I've downloaded the module to see exactly what its doing, and it appears I was on the wrong track (so much for educated guesses) :(

Anyway, the file(s) you need to edit are:
It's the /admin/includes/modules/XXXXXXXX/collect_info.php

Look for the code that reads:

<td class="main" colspan="2"><?php echo zen_draw_separator('pixel_trans.gif', '24', '15') . ' ' . zen_draw_checkbox_field('products_ready_to_ship', '[B]1[/B]', $pInfo->products_ready_to_ship) . ' ' . TEXT_PRODUCTS_READY_TO_SHIP_SELECTION . ' ' ?></td>

Change the '1' to a '0'.

Cheers
RodG