Jump to content

Fatal error - au secours [Résolu]


Recommended Posts

Bonjour,

 

J'ai tenté pas plus tard qu'hier de procéder à la mise à niveau de ma boutique de la 1.6 à 1.6.09 par la procédure simplifiée avec le module dans le back office, et la procédure a planter vers la fin avec des messages d'erreurs (que je n'ai pas compris d'ailleurs).

Du coup j'ai tout de suite tenté de restaurer par le même canal l'ancienne version de prestashop, et là aussi erreur de restauration. Impossible.

 

J'ai alors été sur mon hébergeur pour restaure le backup de la veille, et depuis lors voici ce que j'obtiens losrsque je vais sur la boutique www.li-coeurs.ch/boutique :

 

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/cache/smarty/compile/dc/b1/5e/wrt5480567273a666.65692101' in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/www/e44fa...', '<?php /* Smarty...', Object(Smarty)) #1 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/Controller.php(406): Smarty_Internal_TemplateBase->fetch('/home/www/e44fa...') #3 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/FrontController.php(597): ControllerCore->smartyOutputContent('/home/www/e44fa...') # in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44

 

J'ai contacté le support de mon hébergeur (infomaniak) et là aussi impossible, ils n'arrivent rien à faire.

 

Le répertoire .....smarty/compile/dc/...... n'existe pas dans les backup même de 7 jours en arrière alors que hier encore, avant ma désastreuse tentative de mise à niveau, la boutique fonctionnait très bien.

 

Merci d'avance pour l'aide de la communauté.

 

Bien cordialement.

 

Stéphane

Edited by stezuf (see edit history)
Link to comment
Share on other sites

Merci pour cette rapide réponse.

J'ai renommé le fichier cache/class_index.php en old et ça s'améliore, mais pas à 100%.

Voici la réponse que j'ai maintenant à l'appel de la boutique :

Parse error: syntax error, unexpected T_PUBLIC in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/override/classes/Cart.php on line 122

Link to comment
Share on other sites

voici :

