Thread: DUAL Pricing v2

Page 93 of 151 FirstFirst ... 43839192939495103143 ... LastLast
Results 921 to 930 of 1503
  1. #921
    Join Date
    Oct 2004
    Posts
    1,045
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    Huh found it, don't know how I missed that, but thanks, it worked great!
    Danielle

  2. #922
    Join Date
    Apr 2007
    Location
    Ontario, Canada
    Posts
    1,731
    Plugin Contributions
    27

    Default Re: The Answer to is DUAL Pricing v2 compatible with Zen Cart v1.5..

    Quote Originally Posted by Danielle View Post
    The issue with the attribute pricing not being carried into the shopping cart has never been solved, correct? Does anyone who has worked on this mod have any thoughts on how to fix it? I'm happy to give it a shot, just wondering if anyone has tried yet and can provide a bit of direction :) If I figure it out, I'll post the fix!

    Thanks!
    Check out my posts, it has been fixed for 139h.

    Twitch.

  3. #923
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: The Answer to is DUAL Pricing v2 compatible with Zen Cart v1.5..

    Quote Originally Posted by twitchtoo View Post
    Check out my posts, it has been fixed for 139h.

    Twitch.
    Those are the posts I directed her to...
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  4. #924
    Join Date
    Feb 2010
    Posts
    38
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    I was wondering if anyone succeeded in displaying the prices without taxes for wholesale price. Standard pricing is with taxes. Since the last question about this is back to 2006 (post item #13), things could be changed. I've read that it's possible in this thread, but not how it should be done.

    gr.

  5. #925
    Join Date
    Nov 2011
    Posts
    59
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    Quote Originally Posted by roekoe View Post
    I was wondering if anyone succeeded in displaying the prices without taxes for wholesale price. Standard pricing is with taxes. Since the last question about this is back to 2006 (post item #13), things could be changed. I've read that it's possible in this thread, but not how it should be done.

    gr.
    I have one question for you...do you apply tax to all order or just tax to people ordering in certain states?

    the reason I ask is because I have this add-on installed also and I charge tax in only one state. I have not taken the time to go into the code and stop charging tax to 'dealers' in my own state but this should not be difficult to do. If you do the same as I then I'll be happy to share my code with you once I'm done. It shouldnt take more more than 30 or 45 minutes to figure it out and test it. I'm running 1.39h

    lemme know

  6. #926
    Join Date
    Feb 2010
    Posts
    38
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    Quote Originally Posted by jjj0923 View Post
    I have one question for you...do you apply tax to all order or just tax to people ordering in certain states?

    the reason I ask is because I have this add-on installed also and I charge tax in only one state. I have not taken the time to go into the code and stop charging tax to 'dealers' in my own state but this should not be difficult to do. If you do the same as I then I'll be happy to share my code with you once I'm done. It shouldnt take more more than 30 or 45 minutes to figure it out and test it. I'm running 1.39h

    lemme know
    Hi,

    The tax is applied to all customers, because we have no states in my country. My country is as big as the smallest state of your country i guess .
    I've seen a module in this topic that allows multiple tax rates voor "special" customers; Customer Tax Exempt post item #290

    I'm testing with version 1.5, currently using 1.3.8 for production

  7. #927
    Join Date
    Nov 2011
    Posts
    59
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    ok - well I just wrote the code and tested it.

    not too difficult

    one module needs to be modified:

    /includes/classes/order.php

    I made three changes to this module. I have not looked at 1.5 but I suspect the code is very similar

    You can take a look in your code and see how similar they are.

    1) code needs to be added to read the customers_whole field from the customers table so that you can check to see if this is a wholesaler/dealer (and skip the sales tax calculation)

    that''s easy.

    find this code:

    PHP Code:
    $customer_address_query "select c.customers_firstname, c.customers_lastname, c.customers_telephone, 
    and replace it with:

    PHP Code:
    $customer_address_query "select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_whole, 

    then find:

    PHP Code:
          // find product's tax rate and description
          
    $products_tax $this->products[$index]['tax'];
          
    $products_tax_description $this->products[$index]['tax_description']; 
    and insert this code after it (please bear in the mind that this code may be superfluous since we'll be avoiding the sales tax calculations altogether next, but I like to be safe)

    PHP Code:
         if ($customer_address->fields['customers_whole'] > 0)
          { 
    $products_tax 0;
            
    $this->products[$index]['tax'] = 0;
            
    $tax_add 0;
            
    $this->products[$index]['tax_description'] = '';
          } 

    then finally there a chunk of code RIGHT BELOW what we just added that does all the sales tax calculation.

    what I found in the standard 1.39 module is shown below:


    PHP Code:
          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;
            }
          } 

    I added an if statement to wrap this code and only execute it if the customers is a non wholesaler/dealer

    my code is shown below:
    PHP Code:
    // jjj added
     
    if ($customer_address->fields['customers_whole'] == 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;
            }
          }
    // jjj added
          



    GOOD LUCK!
    Last edited by jjj0923; 26 Feb 2012 at 05:10 PM.

  8. #928
    Join Date
    Nov 2011
    Posts
    59
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    by the way - just for the heck of it - I looked at the 1.5 code and the loop code you'd put the if statement around is this in that 1.5 module. the module has changed somewhat from 1.39h

    PHP Code:
          $totalTaxAdd 0;
          foreach (
    $taxRates as $taxDescription=>$taxRate)
          {
            
    $taxAdd 0;
            if (
    $taxDescription == $products_tax_description)
            {
              if (
    DISPLAY_PRICE_WITH_TAX == 'true')
              {
                
    $taxAdd zen_round($shown_price / (100 $this->products[$index]['tax']) * $this->products[$index]['tax'], $decimals);
              } else
              {
                  
    $taxAdd zen_calculate_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
                          +  
    zen_round(zen_calculate_tax($this->products[$index]['onetime_charges'], $this->products[$index]['tax']), $decimals);
              }
              if (isset(
    $this->info['tax_groups'][$taxDescription]))
              {
                
    $this->info['tax_groups'][$taxDescription] += $taxAdd;
              } else
              {
                
    $this->info['tax_groups'][$taxDescription] = $taxAdd;
              }
            }
            
    $totalTaxAdd += $taxAdd;
          }
          
    $this->info['tax'] += $totalTaxAdd

  9. #929
    Join Date
    Feb 2010
    Posts
    38
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    I noticed the difference indeed. Trying to get it working right now...

  10. #930
    Join Date
    Feb 2010
    Posts
    38
    Plugin Contributions
    0

    Default Re: DUAL Pricing v2

    Quote Originally Posted by roekoe View Post
    I noticed the difference indeed. Trying to get it working right now...
    EDIT: First of all many thanks for your help, i really appreciate it.

    I think i managed it, althoug there's an error with the TAX calculation. I've made a testorder with customer whole sale customer.

    1. Login as a whole sale customer
    2. Prices still shown including taxes
    3. Added 10 products of $2.98 = $29.80
    4. Added 10 products of $3.57 = $35.70
    5. Shopping card displays amount of $65.45. This is wrong should be $65.50
    6. Go to checkout (Step 1)in store, shipping cost are added
    6. Continue checkout; Sub-total is displayed (Step 2): $ 65.50 which is correct
    7. Shopping card sidebox still displays wrong amount
    8. Last step, the amount is still correct
    9. Order confirmed

    So, I think there is an error with TAX calculation. Although this line shoud be ok: $tax_add = ($products_tax/100) * $shown_price;

    EDIT 2: Logging in as a "normal" customer the prices are displayed are correctly
    Last edited by roekoe; 26 Feb 2012 at 07:47 PM.

 

 

Similar Threads

  1. Dual Pricing - Wholesale Pricing - Some issues I was able to fix
    By hollettster in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 17 Dec 2010, 12:00 AM
  2. Dual Pricing - Wholesale Pricing for Zen 1.3.7 works with Easypopulate
    By micheloo in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 4
    Last Post: 20 Jan 2010, 06:01 PM
  3. No Attributes after installing Dual Pricing - Wholsale Pricing
    By drybsmt in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 10 Sep 2009, 11:09 AM
  4. Quantity Discounts and Dual Pricing - Wholesale Pricing
    By snarkys in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 1
    Last Post: 2 Jul 2007, 06:47 PM
  5. Dual Pricing Module & Dual Tax Classes
    By WILL in forum All Other Contributions/Addons
    Replies: 2
    Last Post: 25 May 2007, 10:44 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR