Jump to content

Recommended Posts

Hola !

 

Antes que nada, agradecer a la comunidad su soporte. Sois una maravilla ;)

 

He notado en mi PS que el proceso de compra se ha hecho eterno. Me he ido al "error_log" y he podido constatar que hay un warning que se repite sin cesar:

[31-Mar-2021 12:10:58 Europe/Madrid] PHP Warning:  Declaration of Cart::getProducts($refresh = false, $id_product = false, $id_country = NULL) should be compatible with CartCore::getProducts($refresh = false, $id_product = false, $id_country = NULL, $fullInfos = true) in /home2/xxxx/public_html/xxxxx.com/override/classes/Cart.php on line 72

 

Cuando voy a dicho archivo, obtengo esto:

 

<?php
/**
* 2007-2015 PrestaShop
*
* NOTICE OF LICENSE
*
* @author    Innova Deluxe SL
* @copyright 2016 Innova Deluxe SL
* @license   INNOVADELUXE
*/
class Cart extends CartCore
{
    /*
    * module: idxrecargoe
    * date: 2020-06-08 09:59:31
    * version: 2.4.6
    */
    public function getOrderTotal($with_taxes = true, $type = Cart::BOTH, $products = null, $id_carrier = null, $use_cache = true)
    {
        if ((bool)Module::isEnabled("idxrecargoe") == true) {
            require_once(_PS_ROOT_DIR_.'/modules/idxrecargoe/classes/RecargoDeEquivalenciaDlx.php');
            $recargoEquivalencia = new RecargoDeEquivalenciaDlx();
            
            if (!$recargoEquivalencia->hasCustomerSurcharge($this->id_customer, true)) {
                return parent::getOrderTotal($with_taxes, $type, $products, $id_carrier, $use_cache);
            }
            
            $order_total = parent::getOrderTotal($with_taxes, $type, $products, $id_carrier, $use_cache);
            if ($type == Cart::BOTH) {
                $equivalenceSurcharge = $recargoEquivalencia->getEquivalenceSurchargeApplied($this, 3, false, false, false, null);
                $shippingEquivalenceSurcharge = $recargoEquivalencia->getEquivalenceSurchargeApplied($this, 3, false, true, false, null);
                $order_total += $equivalenceSurcharge + $shippingEquivalenceSurcharge;
                return Tools::ps_round((float)$order_total, 6);
            } else {
                return parent::getOrderTotal($with_taxes, $type, $products, $id_carrier, $use_cache);
            }
        } else {
            return parent::getOrderTotal($with_taxes, $type, $products, $id_carrier, $use_cache);
        }
    }
    
        
    /*
    * module: idxrecargoe
    * date: 2020-06-08 09:59:31
    * version: 2.4.6
    */
    public function getProducts($refresh = false, $id_product = false, $id_country = null)
    {
        if ((bool)Module::isEnabled("idxrecargoe") == true) {
            require_once(_PS_ROOT_DIR_.'/modules/idxrecargoe/classes/RecargoDeEquivalenciaDlx.php');
            $recargoEquivalencia = new RecargoDeEquivalenciaDlx();
            
            if (!$recargoEquivalencia->hasCustomerSurcharge($this->id_customer, true)) {
                return parent::getProducts($refresh, $id_product, $id_country);
            }
            
            $products = parent::getProducts($refresh, $id_product, $id_country);
            foreach ($products as &$product) {
                $equivalenceSurchargeRate = $recargoEquivalencia->getSurchargeRateByTaxName(
                    $product['tax_name'],
                    $this->id_lang
                );
                
                $product['price_wt'] +=  $product['price'] * ($equivalenceSurchargeRate /100);
            }
            return $products;
        } else {
            return parent::getProducts($refresh, $id_product, $id_country);
        }
    }
}

También me aparece este otro mensaje:

[31-Mar-2021 10:20:22 Europe/Madrid] PHP Warning:  escapeshellcmd() has been disabled for security reasons in /home2/xxxx/public_html/xxxxxx.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/MailTransport.php on line 259

Y este otro, que no se si tendrá que ver con el anterior:

[30-Mar-2021 22:18:52 Europe/Madrid] PHP Notice:  Undefined index: tax_rate in /home2/xxxxx/public_html/xxxxxxx.com/modules/idxrecargoe/classes/RecargoDeEquivalenciaDlx.php on line 344
 

Seguramente sea una chorrada, pero yo no consigo solucionarlo, ¿podéis echarme una mano? 

 

Gracias !

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More