Forums / All Other Contributions/Addons / Multiple Ship-To Addresses [Support Thread]

Multiple Ship-To Addresses [Support Thread]

Views: 13,850

Results 41 to 60 of 91
11 Jul 2017, 9:32 PM
#41
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Multiple Ship-To Addresses [Support Thread]

dbltoe:

All on Windows 10 with order containing three separate delivery addresses.

  1. Chrome shows no print preview. Print command shows first to addresses on page one and third on page two. Prints two pages as shown in printer menu.
  1. Firefox shows four pages on print preview (fourth page is blank). Print command does not show number of pages. Prints four pages.
  1. Safari shows two pages on print preview and obviously breaks in the middle of address two. Print command does not show number of pages. Prints two pages.

Can PM/email playground if you wish.
Arggh, too many browsers with their own unique dialects! I've got this corrected on the plugin's GitHub repository (see this issue for the changes). Tested on IE, Chrome, FireFox and Safari; an order with 3 sub-orders properly prints 3 pages of packing slips on each.

I'll be getting this wrapped up for v1.2.0 of the Multiple Ship-To Addresses release. That release will drop support for Zen Cart versions prior to 1.5.5, allowing the plugin to make use of notifiers that are now included in the base and, thus, reducing the number of core-file overwrites required!

12 Jul 2017, 2:42 PM
#42
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

I just submitted v1.2.0 to the Zen Cart Plugins for review; I'll post back here once it's available for download.

19 Jul 2017, 3:26 PM
#43
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

v1.2.0 is now available for download from the Zen Cart plugins.

15 Aug 2017, 4:21 PM
#44
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

Let me start by saying that I've got this loaded on a 1.5.5e plain-jane site and it is working perfectly.

Not so much on the one I've been working on. I've got my brain so befuddled that I can't see whatever is staring me in the face.

One symptom was that the uninstall.sql was not completely removing the tables and configuration listings. Thought I had that fixed but, every time I removed and re-installed, the init_includes would not fire and setup the tables and configuration settings.

