d1m007 / gshoppingflux

PrestaShop Google Shopping Flux Module
98 stars 61 forks source link

Shipping cost Calculation don't consider if carrier available for products #56

Open centoasa opened 6 years ago

centoasa commented 6 years ago

As we already discussed in #55 , I think it is better that flux consider for each product all the carriers available for that particular product. This is either using the courier included in the product sheet, or even using the excellent prestashop method of advanced warehouse management.

Casper-O commented 6 years ago

Just for easy reference, it seems like this needs to be change Carrier::getCarriersForOrder to this Carrier::getAvailableCarrierList

Maybe @GuillaumeGBzh wants to take a look on it?

GuillaumeGBzh commented 6 years ago

Hi,

You seem to use advanced stock management. I did not take into account this point in the development of the calculation of the cost of delivery. This takes time that I do not have today.

I note that in my TODO list.

Casper-O commented 6 years ago

It's both a issue with Advanced stock management and without as far i can see.

Hopefully i have some time doing easter to look at this, but I will look mostly on the other issues first to solve them.

Casper-O commented 6 years ago

I acually think, the whole thing needs an rewrite. For instance a Danish Feed, it would only be valid on Danish, with DKK currency, to target Danish People. Why would the feed also needs to contain the shipping costs for Germany, Sweden etc?

Maybe the Country for shipping calculations needs to selected per feed ?

Casper-O commented 6 years ago

what do you think about this one? We no more burning 10.000 cart id evey time generating a feed.

https://github.com/dim00z/gshoppingflux/commit/41339484bc6bc1e73da90c94070fe82f61bf1a00

Would need to check if the cart is empty first time only, before using it

centoasa commented 6 years ago

Just tested, export me some of products: with previous release of this file, my googleshopping... file was about 11Mega now the file is 503K I've also empry the table ps_cart and resta index form the last order id (2024), but my ps_cart restart from 13249

Casper-O commented 6 years ago

Sounds not right that it dropped from 11Megabyte to 503k - Is eveyhing in there? it should only affect the changes regarding shipping, nothing else. Depending on what version you where using of the module before.

Regarding cart id it can be because there is already an cart id in a cookie saved and it then just continues from that. but the module should not use up large amount of carts anymore, at maximum 1 per run.

centoasa commented 6 years ago

obviously there are not all the products, there are only a small part. I'm using the last release 1.7.0

0 EUR always zero
centoasa commented 6 years ago

@Casper-O with your release, export only combinations

simondaigre commented 6 years ago

Hi,

With commit 41339484bc6bc1e73da90c94070fe82f61bf1a00 cart is not initalized. You can add this to line 2579 to fix this issue.

if (!Validate::isLoadedObject($cart)) { $cart->add(); }

Casper-O commented 5 years ago

@simondaigre that part should be solved now, https://github.com/dim00z/gshoppingflux/commit/063d301e7511d97ce330c3ca07267c63cb08d6f0

Casper-O commented 5 years ago

Look, no more Carts!

Also, the code should now look if a Carrier is available for a given product. Could any of you give it a spin, and check what you think about it?

https://github.com/dim00z/gshoppingflux/commit/8e2da01dd3c705a9651cc844133f4d97d4918607

Casper-O commented 5 years ago

When that said, I would need to look at checking if free shipping has been reach ( amount or weight)

PS_SHIPPING_FREE_WEIGHT / PS_SHIPPING_FREE_PRICE

Casper-O commented 5 years ago

271 products exported: 136 products with attributes, 355 attributes combinations. Total: 626 exported products.

Before: 110-120 secs for export to complete Now: 25-29 secs for export to complete