Zen Cart Logo

DUAL Pricing v2

Views: 363,344

Results 1,221 to 1,240 of 1,504
30 Sep 2013, 8:15 PM
#1221
cvandijk avatar

cvandijk

New Zenner

Join Date:
May 2013
Location:
Fairfield, ia
Posts:
13
Plugin Contributions:
0

DUAL Pricing v2

How do I uninstall this plugin? I used the script, but when I did, it caused some problems.

1 Oct 2013, 9:57 PM
#1222
timhersh avatar

timhersh

Zen Follower

Join Date:
Aug 2008
Posts:
274
Plugin Contributions:
0

Re: DUAL Pricing v2

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

27 Nov 2013, 3:22 PM
#1223
abaco avatar

abaco

New Zenner

Join Date:
Nov 2010
Posts:
21
Plugin Contributions:
0

Re: DUAL Pricing v2

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?

1 Dec 2013, 6:22 AM
#1224
rodg avatar

rodg

Deceased

Join Date:
Jan 2007
Location:
Australia
Posts:
6,263
Plugin Contributions:
4

Re: DUAL Pricing v2

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

1 Dec 2013, 1:21 PM
#1225
lat9 avatar

lat9

Administrator

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

Re: DUAL Pricing v2

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:

$70.00
Sale: $0.00 /  0 	

The price does display properly on the storefront. I'll post back once I've got a solution ...

1 Dec 2013, 1:55 PM
#1226
lat9 avatar

lat9

Administrator

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

Re: DUAL Pricing v2

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:

$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:

//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 */

1 Dec 2013, 5:54 PM
#1227
lat9 avatar

lat9

Administrator

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

Re: DUAL Pricing v2

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?

2 Dec 2013, 2:20 PM
#1228
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: DUAL Pricing v2

@lat9, please read post #1210 & #1211 ...

2 Dec 2013, 2:39 PM
#1229
lat9 avatar

lat9

Administrator

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

Re: DUAL Pricing v2

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).

////
// 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

////
// 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;
  }
2 Dec 2013, 11:00 PM
#1230
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: DUAL Pricing v2

Would you be so kind and post the entire /includes/functions/functions_prices.php file for me ...

3 Dec 2013, 1:03 PM
#1231
lat9 avatar

lat9

Administrator

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

Re: DUAL Pricing v2

haredo, here's a zipped version; the file's too big to fit in a code wrapper!
Attachment 13449

3 Dec 2013, 1:36 PM
#1232
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: DUAL Pricing v2

Ty for the zip file ...
I have installed dual pricing 2.1 on a fresh install zencart v1.5.1 on a wamp server ...
Only this Plugin is installed ..
The module works perfect without adding attributes ..
But when adding a product priced by attribute, the module reverts back to the first wholesale level and not level 1, 2, or 3 will show ...
By changing the functions_prices.php, The prices beside the attributes are deleted ...
Grrrrrrr ....

3 Dec 2013, 1:49 PM
#1233
lat9 avatar

lat9

Administrator

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

Re: DUAL Pricing v2

Sorry, I haven't validated the attribute-related paths ... the base price path has been checked out and deployed.

3 Dec 2013, 1:56 PM
#1234
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: DUAL Pricing v2

Thats fine, well if you ever get a spare moment in your busy, hectic day ...

7 Dec 2013, 6:58 PM
#1235
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: DUAL Pricing v2

haredo:

Ty for the zip file ...
I have installed dual pricing 2.1 on a fresh install zencart v1.5.1 on a wamp server ...
Only this Plugin is installed ..
The module works perfect without adding attributes ..
But when adding a product priced by attribute, the module reverts back to the first wholesale level and not level 1, 2, or 3 will show ...
By changing the functions_prices.php, The prices beside the attributes are deleted ...
Grrrrrrr ....

Twitch Wholesale with Attributes works properly with attributes for wholesale/retail http://www.zen-cart.com/downloads.php?do=file&id=1771

Screenshots are included so you can see how it integrates.

7 Dec 2013, 7:45 PM
#1236
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: DUAL Pricing v2

Twitchtoo,
Ty for the update, I noticed 5 days ago your thread on this module ...
Already loaded and works like a charm ...
Any chance you will make a total of 3 to 4 filter levels like the Dual Pricing?

7 Dec 2013, 8:44 PM
#1237
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: DUAL Pricing v2

The Twitch Wholesale filter isn't bound to 0 or 1. So really it's already built to use multiple levels :)

However, practically I'd rather integrate it with the Group Pricing Module because it has it's own benefits.

7 Dec 2013, 9:15 PM
#1238
haredo avatar

haredo

Totally Zenned

Join Date:
Apr 2006
Location:
Texas
Posts:
6,176
Plugin Contributions:
0

Re: DUAL Pricing v2

Twitchtoo,
admin panel/ customers/customer/ wholesale customer

  1. Retail Customers = 0 (Default) | Wholesale Customers = 1 (Twitch Wholesale Switch).
  2. attribute controller editing a product with attributes
  3. 5.00
  4. Here i only get one level on the Wholesale Side ..

Dual Pricing
admin panel/ customers/ customer/ wholesale customer

  1. 0= Default Level 1, 2, 3 4
  2. Attribute controller editing a product with attributes
  3. 5.00, 4.00, 3.00, 2.00
  4. If I set a customer to level 3 I will see $3.00 for the attribute when logged in ...
11 Dec 2013, 4:22 AM
#1239
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Re: DUAL Pricing v2

Haredo, You are correct. I have no plans to incorporate the code Dual Pricing uses to add dash separated data into one field.

Although it works, I have managed a site for over 6 years that's had a lot of complications as a result of the necessity of extracting the data from that array.

That's one of the reasons I developed Twitch Wholesale.

The same results can be achieved without the Dual Pricing array loop with Twitch Wholesale...

  • Adding additional numbers to the filter essentially produces separate 'groups'.
  • Using additional numbers in the code in a variety of places will also create 'groups'.
  • Adding 1 or 10 more 'wholesale price' field(s) on the product page then simply pointing the code at the new field based on the wholesale_customer value is straight forward and would easily ensure success with additional wholesale attributes prices.
  • Exporting the database would only require a field name not an array extraction loop.

As well, I am about to release a wholesale pricing integration package for each of the default ZenCart pricing modules. So far SaleMaker, Specials, Discount Coupons, Group Pricing and Taxes are all working with little or no changes.

Testing starts tonight with wholesale attributes...

11 Dec 2013, 10:21 PM
#1240
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: DUAL Pricing v2

Perhaps at this point it makes sense to move "Twitch Wholesale" discussions over to the "Twitch Wholesale" support thread rather than hijack this one..