After finding a stray file, I got the init to fire but am getting ```
[13-Aug-2017 18:17:51 UTC] Request URI: /155e/index.php?main_page=checkout_process&zenid=b46jpej9kltq697nt61utm3u85, IP address: 216.177.186.199
#1 trigger_error() called at [/home//public_html/155e/includes/classes/db/mysql/query_factory.php:167]
#2 queryFactory->show_error() called at [/home/
/public_html/155e/includes/classes/db/mysql/query_factory.php:139]
#3 queryFactory->set_error() called at [/home//public_html/155e/includes/classes/db/mysql/query_factory.php:266]
#4 queryFactory->Execute() called at [/home/
/public_html/155e/includes/functions/functions_general.php:982]
#5 zen_db_perform() called at [/home//public_html/155e/includes/classes/class.multiship.php:391]
#6 multiship->_createOrderAddAttributes() called at [/home/
/public_html/155e/includes/classes/observers/class.multiship_observer.php:54]
#7 multiship_observer->update() called at [/home//public_html/155e/includes/classes/class.base.php:103]
#8 base->notify() called at [/home/
/public_html/155e/includes/classes/order.php:886]
#9 order->create_add_products() called at [/home//public_html/155e/includes/modules/checkout_process.php:92]
#10 require(/home/
/public_html/155e/includes/modules/checkout_process.php) called at [/home//public_html/155e/includes/modules/pages/checkout_process/header_php.php:14]
#11 require(/home/
/public_html/155e/includes/modules/pages/checkout_process/header_php.php) called at [/home//public_html/155e/index.php:36]
[13-Aug-2017 18:17:51 UTC] PHP Fatal error: 1062:Duplicate entry '21644' for key 'PRIMARY' :: INSERT INTO orders_products_attributes (orders_products_attributes_id, orders_id, orders_products_id, products_options, products_options_values, options_values_price, price_prefix, product_attribute_is_free, products_attributes_weight, products_attributes_weight_prefix, attributes_discounted, attributes_price_base_included, attributes_price_onetime, attributes_price_factor, attributes_price_factor_offset, attributes_price_factor_onetime, attributes_price_factor_onetime_offset, attributes_qty_prices, attributes_qty_prices_onetime, attributes_price_words, attributes_price_words_free, attributes_price_letters, attributes_price_letters_free, products_options_id, products_options_values_id, products_prid) VALUES ('21644', '5715', '6801', 'Dry Roast', '1 Pound in Texas Container', '15.9500', '+', '1', '1.25', '+', '1', '1', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '', '', '0.0000', '0', '0.0000', '0', '2', '11', '115:288e916535e8d251459de6dc1eaf0a39') ==> (as called by) /home/allpecans/public_html/155e/includes/functions/functions_general.php on line 982 <== in /home/
/public_html/155e/includes/classes/db/mysql/query_factory.php on line 167

In case you need to "play" with this, I'll PM the details.

Thanks for looking

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

15 Aug 2017, 5:48 PM
#45
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

@dbltoe, that's weird; I've looked at the uninstall and compared it to the MultiShip initialization and don't see anything that gets added during initialization that's not removed after "uninstall".

That said, I do see that the storefront observer isn't checking to see if the plugin's been installed on the admin-side; I'll add that check to help prevent some of those issues in the future.

15 Aug 2017, 7:16 PM
#46
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

I'm still looking at the processing surrounding that debug-log ... something's SIZE=1[/SIZE] funny.

15 Aug 2017, 10:36 PM
#47
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

When I do it, I do it up brown:cool:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

18 Aug 2017, 1:47 PM
#48
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

@dbltoe, I've updated /includes/classes/class.multiship.php on your test site, adding the highlighted line below. Does that correct the issue?

    // -----
    // Called by the multiship_observer class upon receipt of NOTIFY_ORDER_DURING_CREATE_ADDED_ATTRIBUTE_LINE_ITEM
    // (issued by the order class).
    //
    public function _createOrderAddAttributes($products_attributes_array) 
    {
        if ($this->selected) {
[B]            unset($products_attributes_array['orders_products_attributes_id']);[/B]
            foreach ($this->orders_multiship_ids as $orders_products_id) {
                $products_attributes_array['orders_products_id'] = $orders_products_id;
                zen_db_perform(TABLE_ORDERS_PRODUCTS_ATTRIBUTES, $products_attributes_array);
            }
        }
    }
18 Aug 2017, 7:17 PM
#49
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

Technically yes. By that, I mean that one would need to know what's going on to get to the multiple addresses. Knowing what the mod is supposed to do, I can go through the order process and successfully order, select different addresses, and get multiple packing slips that are correct. It's just some of the verbiage that might confuse the customer.

Since Multi does not work with One Page Checkout (OPC), the customer must go through the standard three-step checkout. Even one more, if actually using Multi, to confirm it all. So, here's the two situations.

Situation #1

When the customer selects Checkout, they are presented with Step 1 of 3 - Delivery Information. This is Shipping Information and the customer is told that their order will be shipped to the address on the left or they can change it by clicking on the Change Address button. Actually, if shipping to multiple addresses, any changes done here will need to be re-accomplished on Step 3 of 3 to accurately reflect the multiship addresses.

includes/languages/english/checkout_shipping, line #16, defines the text```
Your order will be shipped to the address at the left or you may change the shipping address by clicking the <em>Change Address</em> button.


Suggested text:

If you are <em>only shipping to one address</em>, now is the time to make sure the address is correct.  If you are shipping items to <em>multiple addresses</em>, those addresses will be entered in Step 3 of the checkout process.

Situation #2

If the customer gets to Step 3 of checkout and realizes they need to buy additional items, increase a quantity or decrease a quantity a warning is triggered from includes/languages/english/extra_definitions/multiship_common.php.  The warning is of two sentences.  The first lets the customer know that the product was added, or increased/decreased in quantity and will ship to the **Primary** address. The second sentence of that warning is```
[B]You will have the opportunity to change this during the checkout process[/B].
```If this file is only called when multiple addresses are selected, perhaps the second sentence should be```
You will have the opportunity to change this during [B]Step 3[/B] of the checkout process.
``` The warning correctly does not appear on a deletion of an item as the customer would not have to adjust a deleted shipping address.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

