Results 1 to 10 of 1684

Hybrid View

  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Dynamic Price Updater

    Noting that there is a shopping_cart class method (show_total_before_discounts) to retrieve that value.

  2. #2
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,700
    Plugin Contributions
    11

    Default Re: Dynamic Price Updater

    Quote Originally Posted by lat9 View Post
    Noting that there is a shopping_cart class method (show_total_before_discounts) to retrieve that value.
    any further hint for the code-challenged among us?

    asking for a friend
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Dynamic Price Updater

    Quote Originally Posted by dbltoe View Post
    any further hint for the code-challenged among us?

    asking for a friend
    What's the code on the following line?

    /includes/classes/ajax/zcDPU_Ajax.php on line 177.

  4. #4
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,700
    Plugin Contributions
    11

    Default Re: Dynamic Price Updater

    lines 173-182,

    Code:
          $this->responseText['priceTotal'] .= number_format($this->shoppingCart->total, $decimal_places, $decimal_point, $thousands_point);      $this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);
        } else {
          $this->responseText['priceTotal'] .= $currencies->display_price($this->shoppingCart->total, 0 /* zen_get_tax_rate($product_check->fields['products_tax_class_id']) *//* 0 */ /* DISPLAY_PRICE_WITH_TAX */);
          $this->responseText['preDiscPriceTotal'] = $currencies->display_price($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        }
    
    
        if (!defined('DPU_OUT_OF_STOCK_IMAGE')) {
          define('DPU_OUT_OF_STOCK_IMAGE', '%s');
        }
    All these files are from the development branch of github.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,942
    Plugin Contributions
    96

    Default Re: Dynamic Price Updater

    Quote Originally Posted by dbltoe View Post
    lines 173-182,

    Code:
          $this->responseText['priceTotal'] .= number_format($this->shoppingCart->total, $decimal_places, $decimal_point, $thousands_point);      $this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);
        } else {
          $this->responseText['priceTotal'] .= $currencies->display_price($this->shoppingCart->total, 0 /* zen_get_tax_rate($product_check->fields['products_tax_class_id']) *//* 0 */ /* DISPLAY_PRICE_WITH_TAX */);
          $this->responseText['preDiscPriceTotal'] = $currencies->display_price($this->shoppingCart->total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        }
    
    
        if (!defined('DPU_OUT_OF_STOCK_IMAGE')) {
          define('DPU_OUT_OF_STOCK_IMAGE', '%s');
        }
    All these files are from the development branch of github.
    Change this line

    Code:
    $this->responseText['preDiscPriceTotal'] =  number_format(zen_add_tax($this->shoppingCart->total_before_discounts,  zen_get_tax_rate($product_check->fields['products_tax_class_id'])),  $decimal_places, $decimal_point, $thousands_point);
    to
    Code:
    $this->responseText['preDiscPriceTotal'] =  number_format(zen_add_tax($this->shoppingCart->show_total_before_discounts(),  zen_get_tax_rate($product_check->fields['products_tax_class_id'])),  $decimal_places, $decimal_point, $thousands_point);

  6. #6
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,700
    Plugin Contributions
    11

    Default Re: Dynamic Price Updater

    Perfect!

    Temporary location for updated files at https://github.com/dbltoe/Zen-Cart-D...dater/tree/158

    Those files will NOT work prior to 1.5.8
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  7. #7
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,700
    Plugin Contributions
    11

    Default Re: Dynamic Price Updater

    Spoke a little too soon.

    Still a glitch

    Code:
    [16-Feb-2023 10:50:14 America/New_York] Request URI: /ajax.php?act=DPU_Ajax&method=getDetails, IP address: 216.177.186.199, Language id 1
    #1 zcDPU_Ajax->prepareOutput() called at [/includes/classes/ajax/zcDPU_Ajax.php:88]
    #2 zcDPU_Ajax->getDetails() called at [/ajax.php:85]
    --> PHP Warning: Undefined property: shoppingCart::$show_total_before_discounts in /includes/classes/ajax/zcDPU_Ajax.php on line 176.
    Last edited by dbltoe; 16 Feb 2023 at 04:53 PM.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  8. #8
    Join Date
    Jan 2004
    Location
    N of San Antonio TX
    Posts
    9,700
    Plugin Contributions
    11

    Default Re: Dynamic Price Updater

    Unfortunately, I still get the error when both are "fixed"
    Code:
          $this->responseText['priceTotal'] .= number_format($this->shoppingCart->total, $decimal_places, $decimal_point, $thousands_point);      $this->responseText['preDiscPriceTotal'] = number_format(zen_add_tax($this->shoppingCart->show_total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id'])), $decimal_places, $decimal_point, $thousands_point);
        } else {
          $this->responseText['priceTotal'] .= $currencies->display_price($this->shoppingCart->total, 0 /* zen_get_tax_rate($product_check->fields['products_tax_class_id']) *//* 0 */ /* DISPLAY_PRICE_WITH_TAX */);
          $this->responseText['preDiscPriceTotal'] = $currencies->display_price($this->shoppingCart->show_total_before_discounts, zen_get_tax_rate($product_check->fields['products_tax_class_id']));
        }
    One checker advised to change
    Code:
    protected string $responseType = 'success';
    to
    Code:
    protected $responseType = 'success';
    for php 8 compliance. That had no effect.

    One checker also suggested that the $_post variables are not properly set before being used.
    A little help with colors.
    myZenCartHost.com - Zen Cart Certified, PCI Compatible Hosting by JEANDRET
    Free SSL & Domain with semi-annual and longer hosting. Updating 1.5.2 and Up.

  9. #9
    Join Date
    Dec 2006
    Location
    near Atlanta Georgia
    Posts
    216
    Plugin Contributions
    0

    Default Re: Dynamic Price Updater

    Okay, just missed this one I guess. Will install v5 and report back soon. Thanks dbltoe!

    Quote Originally Posted by dbltoe View Post
    Perfect!

    Temporary location for updated files at https://github.com/dbltoe/Zen-Cart-D...dater/tree/158

    Those files will NOT work prior to 1.5.8
    Best,
    Goldbuckle

 

 

Similar Threads

  1. v151 Help with dynamic price updater
    By anderson6230 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 23 Jul 2014, 08:52 AM
  2. v139h Dynamic Price Updater 3.0 Help!
    By Newbie 2011 in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 12 Mar 2014, 06:46 AM
  3. Dynamic Price Updater Error
    By Inxie in forum All Other Contributions/Addons
    Replies: 4
    Last Post: 26 Oct 2012, 06:19 PM
  4. Alternative to Dynamic Price Updater?
    By thebigkick in forum General Questions
    Replies: 0
    Last Post: 9 Jul 2012, 11:41 PM
  5. Dynamic Price Updater with href
    By maxell6230 in forum All Other Contributions/Addons
    Replies: 1
    Last Post: 1 Mar 2012, 12:34 AM

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