Totally Zenned
- Join Date:
- Oct 2005
- Location:
- Chicago, IL USA
- Posts:
- 1,592
- Plugin Contributions:
- 0
Views: 363,307
Totally Zenned
New Zenner
Hi All,
Great add-on.
Dual Pricing not showing correct wholesale price for products priced by attribute
I am running ZC 1.5.4 + Qty discount 1,1,2 and dual pricing 2.1.5 from github - Normal items ie not priced by attributes are working great.
Now Level 2 user
The code i believe in the plug-in for /included/classes/shopping_cart is the is the problem.
There are multiple instances of the below code and I believe it is the fault:
ifif ($_SESSION['customer_id']) {
$customers_id = $_SESSION['customer_id'];
$customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
if ($customer_check->fields['customers_whole'] != "0") {
$i = $customer_check->fields['customers_whole'];
$i--;
$options_value_price = (float)$attribute_price->fields['options_values_price_w'];
The value ```
$options_value_price = (float)$attribute_price->fields['options_values_price_w'];
Is all wrong as ```
$attribute_price->fields['options_values_price_w'
contains the attributes wholesale field ie xx.00,yy.00 as a string and floating it just screws it up and returns the first float value xx.00
So how to do it?
I have tried
if ($_SESSION['customer_id']) {
$customers_id = $_SESSION['customer_id'];
$customer_check = $db->Execute("select * from " . TABLE_CUSTOMERS . " where customers_id = '$customers_id'");
if ($customer_check->fields['customers_whole'] != "0") {
$i = (int)$customer_check->fields['customers_whole']; //Grab the Wholesale level as integer
$i--; //Decrement it as arrays start with [0]
// $options_value_price = (float)$attribute_price->fields['options_values_price_w']; // Comment out the old line
$brm_options_array = explode(",",$attribute_price->fields['options_values_price_w']); //explode the xx.00,yy.00,zz.00 string into an array
$options_value_price = (float)$brm_options_array[$i]; // pull the appropriate discount price for the wholesale level out - var_dump($options_value_price ) returns the correct attribute wholesale level
Problem is - it is still not working.
As I mentioned in shopping_cart.php there are about 3 instances of this code and I have tried all 3 - Just don't get how this works.
Or more importantly passes it to the html.
Any assistance would be appreciated.
Thanks in advance
Totally Zenned
@Whiterabbizt
Thank you for reporting this. I have confirmed the bug is in previous versions of this plugin as well. It's been added to the to-do list to fix.
New Zenner
Thank you for a wonderful module. I have read through all the topics here, and have used several threads to fix my issues (misconfigure, etc).
What I didn't pick up on is there a way to make a special wholesale group taxable?
I saw the Canadian solution to his multi tax issue, but I don't quite get how to limit it to a single group while leaving other groups untaxed.
If this was asked already, I am sorry. After alot of reading--on several topics, things have gotten blurred.
Thank you in advance to anyone able/willing to help.
Totally Zenned
trignet:
Thank you for a wonderful module. I have read through all the topics here, and have used several threads to fix my issues (misconfigure, etc).
What I didn't pick up on is there a way to make a special wholesale group taxable?
I saw the Canadian solution to his multi tax issue, but I don't quite get how to limit it to a single group while leaving other groups untaxed.
If this was asked already, I am sorry. After alot of reading--on several topics, things have gotten blurred.
Thank you in advance to anyone able/willing to help.
Remember that Dual Pricing runs a loop to compare the logged in customer with a list of group id's then looks up the prices and returns the value associated with the logged in group. You will need to add a filter to all of the codes that are attempting to apply tax to that returned value to again ask 'who are you/what group do you belong to?' and 'should I be applying tax to the returned value if you belong to a group that matches the no tax group list.
If you are referring to Twitch Wholesale, it already has filters to shelter wholesale groups from taxes, they just need to be turned on in the code.
Note: Twitch Wholesale and Dual Pricing should not be installed together.
New Zenner
Hi everyone, I have a very simple question: how to make price=0 works?
I have v1.5.4 fresh installed and the Dual-Pricing-2.1.5-master for 1.5.4.
For the product I set up 4 prices 10.00-20.00-0.00-50.00. For the customer I made level 3.
Result: price that shows up is 10.00
If I put 10.00-20.00-0.01-50.00, price turns to 0.01
Can anyone help me on how to make a product free for a level?
Totally Zenned
I've confirmed this is a bug in this and previous versions. It will be fixed in a future release.
New Zenner
Thank You twitchtoo for pointing me in the right direction, I will dig deeper.
I installed the DualPricing 2.1.5-master file bundle.
Would 1 serve me better than the other can you recommend in this scenario?
In the meantime, I have discovered something else--not sure if its by design, or perhaps a bug.
After applying upcharge attributes to items--both in Price and in wholesale. I am only using 1 wholesale group currently, so just inputting 1 number in wholesale.
I then copy attributes to another similar item. I get the normal price to carryover, but the wholesale resets to 0 on the new item :(
Any thoughts or guidance?
Totally Zenned
trignet:
Thank You twitchtoo for pointing me in the right direction, I will dig deeper.
In the meantime, I have discovered something else--not sure if its by design, or perhaps a bug.
After applying upcharge attributes to items--both in Price and in wholesale. I am only using 1 wholesale group currently, so just inputting 1 number in wholesale.
I then copy attributes to another similar item. I get the normal price to carryover, but the wholesale resets to 0 on the new item :(
Any thoughts or guidance?
Which button or method are you using to 'copy' the products/attributes?
There needs to be a code in each of the control files that perform these 'actions'. If the code is missing the data will not be carried over.
Totally Zenned
trignet:
After applying upcharge attributes to items--both in Price and in wholesale. I am only using 1 wholesale group currently, so just inputting 1 number in wholesale.
I then copy attributes to another similar item. I get the normal price to carryover, but the wholesale resets to 0 on the new item :(
Any thoughts or guidance?
The copy attributes function will not copy the Dual Pricing settings. It does not know these fields exist. It's not really a bug, but a function never built in.
New Zenner
place check here for fix the bugs: https://github.com/jeking928/Dual-Pricing-2.1.5/issues/1
Totally Zenned
Mr. Guo,
I will test out on a fresh install the new code ...
Thanks ...
Totally Zenned
jing.guo:
place check here for fix the bugs: https://github.com/jeking928/Dual-Pricing-2.1.5/issues/1
Thank you for the input. I've tested this and the fix does solve the problem. It will be incorporated into the next release.
Totally Zenned
Mr. Guo and Mr. Jeking,
Grrrrrrr ....
I have tested this code to a brand new install of 1.5.4 with No OTHER Modules installed ...
It Displays correctly but FAILS when you add the Attribute Value to the Shopping Cart ...
Further CODE is Needed to the Shopping Cart because it shows the incorrect Value and all the Way thur the Checkout Procedure ...
Totally Zenned
haredo:
Mr. Guo and Mr. Jeking,
Grrrrrrr ....
I have tested this code to a brand new install of 1.5.4 with No OTHER Modules installed ...
It Displays correctly but FAILS when you add the Attribute Value to the Shopping Cart ...
Further CODE is Needed to the Shopping Cart because it shows the incorrect Value and all the Way thur the Checkout Procedure ...
That is correct. The wholesale attribute level pricing still does not work beyond the first level. It's on the to-do list. Not to be confused with the wholesale product price levels, which do.
New Zenner
Can anyone tell me how I could change the login/register page to show an option for wholesale customers to register?
Totally Zenned
Zappa Aviaries:
Can anyone tell me how I could change the login/register page to show an option for wholesale customers to register?
Not needed or possible. All customers log in the same way. You decide if they are wholesale or not by setting the 'Wholesale pricing level' in the admin.
New Zenner
Is there a way to configure free shipping to a certain wholesale level only? I want to set the lowest wholesale price for the pet stores we deliver to ourselves, but charge shipping to other customers.
Totally Zenned
Zappa Aviaries:
Is there a way to configure free shipping to a certain wholesale level only? I want to set the lowest wholesale price for the pet stores we deliver to ourselves, but charge shipping to other customers.
This could be done with a customization to the Free Shipping module to look for a specific wholesale pricing level, but would not be a function of this plugin.
Totally Zenned
Zappa Aviaries:
Can anyone tell me how I could change the login/register page to show an option for wholesale customers to register?
You could add a simple checkbox to the login page that records the 'wholesale request' and any other form data you want to add to the database. Would require minimal coding on the login page and a couple new fields in the db.
Fields marked required must be completed.
Tell staff why this post should be reviewed.