18 Aug 2017, 7:23 PM
#50
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

There is a new error when trying to delete the test order.```
[18-Aug-2017 19:17:23 UTC] Request URI: //orders.php?origin=index&page=1&&action=deleteconfirm, IP address: 216.177.186.199
#1 trigger_error() called at [/home/
/public_html/ADMIN/includes/classes/observers/class.multiship_admin_observer.php:122]
#2 multiship_observer->logError() called at [/home//public_html/ADMIN/includes/classes/observers/class.multiship_admin_observer.php:93]
#3 multiship_observer->update() called at [/home/
/public_html/includes/classes/class.base.php:103]
#4 base->notify() called at [/home//public_html/ADMIN/includes/functions/general.php:1538]
#5 zen_remove_order() called at [/home/
/public_html/ADMIN/orders.php:284]
[18-Aug-2017 19:17:23 UTC] PHP Fatal error: : Missing or invalid orders_id in notification params array. in /home/******/public_html/ADMIN/includes/classes/observers/class.multiship_admin_observer.php on line 122

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

18 Aug 2017, 7:23 PM
#51
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

Understood; I'll get three GitHub issues noted:

  1. The coding error that resulted in the database barf when the order includes a product with attributes.
  2. The coding error that resulted in the "new error" you reported.
  3. A change to the language text, providing "better" guidance.

Just so I'm clear, did the change I made to your test site (issue #1) correct that debug-log generation?

18 Aug 2017, 8:01 PM
#52
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

Yes ma'am!

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

18 Aug 2017, 8:12 PM
#53
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

OK, made (yet another) change, this time to /YOUR_ADMIN/includes/classes/observers/class.admin_multiship_observer.php. Find:

    public function update(&$class, $eventID, $p1a) 
    {
        global $db;
        $this->eventID = $eventID;

and add the highlighted additional parameters:

    public function update(&$class, $eventID, $p1a[B], &$p2, &$p3[/B]) 
    {
        global $db;
        $this->eventID = $eventID;

@dbltoe, I've applied this correction to your test site.

18 Aug 2017, 8:41 PM
#54
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

:clap: That got it!

Take the rest of the day off. You deserve it.:hug:

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

19 Aug 2017, 12:32 PM
#55
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

dbltoe:

:clap: That got it!

Take the rest of the day off. You deserve it.:hug:
Yeah! Thanks for providing the test-area. I'll get those language changes packaged up in preparation for this plugin's update.

25 Jan 2018, 5:41 PM
#56
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

Newest little twist in the packing slip department.

I have modified the standard packing slip on all our sites to reflect an image of the product being shipped. In a standard packing slip, the change starts around line 142 and looks like the following (additions in red)```
<td><table border="0" width="100%" cellspacing="0" cellpadding="2"> <!-- dbltoe -- Add Product Image -->
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent">Image</td>
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS; ?></td> <!-- Dropped colspan="2" -->
<td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
</tr>