/**
108
* @brief Calculate the shipping cost.
109
*
110
* Override it in order to calculate and add the correct tax amount.
111
*
112
* @note This method is only called in PrestaShop < 1.5
113
* @see Cart::geTotalShippingCost() for PrestaShop > 1.5
114
*
115
* @param integrer $id_carrier Id of the selected carrier
116
* @param boolean $use_tax Do we want the taxes?
117
* @param Country $default_country Unused 1.5 only, for inheritance compatibility
118
* @param Array $product_list Unused 1.5 only, for inheritance compatibility
119
*
120
* @return float Price of the shipping.
121
*/
122
public function getOrderShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null)
123
{
124
include_once(_PS_ROOT_DIR_.'/modules/avalaratax/avalaratax.php');
125
126
/* Instanciate the Avalara module and check if active */
127
$avalara = new AvalaraTax();
128
if (!$avalara->active)
129
return parent::getOrderShippingCost((int)$id_carrier, $use_tax, $default_country, $product_list);
130
131
/* Retrieve the original carrier fee tax excluded */
132
$tax_excluded_cost = parent::getOrderShippingCost((int)$id_carrier, false, $default_country, $product_list);
133
Link to comment
Share on other sites

désolé. voici depuis le début et un peu plus loin que la 122 :

 

<?php
/*
* Shopgate GmbH
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file AFL_license.txt.
* It is also available through the world-wide-web at this URL:
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* @author Shopgate GmbH, Schloßstraße 10, 35510 Butzbach <[email protected]>
* @copyright  Shopgate GmbH
* @license   http://opensource.org/licenses/AFL-3.0 Academic Free License ("AFL"), in the version 3.0
*/
 
if(version_compare(_PS_VERSION_, '1.4.0.2', '>=')  && version_compare(_PS_VERSION_, '1.4.1.0', '<=') && !class_exists('CartCore')){
// load CartCore for extending it for overwritting methods in 1.4.0.2 to 1.4.1.0
// in newer versions this is load automatically
include_once(dirname(__FILE__).'/../../../../classes/Cart.php');
}
 
if(version_compare(_PS_VERSION_, '1.4.0.2', '>=')){
// CartCore only exists in version 1.4.0.2 and above
class Cart extends CartCore {
 
public function getDeliveryOptionList(Country $default_country = null, $flush = false){
$r = parent::getDeliveryOptionList($default_country, $flush);
 
if($this->id_carrier == Configuration::get('SHOPGATE_CARRIER_ID')){
require_once(_PS_MODULE_DIR_.'shopgate/classes/PSShopgateOrder.php');
 
$shopgateOrder = PSShopgateOrder::instanceByCartId($this->id);
 
$r[$this->id_address_delivery][$this->id_carrier.',']['carrier_list'][$this->id_carrier] = array
(
'price_with_tax' => $shopgateOrder->shipping_cost,
'price_without_tax' => 0,
'package_list' => array(0),
'product_list' => array(),
'instance' => new Carrier($this->id_carrier),
);
 
$r[$this->id_address_delivery][$this->id_carrier.',']['is_best_price'] = 1;
$r[$this->id_address_delivery][$this->id_carrier.',']['is_best_grade'] = 1;
$r[$this->id_address_delivery][$this->id_carrier.',']['unique_carrier'] = 1;
$r[$this->id_address_delivery][$this->id_carrier.',']['total_price_with_tax'] = $shopgateOrder->shipping_cost;
$r[$this->id_address_delivery][$this->id_carrier.',']['total_price_without_tax'] = 0;
$r[$this->id_address_delivery][$this->id_carrier.',']['position'] = 0;
}
return $r;
}
 
public function isCarrierInRange($id_carrier, $id_zone){
if(version_compare(_PS_VERSION_, "1.4.2.5", "==") || version_compare(_PS_VERSION_, "1.4.3.0", "==")){
// fix a bug in Prestashop
$carrier = new Carrier((int)$id_carrier, Configuration::get('PS_LANG_DEFAULT'));
$shippingMethod = $carrier->getShippingMethod();
 
###### that is the bug BOF ######
if (!$carrier->range_behavior) {
return true;
}
###### that is the bug EOF ######
 
if ($shippingMethod == Carrier::SHIPPING_METHOD_FREE) {
return true;
}
 
if ($shippingMethod == Carrier::SHIPPING_METHOD_WEIGHT
&& (Carrier::checkDeliveryPriceByWeight((int)$id_carrier, $this->getTotalWeight(), $id_zone))) {
return true;
}
if ($shippingMethod == Carrier::SHIPPING_METHOD_PRICE
&& (Carrier::checkDeliveryPriceByPrice((int)$id_carrier, $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING), $id_zone, (int)$this->id_currency))) {
return true;
}
} elseif(version_compare(_PS_VERSION_, "1.4.1.0", "==")) {
// fix a bug in prestashop
$carrier = new Carrier((int)$id_carrier, Configuration::get('PS_LANG_DEFAULT'));
$is_in_zone = false;
$order_total = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING);
 
###### that is the bug BOF ######
if (!$carrier->range_behavior) {
return true;
}
###### that is the bug EOF ######
 
if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT
AND (Carrier::checkDeliveryPriceByWeight((int)$id_carrier, $this->getTotalWeight(), $id_zone)))
OR ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE
AND (Carrier::checkDeliveryPriceByPrice((int)$id_carrier, $order_total, $id_zone, (int)($this->id_currency)))))
{
$is_in_zone = true;
}
 
