Jump to content

[APORTE] Envio gratis hasta cierto peso


Recommended Posts

Amigos, me ha costado varios días encontrar la solución a este problema.

La historia es la siguiente:

tengo un producto A que pesa 4 KG y vale 150

Automáticamente el envío sale gratis, porque he puesto en TRANSPORTE>PREFERENCIAS, envio gratis a partir de 100 €

Pero, que ocurre cuando pasa de 5 KG? ,, mi transporte ASM me clava un palo de miedo, y me aumenta el coste del envío por lo que noi me sale rentable....

Si ahora añado dos unidades del producto A ( 4+4KGS ), aunque su precio haya aumentado a 300 € , ese envío no puede salir gratis....

 

Como hacerlo :

Para PS1.7 que es la que uso yo, tenemos que:

1- Arir el archivo /classes/cart.php

2- buscar el código 

 if (isset($configuración['PS_SHIPPING_FREE_PRICE'])) {

            $free_fees_price = Tools::convertPrice((float)$configuration['PS_SHIPPING_FREE_PRICE'], Currency::getCurrencyInstance((int)$this->id_currency));

        }

Cambiarlo por:

if (isset($configuration['PS_SHIPPING_FREE_PRICE']) && $this->getTotalWeight($product_list) < 25 ) {

            $free_fees_price = Tools::convertPrice((float)$configuration['PS_SHIPPING_FREE_PRICE'], Currency::getCurrencyInstance((int)$this->id_currency));

        }

DONDE EL NUMERO 25 SERÁ EL MAXIMO DE PESO PERMITIDO ANTES DE COBRAR PORTES.

 

Pues eso, con ese código solucionamos el tema este sin comprar ningún módulo.

 

 

saludos

Edited by rt000v95 (see edit history)
  • Thanks 1
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...