<?php for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { echo ' <tr class="dataTableRow">' . "\n" . ' <td class="dataTableContent" valign="top" align="right"><img src="' . DIR_WS_CATALOG . DIR_WS_IMAGES . zen_get_products_image($order->products[$i]['id']) .'" align="left" width="' . IMAGE_ON_INVOICE_IMAGE_WIDTH . '" height="' . IMAGE_ON_INVOICE_IMAGE_HEIGHT . '" />' . $order->products[$i]['qty'] . ' x</td>' . "\n" . //dbltoe - Add Product Image ' <td class="dataTableContent" valign="top">' . $order->products[$i]['name']; ```This is the code in the packingslip_multiship that I need to adjust``` <tr class="dataTableHeadingRow"> <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
    <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
  </tr>
<?php foreach ($order->products as $currentProduct) { if ($currentProduct['orders_multiship_id'] != $multiship_id) { continue; } ?>
  <tr class="dataTableRow">
    <td class="dataTableContent" valign="top" align="right"><?php echo $currentProduct['qty']; ?> x</td>
    <td class="dataTableContent" valign="top"><?php echo $currentProduct['name']; ?>

Any assistance greatly appreciated.

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

25 Jan 2018, 6:33 PM
#57
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

@dbltoe, while not exactly what you had originally, I believe that the following will get you close ... and without a lot of "carving up":

    <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
      <tr class="dataTableHeadingRow">
[B]<?php
//-bof-20180125-lat94dbltoe-Add 'images' column
?>
        <td class="dataTableHeadingContent">Image</td>
<?php
//-eof-20180125-lat94dbltoe-Add 'images' column
?>[/B]
        <td class="dataTableHeadingContent" colspan="2"><?php echo TABLE_HEADING_PRODUCTS; ?></td>
        <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_PRODUCTS_MODEL; ?></td>
      </tr>
<?php
    foreach ($order->products as $currentProduct) {
        if ($currentProduct['orders_multiship_id'] != $multiship_id) {
        continue;
        }
?>
      <tr class="dataTableRow">
[B]<?php
//-bof-20180125-lat94dbltoe-Add image to column
?>
        <td class="dataTableContent" valign="top" align="left"><?php echo zen_image(DIR_WS_CATALOG . DIR_WS_IMAGES . zen_get_products_image($order->products[$i]['id']), '', IMAGE_ON_INVOICE_IMAGE_WIDTH, IMAGE_ON_INVOICE_IMAGE_HEIGHT); ?></td>
<?php
//-eof-20180125-lat94dbltoe-Add image to column
?>[/B]
        <td class="dataTableContent" valign="top" align="right"><?php echo $currentProduct['qty']; ?> x</td>
        <td class="dataTableContent" valign="top"><?php echo $currentProduct['name']; ?>
<?php
30 Jan 2018, 7:03 PM
#58
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

Sorry for the delay in getting back to you. I had accidentally added two mods that crashed multiship.

I slightly changed the code to ```
<tr class="dataTableRow"> <!-- BOF Add Image 2 of 2 - dbltoe -->
<td class="dataTableContent" valign="top" align="left"><?php echo zen_image(DIR_WS_CATALOG . DIR_WS_IMAGES . zen_get_products_image($order->products[$i]['id']), '', IMAGE_ON_INVOICE_IMAGE_WIDTH, IMAGE_ON_INVOICE_IMAGE_HEIGHT); ?></td>
<!-- EOF Add Image 2 of 2 - dbltoe -->
<td class="dataTableContent" valign="top" align="center"><?php echo $currentProduct['qty']; ?></td>
<td class="dataTableContent" valign="top"><?php echo $currentProduct['name']; ?>

<?php if (isset($currentProduct['attributes']) && (sizeof($currentProduct['attributes']) > 0)) { foreach ($currentProduct['attributes'] as $currentAttribute) { ?>
      <br /><span class="nobreak"><small> <i> - <?php echo $currentAttribute['option'] . ': ' . nl2br(zen_output_string_protected($currentAttribute['value'])); ?></i></small></span>
<?php } ?>
    </td>
    <td class="dataTableContent" valign="top"><?php echo $currentProduct['model']; ?></td>
<?php } ?>
  </tr>

page source reveals that all I'm getting from the line in red is this

<td class="dataTableContent" valign="top" align="left"><img src="[URL="https://www.allpecans.com/155f/images/"]/155f/images/[/URL]" border="0" alt="" width="IMAGE_ON_INVOICE_IMAGE_WIDTH" height="IMAGE_ON_INVOICE_IMAGE_HEIGHT"></td> ```

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

30 Jan 2018, 7:28 PM
#59
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Multiple Ship-To Addresses [Support Thread]

Since I'd mimicked your original code, I assumed that the IMAGE_ON_INVOICE_IMAGE_WIDTH/HEIGHT definitions were available; your page-source shows differently.

30 Jan 2018, 9:24 PM
#60
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,862
Plugin Contributions:
18

Re: Multiple Ship-To Addresses [Support Thread]

Sorry was rushing out the door to PT.
the problem is the undefined constraints but, it's not pulling the image correctly before that. Only gets directory and folder

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com