unset($carrier);
return $is_in_zone;
} else {
return parent::isCarrierInRange($id_carrier, $id_zone);
}
return false;
/**
* @brief Calculate the shipping cost.
*
* Override it in order to calculate and add the correct tax amount.
*
* @note This method is only called in PrestaShop < 1.5
* @see  Cart::geTotalShippingCost() for PrestaShop > 1.5
*
* @param integrer $id_carrier      Id of the selected carrier
* @param boolean  $use_tax         Do we want the taxes?
* @param Country  $default_country Unused 1.5 only, for inheritance compatibility
* @param Array    $product_list    Unused 1.5 only, for inheritance compatibility
*
* @return float Price of the shipping.
*/
public function getOrderShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null)
{
include_once(_PS_ROOT_DIR_.'/modules/avalaratax/avalaratax.php');
 
/* Instanciate the Avalara module and check if active */
$avalara = new AvalaraTax();
if (!$avalara->active)
return parent::getOrderShippingCost((int)$id_carrier, $use_tax, $default_country, $product_list);
 
/* Retrieve the original carrier fee tax excluded */
$tax_excluded_cost = parent::getOrderShippingCost((int)$id_carrier, false, $default_country, $product_list);
 
/* If we want price without tax or if this carrier is tax free, return this price */
if (!(int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')} || !$use_tax)
return $tax_excluded_cost;
 
/* If there is no cache or cache expired, we regenerate it */
if (CacheTools::checkCarrierCache($this))
{
$region = Db::getInstance()->getValue('
SELECT s.`iso_code`
FROM '._DB_PREFIX_.'address a
LEFT JOIN '._DB_PREFIX_.'state s ON (s.`id_state` = a.`id_state`)
WHERE a.`id_address` = '.(int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
CacheTools::updateCarrierTax($avalara, $this, $this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $region, $use_tax);
}
 
/* If we do already know it, then return i
Link to comment
Share on other sites

merci pour cette info.

J'ai donc ajouté cette accolade, et maintenant il donne ça :
 

/boutique/override/classes/Cart.php on line 223

 

Et voici les lignes de la fin du fichier (la 223 étant l'avant dernière) :

 

public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null)
{
include_once(_PS_ROOT_DIR_.'/modules/avalaratax/avalaratax.php');
 
/* Instanciate the Avalara module and check if active */
$avalara = new AvalaraTax();
if (!$avalara->active)
return parent::getPackageShippingCost((int)$id_carrier, $use_tax, $default_country, $product_list);
 
/* Retrieve the original carrier fee tax excluded */
$tax_excluded_cost = parent::getPackageShippingCost((int)$id_carrier, false, $default_country, $product_list);
 
/* If we want price without tax or if this carrier is tax free, return this price */
if (!(int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')} || !$use_tax)
return $tax_excluded_cost;
 
/* If there is no cache or cache expired, we regenerate it */
if (CacheTools::checkCarrierCache($this))
return parent::getPackageShippingCost((int)$id_carrier, $use_tax, $default_country, $product_list);
 
/* If we do already know it, then return it */
return $tax_excluded_cost + (float)CacheTools::getCarrierTaxAmount($this);
}
}
}
}

 

?>

je précise le message d'erreur nouveau depuis le début :

 

Parse error: syntax error, unexpected '}' in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/override/classes/Cart.php on line 223

Link to comment
Share on other sites

Est-ce que finalement ce n'est pas possible (et plus simple) de réinstaller la boutique dès le début, comme une nouvelle boutique, et de réimporter la base de donnée actuelle que j'ai sauvegardé ?

Non car la "réimportation" sera compliquée voire impossible.

Le plus simple:

  • Désactivez les overrides (renommez /overrides en /overrides_orig) et recréez un répertoire /overrides (vide)
  • Réinitialisez les modules que vous avez installés, comme AvalaraTax par exemple.
Link to comment
Share on other sites

ok. J'ai renommé le répertoire override en _orig et recréé un override nouveau vide.

 

Et là c'est pas beau ;-) 

 

Warning: scandir(/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/override/classes/) [function.scandir]: failed to open dir: No such file or directory in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/PrestaShopAutoload.php on line 171

Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/PrestaShopAutoload.php on line 171

Warning: Invalid argument supplied for foreach() in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/PrestaShopAutoload.php on line 171

Warning: scandir(/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/override/controllers/) [function.scandir]: failed to open dir: No such file or directory in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/PrestaShopAutoload.php on line 171

Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/PrestaShopAutoload.php on line 171

Warning: Invalid argument supplied for foreach() in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/PrestaShopAutoload.php on line 171

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/cache/smarty/compile/dc/b1/5e/wrt54807916343bf2.18532226' in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/www/e44fa...', '<?php /* Smarty...', Object(Smarty)) #1 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/Controller.php(406): Smarty_Internal_TemplateBase->fetch('/home/www/e44fa...') #3 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/FrontController.php(597): ControllerCore->smartyOutputContent('/home/www/e44fa...') # in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44

 

Impossible d'accéder au backoffice bien évidemment non plus.

 

Donc je sais pas comment initialiser le module AvalaraTax

 

Suis-je condamné à refaire toute la boutique ? aaaaarggggg......

 

En tout cas déjà un grand merci de prendre du temps pour m'aider. C'est appréciable.

Link to comment
Share on other sites

résultat :

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/cache/smarty/compile/dc/b1/5e/wrt5480822caac592.71483479' in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/www/e44fa...', '<?php /* Smarty...', Object(Smarty)) #1 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/Controller.php(406): Smarty_Internal_TemplateBase->fetch('/home/www/e44fa...') #3 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/FrontController.php(597): ControllerCore->smartyOutputContent('/home/www/e44fa...') # in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44


