Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2009
    Posts
    40
    Plugin Contributions
    0

    Default Super Orders mod for Dual Pricing mod to show Reseller on Packing Slip

    I am using Super Orders and Dual Pricing mods together. I use Dual Pricing for our Resellers which reflects their wholesale pricing. However, when I print a packing slip, I need the Resellers billing info to print on the packing slip, not my store info.

    Fairly simple mod, however, I am having trouble with one part of the logic. Basically, if zen_customers.customers_whole is greater than 0, then the customer is a Reseller. (defined as $c_whole)

    Below is my logic in super_packingslip.php. However, I return a 1 for every customer for zen_customers.customers_whole regardless if they are a Reseller or not.

    Can anybody help me out? Thanks in advance!

    (BTW, (int)$oID is defined earlier in the code.)

    PHP Code:
    <?php
          $order_check 
    $db->Execute("SELECT cc_cvv, customers_id, customers_name, customers_company, customers_street_address,
                                        customers_suburb, customers_city, customers_postcode,
                                        customers_state, customers_country, customers_telephone,
                                        customers_email_address, customers_address_format_id, delivery_name,
                                        delivery_company, delivery_street_address, delivery_suburb,
                                        delivery_city, delivery_postcode, delivery_state, delivery_country,
                                        delivery_address_format_id, billing_name, billing_company,
                                        billing_street_address, billing_suburb, billing_city, billing_postcode,
                                        billing_state, billing_country, billing_address_format_id,
                                        payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
                                        currency_value, date_purchased, orders_status, last_modified
                                        FROM " 
    TABLE_ORDERS "
                                        WHERE orders_id = '" 
    . (int)$oID "'");
    ?>
    <!-- mod print reseller info on packing slip if reseller - rh - 122912-->
    <?php
            $c_whole 
    $db->Execute("SELECT c.customers_whole
                                    FROM " 
    TABLE_CUSTOMERS " c
                                    WHERE c.customers_id = '" 
    $order_check->fields['customers_id'] . "'");
                            
        if ((int)
    $c_whole 0) {?>
        
            <td class="pageHeading"><?php echo (int)$order_check->fields['customers_id']?><br />
            <?php echo (int)$c_whole?><br />
            <?php echo $order_check->fields['customers_street_address']?><br />
            <?php echo $order_check->fields['customers_city'?>
            <?php echo $order_check->fields['customers_state'?>
            <?php echo $order_check->fields['customers_postcode']?><br />
            <?php echo $order_check->fields['customers_telephone']?><br />
            <?php echo $order_check->fields['customers_email_address'];?></td>
            <td class="pageHeading" align="right"><?php echo TEXT_PACKING_SLIP?></td>
        <?
    }
        else {
        ?>        
            <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
            <td class="pageHeading" align="right"><a href="<?php echo FILENAME_SUPER_PACKINGSLIP '?' zen_get_all_get_params(); ?>"><?php echo zen_image(DIR_WS_IMAGES HEADER_LOGO_IMAGE)?></a><br /><?php echo TEXT_PACKING_SLIP?></td>
    <?
    }
    ?>
    Last edited by kavlito; 29 Dec 2012 at 05:09 PM.

  2. #2
    Join Date
    Sep 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Super Orders mod for Dual Pricing mod to show Reseller on Packing Slip

    OK, I figured it out.

    Now I will post how to print a Resellers demographics on the packing slip instead of your stores demographics using the Super Orders and Dual Pricing mods.

    You will only be modifying the super_packingslip.php file in your admin folder.

    1. Around line 96, select the following code and cut it to be moved up to below line 84:

    PHP Code:
    <?php
          $order_check 
    $db->Execute("SELECT cc_cvv, customers_name, customers_company, customers_street_address,
                                        customers_suburb, customers_city, customers_postcode,
                                        customers_state, customers_country, customers_telephone,
                                        customers_email_address, customers_address_format_id, delivery_name,
                                        delivery_company, delivery_street_address, delivery_suburb,
                                        delivery_city, delivery_postcode, delivery_state, delivery_country,
                                        delivery_address_format_id, billing_name, billing_company,
                                        billing_street_address, billing_suburb, billing_city, billing_postcode,
                                        billing_state, billing_country, billing_address_format_id,
                                        payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
                                        currency_value, date_purchased, orders_status, last_modified
                                        FROM " 
    TABLE_ORDERS "
                                        WHERE orders_id = '" 
    . (int)$oID "'");
    ?>
    2. In the SELECT statement, insert customers_id:

    PHP Code:
          $order_check $db->Execute("SELECT cc_cvv, customers_id, customers_name, customers_company, customers_street_address, 
    3. Now, insert this code around line 104:

    PHP Code:
    <!-- mod print reseller info on packing slip if reseller - 122912-->
    <?php
            $c_whole 
    $db->Execute("SELECT customers_whole
                                    FROM " 
    TABLE_CUSTOMERS "
                                    WHERE customers_id = '" 
    $order_check->fields['customers_id'] . "'");
                            
        if (
    $c_whole->fields['customers_whole'] > '0') {?>
        
            <td class="pageHeading"><?php echo $order_check->fields['customers_company']?><br />
            <?php echo $order_check->fields['customers_street_address']?><br />
            <?php echo $order_check->fields['customers_city'?>
            <?php echo $order_check->fields['customers_state'?>
            <?php echo $order_check->fields['customers_postcode']?><br />
            <?php echo $order_check->fields['customers_telephone']?><br />
            <?php echo $order_check->fields['customers_email_address'];?></td>
            <td class="pageHeading" align="right"><?php echo TEXT_PACKING_SLIP?></td>
        <?
    }
        else {
        ?>    
    <!-- end mod reseller packing slip -->
    4. This is what your final modded code should look like. Mine starts on line 89 and goes through line 129. Pay attention to the last 3 lines to close off your IF/ELSE statement.

    PHP Code:
    <?php
          $order_check 
    $db->Execute("SELECT cc_cvv, customers_id, customers_name, customers_company, customers_street_address,
                                        customers_suburb, customers_city, customers_postcode,
                                        customers_state, customers_country, customers_telephone,
                                        customers_email_address, customers_address_format_id, delivery_name,
                                        delivery_company, delivery_street_address, delivery_suburb,
                                        delivery_city, delivery_postcode, delivery_state, delivery_country,
                                        delivery_address_format_id, billing_name, billing_company,
                                        billing_street_address, billing_suburb, billing_city, billing_postcode,
                                        billing_state, billing_country, billing_address_format_id,
                                        payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
                                        currency_value, date_purchased, orders_status, last_modified
                                        FROM " 
    TABLE_ORDERS "
                                        WHERE orders_id = '" 
    . (int)$oID "'");
    ?>
    <!-- mod print reseller info on packing slip if reseller - rh - 122912-->
    <?php
            $c_whole 
    $db->Execute("SELECT customers_whole
                                    FROM " 
    TABLE_CUSTOMERS "
                                    WHERE customers_id = '" 
    $order_check->fields['customers_id'] . "'");
                            
        if (
    $c_whole->fields['customers_whole'] > '0') {?>
        
            <td class="pageHeading"><?php echo $order_check->fields['customers_company']?><br />
            <?php echo $order_check->fields['customers_street_address']?><br />
            <?php echo $order_check->fields['customers_city'?>
            <?php echo $order_check->fields['customers_state'?>
            <?php echo $order_check->fields['customers_postcode']?><br />
            <?php echo $order_check->fields['customers_telephone']?><br />
            <?php echo $order_check->fields['customers_email_address'];?></td>
            <td class="pageHeading" align="right"><?php echo TEXT_PACKING_SLIP?></td>
        <?
    }
        else {
        ?>    
    <!-- end mod reseller packing slip -->    
            <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
            <td class="pageHeading" align="right"><a href="<?php echo FILENAME_SUPER_PACKINGSLIP '?' zen_get_all_get_params(); ?>"><?php echo zen_image(DIR_WS_IMAGES HEADER_LOGO_IMAGE)?></a><br /><?php echo TEXT_PACKING_SLIP?></td>
    <?
    }
    ?>
    You may want to notify your Resellers to verify their billing information as this is what will print in the upper left of the super packing slip. You may also want to inform them that anything they put in the Special Instructions will also print on the packing slip and will be seen by their customers.
    Last edited by kavlito; 29 Dec 2012 at 06:37 PM.

  3. #3
    Join Date
    Sep 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Super Orders mod for Dual Pricing mod to show Reseller on Packing Slip

    OK, I figured it out.

    Now I will post how to print a Resellers demographics on the packing slip instead of your stores demographics using the Super Orders and Dual Pricing mods.

    As stated in original post, if customers.customers_whole is greater than 0, then your customer is a reseller based on the Dual Pricing mod. My mod validates this field and if greater than 0 will print your Resellers billing demographics on the packing slip. Otherwise, it will print your stores demographics.

    You will only be modifying the super_packingslip.php file in your admin folder.

    1. Around line 96, select the following code and cut it to be moved up to below line 84:

    PHP Code:
    <?php
          $order_check 
    $db->Execute("SELECT cc_cvv, customers_name, customers_company, customers_street_address,
                                        customers_suburb, customers_city, customers_postcode,
                                        customers_state, customers_country, customers_telephone,
                                        customers_email_address, customers_address_format_id, delivery_name,
                                        delivery_company, delivery_street_address, delivery_suburb,
                                        delivery_city, delivery_postcode, delivery_state, delivery_country,
                                        delivery_address_format_id, billing_name, billing_company,
                                        billing_street_address, billing_suburb, billing_city, billing_postcode,
                                        billing_state, billing_country, billing_address_format_id,
                                        payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
                                        currency_value, date_purchased, orders_status, last_modified
                                        FROM " 
    TABLE_ORDERS "
                                        WHERE orders_id = '" 
    . (int)$oID "'");
    ?>
    2. In the SELECT statement, insert customers_id:

    PHP Code:
          $order_check $db->Execute("SELECT cc_cvv, customers_id, customers_name, customers_company, customers_street_address, 
    3. Now, insert this code around line 104:

    PHP Code:
    <!-- mod print reseller info on packing slip if reseller - 122912-->
    <?php
            $c_whole 
    $db->Execute("SELECT customers_whole
                                    FROM " 
    TABLE_CUSTOMERS "
                                    WHERE customers_id = '" 
    $order_check->fields['customers_id'] . "'");
                            
        if (
    $c_whole->fields['customers_whole'] > '0') {?>
        
            <td class="pageHeading"><?php echo $order_check->fields['customers_company']?><br />
            <?php echo $order_check->fields['customers_street_address']?><br />
            <?php echo $order_check->fields['customers_city'?>
            <?php echo $order_check->fields['customers_state'?>
            <?php echo $order_check->fields['customers_postcode']?><br />
            <?php echo $order_check->fields['customers_telephone']?><br />
            <?php echo $order_check->fields['customers_email_address'];?></td>
            <td class="pageHeading" align="right"><?php echo TEXT_PACKING_SLIP?></td>
        <?
    }
        else {
        ?>    
    <!-- end mod reseller packing slip -->
    4. This is what your final modded code should look like. Mine starts on line 89 and goes through line 129. Pay attention to the last 3 lines to close off your IF/ELSE statement.

    PHP Code:
    <?php
          $order_check 
    $db->Execute("SELECT cc_cvv, customers_id, customers_name, customers_company, customers_street_address,
                                        customers_suburb, customers_city, customers_postcode,
                                        customers_state, customers_country, customers_telephone,
                                        customers_email_address, customers_address_format_id, delivery_name,
                                        delivery_company, delivery_street_address, delivery_suburb,
                                        delivery_city, delivery_postcode, delivery_state, delivery_country,
                                        delivery_address_format_id, billing_name, billing_company,
                                        billing_street_address, billing_suburb, billing_city, billing_postcode,
                                        billing_state, billing_country, billing_address_format_id,
                                        payment_method, cc_type, cc_owner, cc_number, cc_expires, currency,
                                        currency_value, date_purchased, orders_status, last_modified
                                        FROM " 
    TABLE_ORDERS "
                                        WHERE orders_id = '" 
    . (int)$oID "'");
    ?>
    <!-- mod print reseller info on packing slip if reseller - rh - 122912-->
    <?php
            $c_whole 
    $db->Execute("SELECT customers_whole
                                    FROM " 
    TABLE_CUSTOMERS "
                                    WHERE customers_id = '" 
    $order_check->fields['customers_id'] . "'");
                            
        if (
    $c_whole->fields['customers_whole'] > '0') {?>
        
            <td class="pageHeading"><?php echo $order_check->fields['customers_company']?><br />
            <?php echo $order_check->fields['customers_street_address']?><br />
            <?php echo $order_check->fields['customers_city'?>
            <?php echo $order_check->fields['customers_state'?>
            <?php echo $order_check->fields['customers_postcode']?><br />
            <?php echo $order_check->fields['customers_telephone']?><br />
            <?php echo $order_check->fields['customers_email_address'];?></td>
            <td class="pageHeading" align="right"><?php echo TEXT_PACKING_SLIP?></td>
        <?
    }
        else {
        ?>    
    <!-- end mod reseller packing slip -->    
            <td class="pageHeading"><?php echo nl2br(STORE_NAME_ADDRESS); ?></td>
            <td class="pageHeading" align="right"><a href="<?php echo FILENAME_SUPER_PACKINGSLIP '?' zen_get_all_get_params(); ?>"><?php echo zen_image(DIR_WS_IMAGES HEADER_LOGO_IMAGE)?></a><br /><?php echo TEXT_PACKING_SLIP?></td>
    <?
    }
    ?>
    You may want to notify your Resellers to verify their billing information as this is what will print in the upper left of the super packing slip. You may also want to inform them that anything they put in the Special Instructions will also print on the packing slip and will be seen by their customers.

  4. #4
    Join Date
    Sep 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Super Orders mod for Dual Pricing mod to show Reseller on Packing Slip

    Another simple mod that makes sense with this one is to eliminate the Bill To: information on the Resellers packing slip as this would print the Reseller as the Bill To: and would be seen by the Resellers customer.

    1. Look for this code around line 131:

    PHP Code:
           <td><?php echo zen_draw_separator('pixel_trans.gif''175''1'); ?></td>
            <td valign="top" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main"><strong><?php echo ENTRY_SOLD_TO?></strong></td>
              </tr>
              <tr>
                <td class="main"><?php echo zen_address_format($order->customer['format_id'], $order->billing1'''<br />'); ?></td>
              </tr>
            </table></td>
          </tr>
        </table><hr /></td>
      </tr>
    2. Change to this code:

    PHP Code:
           <td><?php echo zen_draw_separator('pixel_trans.gif''175''1'); ?></td>
    <!-- mod if reseller do not print Bill To information - 122912 -->
            <?
            if ($c_whole->fields['customers_whole'] == '0') {?>
            <td valign="top" align="right"><table width="100%" border="0" cellspacing="0" cellpadding="2">
              <tr>
                <td class="main"><strong><?php echo ENTRY_SOLD_TO?></strong></td>
              </tr>
              <tr>
                <td class="main"><?php echo zen_address_format($order->customer['format_id'], $order->billing1'''<br />'); ?></td>
              </tr>
            </table></td>
            <?
    }
        else 
        ?>
        
          </tr>
        </table><hr /></td>
      </tr>
    The Bill To: information will continue to print for non-Reseller packing slips, and be eliminated on the Reseller packing slip.

 

 

Similar Threads

  1. Merging Dual Pricing Mod and Group Pricing Mod
    By dewaltdave in forum All Other Contributions/Addons
    Replies: 6
    Last Post: 13 Dec 2013, 02:24 AM
  2. Making Dual Pricing Mod and Add Customer from Admin Mod Work Together
    By r2llc1605 in forum Customization from the Admin
    Replies: 5
    Last Post: 19 May 2009, 04:37 AM
  3. Dual Pricing mod for zen cart 1.3.7.1 ?
    By vasilios in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 20 Dec 2008, 02:36 PM
  4. dual pricing super orders
    By rocketrod in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 15 Nov 2007, 10:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg