Dobrý den,
potřebuji pro zákazníka velmi specifické možnosti dopravy.
Potřebuji vypočítávat dopravu dynamicky podle obsahu košíku, cena dopravy se mění podle počtu kusů a u každého druhu zboží je to trochu jinak.
Logiku výpočtu si dokáži naprogramovat. Pustil jsem se do vývoje vlastního pluginu. Obsah košíku si už dokáži zjistit.
Potřebuji vědět, který event použít a jak změnit cenu za dopravu.
Děkuji
Vývoj vlastního dopravního pluginy
-
- Phoca Enthusiast
- Posts: 94
- Joined: 13 Feb 2024, 17:00
Re: Vývoj vlastního dopravního pluginy
Are you working with Phoca Cart 4+?
Did you install the Phoca Cart Shipping - Standard Plugin (J4) (https://www.phoca.cz/download/99-phoca- ... rt-plugins).
In there I see all these events which you could activate: onPCSbeforeProceedToShipping, onPCSbeforeSetShippingForm, onPCSbeforeCheckShipping, onPCSgetShippingBrancheInfoAdmin, onPCSbeforeShowPossibleShippingMethod, onPCSonInfoViewDisplayContent.
After installing it you'd need to select it as Shipping Method for the 'Shipping' Method/cost you configured in Phoca Cart. (It's a bit strange that they are both called Shipping Method. At least in English.)
Does this help or am I completely off the bat (wrong)?
Did you install the Phoca Cart Shipping - Standard Plugin (J4) (https://www.phoca.cz/download/99-phoca- ... rt-plugins).
In there I see all these events which you could activate: onPCSbeforeProceedToShipping, onPCSbeforeSetShippingForm, onPCSbeforeCheckShipping, onPCSgetShippingBrancheInfoAdmin, onPCSbeforeShowPossibleShippingMethod, onPCSonInfoViewDisplayContent.
After installing it you'd need to select it as Shipping Method for the 'Shipping' Method/cost you configured in Phoca Cart. (It's a bit strange that they are both called Shipping Method. At least in English.)
Does this help or am I completely off the bat (wrong)?
-
- Phoca Newbie
- Posts: 2
- Joined: 25 Apr 2024, 16:02
Re: Vývoj vlastního dopravního pluginy
Phoca cart 4.0.10
I am using the Phoca Cart Shipping - Standard Plugin as the foundation for my plugin. However, it appears that there is no way to adjust the shipping price from within the plugin itself. One workaround could involve creating multiple shipping methods, each with different costs, and then enabling or disabling them based on the products in the cart. However, this approach does not align with my specific needs. It would result in an excessive number of shipping methods with complex rules.
Instead, I require a solution that allows for dynamic cost calculation. For instance, I can accommodate 10 units of product A in one package, but only 8 units of product B. Therefore, the shipping cost should be determined by the cost of delivering each package multiplied by the number of packages. This scaling could theoretically extend to an infinite number of packages.
I am using the Phoca Cart Shipping - Standard Plugin as the foundation for my plugin. However, it appears that there is no way to adjust the shipping price from within the plugin itself. One workaround could involve creating multiple shipping methods, each with different costs, and then enabling or disabling them based on the products in the cart. However, this approach does not align with my specific needs. It would result in an excessive number of shipping methods with complex rules.
Instead, I require a solution that allows for dynamic cost calculation. For instance, I can accommodate 10 units of product A in one package, but only 8 units of product B. Therefore, the shipping cost should be determined by the cost of delivering each package multiplied by the number of packages. This scaling could theoretically extend to an infinite number of packages.
- Jan
- Phoca Hero
- Posts: 48345
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: Vývoj vlastního dopravního pluginy
Ahoj, momentálně není eventa, která by dokázala měnit cenu. Každopádně bavili jsme se s ostatními vývojáři, že určitě by bylo žádoucí nějakou takovou eventu mít. Pokud by jsi v tomhle měl nějaký tipy, tak je prosím popiš, abychom měli co nejvíce informací. Problém je, že nevím ale, kdy se k tomu dostaneme
If you find Phoca extensions useful, please support the project