cela ressemble fortement au premier message d'erreurs

Link to comment
Share on other sites

voilà c'est fait. Je l'ai renommé de ..._old _ en ..._php

Résultat :

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/cache/smarty/compile/dc/b1/5e/wrt54809096de7467.31501769' in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/www/e44fa...', '<?php /* Smarty...', Object(Smarty)) #1 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_templatebase.php(155): Smarty_Internal_Template->compileTemplateSource() #2 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/Controller.php(406): Smarty_Internal_TemplateBase->fetch('/home/www/e44fa...') #3 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/FrontController.php(597): ControllerCore->smartyOutputContent('/home/www/e44fa...') # in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44


je suis dépité.......

Link to comment
Share on other sites

Ben merci quand même d'avoir pris tout ce temps pour m'aider.

 

Je suis au fonds du bac mais bon, je n'aurai bien pas d'autre choix que de tout recommencer à zéro.

 

C'est en tout cas généreux de votre part.

 

Bien cordialement.

 

Stéphane

Link to comment
Share on other sites

Bonsoir,

 

Vos erreurs font références à des problèmes de droit en lecture/écriture

 

Vérifiez que vos répertoires sont en 0705 ou 0755 et vos fichiers en 644

 

Si vous utilisez filezilla lors du réimport de l'ancienne boutique, utilisez le mode Binaire et passif (au lieu de automatique) en effet si coupure de connexion pendant le transfert vos fichiers risquent d'être corrompus. Une parenthèse ne disparait pas comme ça d'un fichier.

 

Reprenez donc votre transfert en entier, après avoir vidé votre ftp, avec les paramètres ci-dessus et tout devrait rentrer dans l'ordre. :)

  • Like 1
Link to comment
Share on other sites

Bonjour Eolia,

Merci pour vos conseils auxquels je me suis accrochés.

J'ai (je crois) suivi à lettre vos instructions.

J'ai en premier réimporté la base de donnée sql (en l'ayant vidée auparavant) pour l'aligner avec la sauvegarde à restaurer.

J'ai ensuite modifier le paramètre à binaire, et passif, et commencé le transfert de la sauvegarde.

Tout est passé sans encombre, et après j'ai mis les chmod comme indiqué, et voici le message que j'ai (c'est bien mieux qu'avant) :

 

