Jump to content

Problema transportista (carrier) NULL


suministrospasai

Recommended Posts

Buenas tardes. 

Hasta ahora me he sacado las castañas del fuego yo solo para todo, pero hay una cosa que me está volviendo loco y no consigo solucionar, a ver si me podéis echar una mano.

 

Hace tiempo que aparece, tanto en la "estimación de los gastos" como a la hora de seleccionar el transportista, uno llamado NULL.

He probado de todo y no hay manera, he hecho una limpieza en la base de datos de todo lo relacionado con "carriers" y "delivery" (con conocimiento hasta cierto punto) y no hay manera de que desaparezca.

 

Lo pongo aquí porque quizá le pase a alguien más. Es una tienda de suministros industriales que si accedéis www.pasaisa.com y añadís un producto, veréis lo que os digo dentro del carrito en la parte de abajo.

 

Gracias de antemano, procuraré aportar lo que pueda a cambio.

 

Saludos.

Link to comment
Share on other sites

Hola Cotoko.

 

Gracias por responder.

En transportistas tengo 5 pero solo 2 activos, "Seur" y "Recogida en tienda". Los que están inactivos tienen nombre y no tienen nada que ver con el NULL. De hecho no hay ningún NULL de nombre en mySQL en la tabla "carriers".

 

He revisado el documento con Firebug y se pueden ver los IDs que coinciden con los de los carriers:

Recogida en tienda -> id_carrier261000 -> equivalente al ID 61 de la tabla.
Seur -> id_carrier31030000 -> equivalente al ID 103 de la tabla

NULL -> id_carrier 1000 -> equivalente ? (no existe otro y he probado a crear el ID 1 y el ID 10).

 

Si cambio el theme pasa lo mismo. Por cierto está todo en la última versión.

 

Todo apunta a algún controlador o algo. ¿A nadie le pasa lo mismo con la 1.6.0.9?

 

Saludos.

Link to comment
Share on other sites

Si dices que sucede lo mismo con el tema default, entonces si es muy probable que el problema se originé de un controlador o clase o en su defecto que algún módulo te haya generado un override de estos archivos, confirma que no tengas ningún override referente a esto y si ed así renombrados temporalmente para ver si el problema desaparece, de lo contrario puedes probar a restaurar los controladores y clases desde un instalador sin modificar.

Link to comment
Share on other sites

Hola Cotoko.

 

Gracias por responder.

En transportistas tengo 5 pero solo 2 activos, "Seur" y "Recogida en tienda". Los que están inactivos tienen nombre y no tienen nada que ver con el NULL. De hecho no hay ningún NULL de nombre en mySQL en la tabla "carriers".

 

He revisado el documento con Firebug y se pueden ver los IDs que coinciden con los de los carriers:

Recogida en tienda -> id_carrier261000 -> equivalente al ID 61 de la tabla.

Seur -> id_carrier31030000 -> equivalente al ID 103 de la tabla

NULL -> id_carrier 1000 -> equivalente ? (no existe otro y he probado a crear el ID 1 y el ID 10).

 

Si cambio el theme pasa lo mismo. Por cierto está todo en la última versión.

 

Todo apunta a algún controlador o algo. ¿A nadie le pasa lo mismo con la 1.6.0.9?

 

Saludos.

A modo de prueba, he realizado una instalación nueva con la 1.6.0.9 y no pasa lo mismo.

 

¿Puedes pegar el contenido de la tablas:

ps_carrier
ps_carrier_group
ps_carrier_lang
ps_carrier_shop
ps_carrier_tax_rules_group_shop
ps_carrier_zone
para ojear?

 

¿Esto desde cuando te pasa?

 

¿Provienes de una actualización, instalación reciente, etc...?

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

Buenas Nadie.

 

Es probable que sea algún cambio que haya realizado en los override. Mientras tanto te pego el INSERT de la tabla que como veras está limpito:

 

INSERT INTO `ps_carrier` (`id_carrier`, `id_reference`, `id_tax_rules_group`, `name`, `url`, `active`, `deleted`, `shipping_handling`, `range_behavior`, `is_module`, `is_free`, `shipping_external`, `need_range`, `external_module_name`, `shipping_method`, `position`, `max_width`, `max_height`, `max_depth`, `max_weight`, `grade`) VALUES
(61, 55, 0, ' Recogida en tienda', '', 1, 0, 0, 0, 0, 1, 0, 0, '', 1, 4, 0, 0, 0, '0.000000', 0),
(100, 100, 0, 'SEUR Puntos de Venta', 'http://www.seur.com' 0, 0, 1, 0, 1, 0, 0, 1, 'seur', 1, 1, 0, 0, 0, '0.000000', 0),
(101, 101, 0, 'SEUR Canarias (M)', 'http://www.seur.com' 0, 0, 1, 0, 1, 0, 0, 1, 'seur', 1, 2, 0, 0, 0, '0.000000', 0),
(102, 102, 0, 'SEUR Canarias (48/72)', 'http://www.seur.com' 0, 0, 1, 0, 1, 0, 0, 1, 'seur', 1, 3, 0, 0, 0, '0.000000', 0),
(103, 99, 0, 'SEUR', 'http://www.seur.com' 1, 0, 0, 1, 1, 0, 0, 1, 'seur', 1, 0, 0, 0, 0, '0.000000', 1);
 
Saludos.
Link to comment
Share on other sites

Aquí tienes nadie:

 

<?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;
}
 
}
}
?>
Link to comment
Share on other sites

Normalmente los override se generan basados en archivos existentes de prestashop, cuando PS saca nuevas actuañizaciones y estas incluyen cambios en dichos archivos entonces normalmente se producen errores inesperados, el desarrollador debe actualizar los override basandose en los nuevos archivos de prestashop.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...