Re: DUAL Pricing version 2
Hello,
I am using zen cart 1.39H and also have installed the 'dual pricing' module. It works great, wholesale customers get 10%.
The issue though is that the client offers 10% off and free shipping if someone orders 12 bottles.
Well they dont' want the wholesale customers to receive free shipping if they are a wholesale customer. The additional 10% discount is fine though. Iave looked and can't find a similar issue posted on the forum.
Any help to get this figured out would be appreciated
thanks
Re: DUAL Pricing version 2
Hello to all,
I installed Dual Pricing - Wholesale Pricing veriosne 2.1.
In the description of the module is specified in the "Tax no longer applied to wholesale customers (level 1 and up)"
In my site does not.
The prices are wholesaler viaulizzato with taxes.
How can I fix the problem?
Re: DUAL Pricing version 2
BUG REPORT: V2.1
The file /YOUR_ADMIN/includes/modules/product/preview_info.php has an error in line#21
It refers to a none existant field "p.product_price_w" it should be "p.products_price_w". (missing the 's' from 'product').
This is causing a fatal PHP error when clicking on the LHS icon in the products editing area. When this icon is clicked it produces an almost blank screen with the following warning:
WARNING: An Error occurred, please refresh the page and try again.
Cheers
Rod
Re: DUAL Pricing version 2
Using Dual Pricing v1.2 on a Zen Cart v1.5.1 store. When viewing (in admin) a category that has a SaleMaker sale applied to the entire category and no wholesale price assigned, the price for each product in that category displays the sale price as $0.00:
Code:
$70.00
Sale: $0.00 / 0
The price does display properly on the storefront. I'll post back once I've got a solution ...
Re: DUAL Pricing version 2
Quote:
Originally Posted by
lat9
Using Dual Pricing v1.2 on a Zen Cart v1.5.1 store. When viewing (in admin) a category that has a SaleMaker sale applied to the entire category and no wholesale price assigned, the price for each product in that category displays the sale price as $0.00:
Code:
$70.00
Sale: $0.00 / 0
The price does display properly on the storefront. I'll post back once I've got a solution ...
I'm thinking that this was caused by an over-zealous change to /admin/includes/functions/functions_prices.php. Simply commenting out the change to the zen_get_products_special_price function appears to correct the display problem:
Code:
//get specials price or sale price
function zen_get_products_special_price($product_id, $specials_price_only=false) {
global $db;
$product = $db->Execute("select products_price, products_model, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id = '" . (int)$product_id . "'");
if ($product->RecordCount() > 0) {
// $product_price = $product->fields['products_price'];
$product_price = zen_get_products_base_price($product_id);
} else {
return false;
}
/*-bof-20131201-lat9-Removed so that sale price can be shown in admin
//Dual Pricing start
if ($product->RecordCount() > 0) {
// $product_price = $product->fields['products_price'];
$product_price = zen_get_products_base_price_w($product_id);
} else {
return false;
}
//Dual Pricing end
-eof-20131201-lat9 */
Re: DUAL Pricing version 2
I'm working on a store that wants to provide the full 4-levels of wholesale pricing, but chooses not to enable wholesale prices for some levels for some products. For example, I've got a test customer that is at pricing level 2 and I've entered 80.00-0.00-70.00-60.00 for the wholesale price for one of the products.
My expectation was that when the wholesale customer logged in that they would not be shown a wholesale price for that product. Instead, they received the $80.00 wholesale price. Is that a bug or working-as-designed?
Re: DUAL Pricing version 2
@lat9, please read post #1210 & #1211 ...
Re: DUAL Pricing version 2
Quote:
Originally Posted by
haredo
@lat9, please read post #1210 & #1211 ...
The changes that I made to correct this behavior were threefold (all in /includes/functions/functions_prices.php).
Code:
////
// computes products_price + option groups lowest attributes price of each group when on
//Dual Pricing
function zen_get_products_base_price($products_id) {
global $db;
$product_check = $db->Execute("select products_price, products_price_w, products_priced_by_attribute from " . TABLE_PRODUCTS . " where products_id = '" . (int)$products_id . "'");
// is there a products_price to add to attributes
//Dual Pricing start
if (isset($_SESSION['customer_whole']) && $_SESSION['customer_whole'] != '0') {
$i = (int)$_SESSION['customer_whole'];
$i--;
$products_price_array = $product_check->fields['products_price_w'];
$productsprice = explode("-",$products_price_array);
$products_price = (float)$productsprice[$i];
/*-bof-20131201-lat9-removed to allow products to be wholesale for some, but not all, wholesale groups
if ($products_price == '0' || $products_price == '') {
$products_price = (float)$productsprice[0];
}
-eof-20131201-lat9 */
if ($products_price=='0'){
$products_price = $product_check->fields['products_price'];
}
} else {
$products_price = $product_check->fields['products_price'];
}
// do not select display only attributes and attributes_price_base_included is true
$product_att_query = $db->Execute("select options_id, price_prefix, options_values_price, options_values_price_w, attributes_display_only, attributes_price_base_included, round(concat(price_prefix, options_values_price), 5) as value from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id = '" . (int)$products_id . "' and attributes_display_only != '1' and attributes_price_base_included='1'". " order by options_id, value");
//Dual Pricing end
$the_options_id= 'x';
$the_base_price= 0;
// add attributes price to price
if ($product_check->fields['products_priced_by_attribute'] == '1' and $product_att_query->RecordCount() >= 1) {
while (!$product_att_query->EOF) {
if ( $the_options_id != $product_att_query->fields['options_id']) {
$the_options_id = $product_att_query->fields['options_id'];
//Dual Pricing start
if (isset($_SESSION['customer_whole']) && $_SESSION['customer_whole'] != '0') {
$i = (int)$_SESSION['customer_whole'];
$i--;
$option_price_array = $product_att_query->fields['options_values_price_w'];
$optionprice = explode(",",$option_price_array);
$options_values_price = (float)$optionprice[$i];
/*-bof-20131201-lat9-Removed so that attributes can be wholesale-priced for some, but not all, wholesale groups
if ($options_values_price=='0' || $options_values_price==''){
$options_values_price = (float)$optionprice[0];
}
-eof-20131201-lat9 */
$the_base_price += $options_values_price;
if ($options_values_price=='0'){
$the_base_price += (($product_att_query->fields['price_prefix'] == '-') ? -1 : 1) * $product_att_query->fields['options_values_price'];
}
} else {
$the_base_price += (($product_att_query->fields['price_prefix'] == '-') ? -1 : 1) * $product_att_query->fields['options_values_price'];
}
}
//Dual Pricing end
$product_att_query->MoveNext();
}
$the_base_price = $products_price + $the_base_price;
} else {
$the_base_price = $products_price;
}
return $the_base_price;
}
and
Code:
////
// attributes final price
function zen_get_attributes_price_final($attribute, $qty = 1, $pre_selected, $include_onetime = 'false') {
global $db;
global $cart;
$attributes_price_final = 0;
if ($pre_selected == '' or $attribute != $pre_selected->fields["products_attributes_id"]) {
$pre_selected = $db->Execute("select pa.* from " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_attributes_id= '" . (int)$attribute . "'");
} else {
// use existing select
}
//Dual Pricing start
if (isset($_SESSION['customer_whole']) && $_SESSION['customer_whole'] != '0') {
$i = (int)$_SESSION['customer_whole'];
$i--;
$option_price_array = $pre_selected->fields['options_values_price_w'];
$optionprice = explode(",",$option_price_array);
$options_values_price = (float)$optionprice[$i];
/*-bof-20131201-lat9-Allow attributes to be wholesale-priced for some, but not all, wholesale groups
if ($options_values_price=='0' || $options_values_price==''){
$options_values_price = (float)$optionprice[0];
}
-eof-20131201-lat9 */
$the_base_price += $options_values_price;
if ($options_values_price=='0'){
$options_values_price = $pre_selected->fields['options_values_price'];
}
} else {
$options_values_price = $pre_selected->fields['options_values_price'];
}
//Dual Pricing end
if ($pre_selected->fields["price_prefix"] == '-') {
//Dual Pricing
$attributes_price_final -= $options_values_price;
} else {
//Dual Pricing
$attributes_price_final += $options_values_price;
}
// qty discounts
$attributes_price_final += zen_get_attributes_qty_prices_onetime($pre_selected->fields["attributes_qty_prices"], $qty);
// price factor
$display_normal_price = zen_get_products_actual_price($pre_selected->fields["products_id"]);
$display_special_price = zen_get_products_special_price($pre_selected->fields["products_id"]);
$attributes_price_final += zen_get_attributes_price_factor($display_normal_price, $display_special_price, $pre_selected->fields["attributes_price_factor"], $pre_selected->fields["attributes_price_factor_offset"]);
// per word and letter charges
if (zen_get_attributes_type($attribute) == PRODUCTS_OPTIONS_TYPE_TEXT) {
// calc per word or per letter
}
// onetime charges
if ($include_onetime == 'true') {
$pre_selected_onetime = $pre_selected;
$attributes_price_final += zen_get_attributes_price_final_onetime($pre_selected->fields["products_attributes_id"], 1, $pre_selected_onetime);
}
return $attributes_price_final;
}
Re: DUAL Pricing version 2
Would you be so kind and post the entire /includes/functions/functions_prices.php file for me ...
1 Attachment(s)
Re: DUAL Pricing version 2
haredo, here's a zipped version; the file's too big to fit in a code wrapper!
Attachment 13449