Parse error: syntax error, unexpected T_PUBLIC in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/override/classes/Cart.php on line 122

 

La sauvegarde que j'ai réimportée était celle de la boutique quand elle fonctionnait correctement.

 

Si vous pensez pouvoir me sauver de cette situation, je peux vous dire qu'une liqueur de ma fabrication (www.li-coeurs.ch) vous est réservée  :) 

 

Bien cordialement.

 

Si jamais je reprendrai demain le cours de tout ça.

 

Au plaisir de vous lire.

 

bien cordialement.

Link to comment
Share on other sites

voici le contenu de la ligne 120 à 124 du fichier cart.php

 

 * @return float Price of the shipping.
*/
public function getOrderShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null)
{
include_once(_PS_ROOT_DIR_.'/modules/avalaratax/avalaratax.php');
Link to comment
Share on other sites

Si c'est le seul message d'erreur ce n'est pas bien méchant.

Désactivez le module avalaratax, effacez le fichier /cache/ class_index.php (il va être régénéré) et réinstallez ce module avec les fichiers originaux (ceux que vous avez ont dû avoir un souci lors de votre sauvegarde)

  • Like 1
Link to comment
Share on other sites

Bonjour,

Merci pour le retour.

J'ai donc effacer le répertoire Avalaratax et supprimer le fichier classindex. 

Mais sans résultat:

Je précise encore que je n'ai pas non plus accès au backoffice de la boutique. 

 

Voici le message que j'ai actuellement :

Parse error: syntax error, unexpected T_PUBLIC in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/override/classes/Cart.php on line 122

 

Et quand je vais sur l'admin de la boutique j'ai cela :

 

Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/cache/smarty/compile/12/c3/dc/wrt5481542ae7ce49.22629547' in /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php:44 Stack trace: #0 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_template.php(201): Smarty_Internal_Write_File::writeFile('/home/www/e44fa...', '<?php /* Smarty...', Object(Smarty)) #1 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_templatebase.php(164): Smarty_Internal_Template->compileTemplateSource() #2 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/AdminController.php(1936): Smarty_Internal_TemplateBase->fetch('controllers/mod...') #3 /home/www/e44fade165966c4dfa446552c624aff1/web/boutique/classes/controller/AdminController.php(2337): AdminControllerCore->initModal() #4 /home/www/e44fad in/home/www/e44fade165966c4dfa446552c624aff1/web/boutique/tools/smarty/sysplugins/smarty_internal_write_file.php on line 44


et voici le contenu du fichier cart de la ligne 122 à 151 :

*/
public function getOrderShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null)
{
include_once(_PS_ROOT_DIR_.'/modules/avalaratax/avalaratax.php');
 
/* Instanciate the Avalara module and check if active */
$avalara = new AvalaraTax();
if (!$avalara->active)
return parent::getOrderShippingCost((int)$id_carrier, $use_tax, $default_country, $product_list);
 
/* Retrieve the original carrier fee tax excluded */
$tax_excluded_cost = parent::getOrderShippingCost((int)$id_carrier, false, $default_country, $product_list);
 
/* If we want price without tax or if this carrier is tax free, return this price */
if (!(int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')} || !$use_tax)
return $tax_excluded_cost;
 
/* If there is no cache or cache expired, we regenerate it */
if (CacheTools::checkCarrierCache($this))
{
$region = Db::getInstance()->getValue('
SELECT s.`iso_code`
FROM '._DB_PREFIX_.'address a
LEFT JOIN '._DB_PREFIX_.'state s ON (s.`id_state` = a.`id_state`)
WHERE a.`id_address` = '.(int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')});
CacheTools::updateCarrierTax($avalara, $this, $this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}, $region, $use_tax);
}
 
/* If we do already know it, then return it */
return $tax_excluded_cost + (float)CacheTools::getCarrierTaxAmount($this);
}
Link to comment
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...