And finally on tonight's list, I'd like to be able to charge shipping (doesn't matter whether flat rate, USPS, or UPS) to just the wholesale folks. Shipping is factored into the retail price.
THANX
And finally on tonight's list, I'd like to be able to charge shipping (doesn't matter whether flat rate, USPS, or UPS) to just the wholesale folks. Shipping is factored into the retail price.
THANX
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.
There's no need to worry about the authorization, you're welcome to let them sign up on the fly. You can change their account to wholesale at any time, however if they have placed an order, that order will be a record of the type of account they had at the time. It's not too difficult to change their wholesale account status, remake the order and delete the old 'retail' order... just be sure to click the 'restock products' checkbox if you're tracking stock :)
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.
You need to add the wholesale filter to the tax module so instead of doing any tax calculations it completely bypasses the module. There's an example i'm certain will work where you see the customers_wholesale filter in an if statement then true or false. Just like the shipping and payment modules.
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.
Here's what we did to turn off tax for the wholesale customer. Got a better idea?
becamePHP Code:
/*********************************************
* Calculate taxes for this product
*********************************************/
$shown_price = (zen_add_tax($this->products[$index]['final_price'] * $this->products[$index]['qty'], $this->products[$index]['tax']))
+ zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);
$this->info['subtotal'] += $shown_price;
$this->notify('NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE', array('shown_price'=>$shown_price));
// find product's tax rate and description
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
// calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
$tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
} else {
// calculate the amount of tax for this product (assuming tax is NOT included in the price)
// $tax_add = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
$tax_add = ($products_tax/100) * $shown_price;
}
$this->info['tax'] += $tax_add;
foreach ($taxRates as $taxDescription=>$taxRate)
{
$taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)
+ zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);
if (isset($this->info['tax_groups'][$taxDescription]))
{
$this->info['tax_groups'][$taxDescription] += $taxAdd;
} else
{
$this->info['tax_groups'][$taxDescription] = $taxAdd;
}
}
/*********************************************
* END: Calculate taxes for this product
*********************************************/
THANXPHP Code:
/*********************************************
* Calculate taxes for this product
*********************************************/
$shown_price = (zen_add_tax($this->products[$index]['final_price'] * $this->products[$index]['qty'], $this->products[$index]['tax']))
+ zen_add_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']);
$this->info['subtotal'] += $shown_price;
$this->notify('NOTIFIY_ORDER_CART_SUBTOTAL_CALCULATE', array('shown_price'=>$shown_price));
// find product's tax rate and description
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if($_SESSION['customers_wholesale'] =='1'){
$products_tax = 0 ;
$this->products[$index]['tax'] = 0;
$tax_add = 0;
$this->products[$index]['tax_description'] = '';
}
if($_SESSION['customers_wholesale'] =='0'){
if (DISPLAY_PRICE_WITH_TAX == 'true') {
// calculate the amount of tax "inc"luded in price (used if tax-in pricing is enabled)
$tax_add = $shown_price - ($shown_price / (($products_tax < 10) ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax)));
} else {
// calculate the amount of tax for this product (assuming tax is NOT included in the price)
// $tax_add = zen_round(($products_tax / 100) * $shown_price, $currencies->currencies[$this->info['currency']]['decimal_places']);
$tax_add = ($products_tax/100) * $shown_price;
}
$this->info['tax'] += $tax_add;
foreach ($taxRates as $taxDescription=>$taxRate)
{
$taxAdd = zen_calculate_tax($this->products[$index]['final_price']*$this->products[$index]['qty'], $taxRate)
+ zen_calculate_tax($this->products[$index]['onetime_charges'], $taxRate);
if (isset($this->info['tax_groups'][$taxDescription]))
{
$this->info['tax_groups'][$taxDescription] += $taxAdd;
} else
{
$this->info['tax_groups'][$taxDescription] = $taxAdd;
}
}
}
/*********************************************
* END: Calculate taxes for this product
*********************************************/
Are You Vulnerable for an Accessibility Lawsuit?
myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
Free SSL, Domain, and MagicThumb with semi-annual and longer hosting.
Twitch,
Trying to write the code to eliminate the Free Shipping on the Wholesale Account to only show UPS and USPS ...
includes/modules/shipping/ups.php
Code:function ups() { global $order, $db, $template, $current_page_base; $this->code = 'ups'; $this->title = MODULE_SHIPPING_UPS_TEXT_TITLE; $this->description = MODULE_SHIPPING_UPS_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_UPS_SORT_ORDER; $this->icon = $template->get_template_dir('shipping_ups.gif', DIR_WS_TEMPLATE, $current_page_base,'images/icons'). '/' . 'shipping_ups.gif'; $this->tax_class = MODULE_SHIPPING_UPS_TAX_CLASS; $this->tax_basis = MODULE_SHIPPING_UPS_TAX_BASIS; // disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false); } if ($this->enabled) { // check MODULE_SHIPPING_UPS_HANDLING_METHOD is in $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_UPS_HANDLING_METHOD'"); if ($check_query->EOF) { $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Handling Per Order or Per Box', 'MODULE_SHIPPING_UPS_HANDLING_METHOD', 'Box', 'Do you want to charge Handling Fee Per Order or Per Box?', '6', '0', 'zen_cfg_select_option(array(\'Order\', \'Box\'), ', now())"); } } if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_UPS_ZONE > 0) ) { $check_flag = false; $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_UPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id"); while (!$check->EOF) { if ($check->fields['zone_id'] < 1) { $check_flag = true; break; } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) { $check_flag = true; break; } $check->MoveNext(); } if ($check_flag == false) { $this->enabled = false; } } $this->types = array('1DM' => 'Next Day Air Early AM', '1DML' => 'Next Day Air Early AM Letter', '1DA' => 'Next Day Air', '1DAL' => 'Next Day Air Letter', '1DAPI' => 'Next Day Air Intra (Puerto Rico)', '1DP' => 'Next Day Air Saver', '1DPL' => 'Next Day Air Saver Letter', '2DM' => '2nd Day Air AM', '2DML' => '2nd Day Air AM Letter', '2DA' => '2nd Day Air', '2DAL' => '2nd Day Air Letter', '3DS' => '3 Day Select', 'GND' => 'Ground', 'GNDCOM' => 'Ground Commercial', 'GNDRES' => 'Ground Residential', 'STD' => 'Canada Standard', 'XPR' => 'Worldwide Express', 'XPRL' => 'Worldwide Express Letter', 'XDM' => 'Worldwide Express Plus', 'XDML' => 'Worldwide Express Plus Letter', 'XPD' => 'Worldwide Expedited', 'WXS' => 'Worldwide Saver'); } /** * Get quote from shipping provider's API: * * @param string $method * @return array of quotation results */ function quote($method = '') { global $_POST, $order, $shipping_weight, $shipping_num_boxes; if ( (zen_not_null($method)) && (isset($this->types[$method])) ) { $prod = $method; // BOF: UPS USPS } else if ($order->delivery['country']['iso_code_2'] == 'CA') { $prod = 'STD'; // EOF: UPS USPS } else { $prod = 'GNDRES'; } if ($method) $this->_upsAction('3'); // return a single quote $this->_upsProduct($prod);Having problems, what you think?if (zen_get_shipping_enabled($this->code)) {
if (!$_SESSION['customers_wholesale'] == 1) {} else {
$this->enabled = ((MODULE_SHIPPING_UPS_STATUS == 'True') ? true : false);
}
}
Mark
Hare Do
This has been working for many years to shut off shipping and payment modules:
There are many ways of manipulating the filter to shut down the module.PHP Code:
// bof Twitch April 7th - if retail customer do not show this shipping option
$this->enabled = ((MODULE_SHIPPING_FLATCLONE_STATUS == 'True') ? true : false);
if($_SESSION['customers_wholesale']=='1' && $this->enabled==true) // a wholesale customer
{
$this->enabled=false; // when true - turn this module off
}else{
$this->enabled=true; // when false - keep this module on
}
// eof Twitch April 7th - if retail customer do not show this shipping option
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.
Great News!!
I've completed the updates to Twitch Wholesale with Wholesale Attributes for Zen Cart 1.53.
I will be compiling the fileset and releasing the complete package on my site and to the Zen Plugins later today.
More good news... Anyone upgrading:
ZC 1.51 + Twitch WS+ATT 13.a - Oct 13.2013
to
ZC 1.53 + Twitch WS +ATT 14.b - August 10.2014
the filters you may be using in other pages/modules will continue to work as long as you copy them to your new ZC 1.53 install in the same locations within the code/file.
This package is designed solely to work with 1.53, if you are using 1.51 use Twitch WS+ATT 13.a - Oct 13.2013 the last complete and stable version for 1.51.
Thanks to all that support myself and my family.
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.
Now available for download at twitchtoo:
NEW - Twitch Wholesale with Wholesale Attributes for Zen Cart 1.53
Once approved the .zip will be available in ZC Plugins for 1.53
Please use the forum if you have any questions, feature requests or bug reports or contact me directly.
Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
Twitch Base7 with Wholesale PRO - 88 preinstalled plugins zero errors.
Hi.
Wonder if someone can help. I'm using Zen 1.5.3 with Sheffield Blue Responsive Template installed.
I've been checking some of the install files using WinMerge to make sure I don't overwrite anything already installed but I'm struggling with the following as there are so many differences:-
Is someone able to assist as to what I need to add to the file to ensure this Plugin works ok?
The /includes/templates/Your_Template/common/tpl_header.php
My current tpl_header.php is as follows:-
PHP Code:
<?php
/**
* Common Template - tpl_header.php
*
* this file can be copied to /templates/your_template_dir/pagename<br />
* example: to override the privacy page<br />
* make a directory /templates/my_template/privacy<br />
* copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br />
* to override the global settings and turn off the footer un-comment the following line:<br />
* <br />
* $flag_disable_header = true;<br />
*
* @package templateSystem
* @copyright Copyright 2003-2006 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: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $
*/
?>
<?php
// Display all header alerts via messageStack:
if ($messageStack->size('header') > 0) {
echo $messageStack->output('header');
}
if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) {
echo htmlspecialchars(urldecode($_GET['error_message']));
}
if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) {
echo htmlspecialchars($_GET['info_message']);
} else {
}
?>
<!--bof-header logo and navigation display-->
<?php
if (!isset($flag_disable_header) || !$flag_disable_header) {
?>
<div id="headerWrapper">
<!--bof-display today date and time-->
<?php
echo date('l jS F Y - h:ia');
?>
<!--eof-display today date and time-->
<!--bof-branding display-->
<div id="logoWrapper">
<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
<div id="taglineWrapper">
<?php
if (HEADER_SALES_TEXT != '') {
?>
<div id="tagline"><?php echo HEADER_SALES_TEXT;?></div></div>
<br class="clearBoth" />
<?php
}
?>
<?php
if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
if ($banner->RecordCount() > 0) {
?>
<div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
}
}
?>
</div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
<ul class="back">
<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a> | </li>
<?php if ($_SESSION['customer_id']) { ?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a> | </li>
<li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a> | </li>
<?php
} else {
if (STORE_STATUS == '0') {
?>
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a> | </li>
<?php } } ?>
<li><img src="<?php echo $template->get_template_dir('',DIR_WS_TEMPLATE, $current_page_base,'images').'/'.HEADER_ICON_CART ?>" alt="cart icon" class="cart-icon" /><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo $_SESSION['cart']->count_contents();?> <?php echo HEADER_TITLE_CART_ITEMS; ?> - <?php echo $currencies->format($_SESSION['cart']->show_total());?></a> | </li>
<li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
<?php }?>
</ul>
<br class="clearBoth" />
</div>
<div id="header-lan-curr">
<?php require(DIR_WS_MODULES . 'sideboxes/languages_header.php'); ?>
<?php require(DIR_WS_MODULES . 'sideboxes/currencies_header.php'); ?>
<div class="clearBoth"></div>
</div>
</div>
<!--eof-navigation display-->
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<!--eof-header logo and navigation display-->
<!--bof-optional categories tabs navigation display-->
<?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?>
<!--eof-optional categories tabs navigation display-->
<!--bof-header ezpage links-->
<?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?>
<?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?>
<?php } ?>
<!--eof-header ezpage links-->
</div>
<br class="clearBoth" />
<!--bof-mega menu display-->
<?php require($template->get_template_dir('tpl_mega_menu.php',DIR_WS_TEMPLATE, $current_page_base,'common'). '/tpl_mega_menu.php');?>
<!--eof-mega menu display-->
<div class="clearBoth"></div>
<div class="clearBoth"></div>
<!--bof handheld menu display-->
<?php require($template->get_template_dir('tpl_modules_mobile_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_mobile_categories_tabs.php'); ?>
<!--eof handheld menu display-->
<div class="clearBoth"></div>
<?php
if ($this_is_home_page) {
?>
<?php
if (RSB_SLIDES_STATUS == 'true') {
?>
<?php require($template->get_template_dir('tpl_home_slider.php',DIR_WS_TEMPLATE, $current_page_base,'common')
. '/tpl_home_slider.php');?>
<?php
} ?>
<?php
} ?>
<?php } ?>
Bookmarks