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>
<?
}
?>