Calling Developers!
We are reenergizing our code contribution process! Learn More

Shipment Price Plugin Implementation

altaf-husain
altaf-husain Spryker Solution Partner Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

Hello Team,

I am currently attempting to implement a shipment price plugin, but I am facing an issue where I am unable to retrieve the delivery method details. Let's say I have two delivery methods: Express and Standard.

My question is, do I need to create two separate plugins to handle each delivery method, or is it manageable by a single price plugin?

Comments

  • altaf-husain
    altaf-husain Spryker Solution Partner Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet
  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 πŸͺ - Explorer
    ShipmentGroupTransfer::getShipment()::getMethod()
    

    should return the delivery method.

  • altaf-husain
    altaf-husain Spryker Solution Partner Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks @Alberto Reyer for your reply. I have already tried with this solution. Actually I am getting values once I select delivery method.

    Without select delivery method, getting blank value on /checkout/shipment page

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 πŸͺ - Explorer

    And how do you want to calculate the shipping price when no method is selected?

    I see two options here:

    a) calculated the shipping price once a shipping method is selected (just return when there is non method yet in your plugin)
    b) assume a default method and calculated the price based on this as long as no shipping method is selected

  • altaf-husain
    altaf-husain Spryker Solution Partner Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    As of now, I have created two price-calculation plugins for two delivery methods, and the prices are visible according to the requirement logic.
    In total, I have developed 6 plugins (2 for delivery time, 2 for availability, and 2 for price) for two delivery methods.
    I am in search of a method to incorporate three plugins (delivery time plugin, availability plugin, and price calculation plugin) for all delivery methods.

  • altaf-husain
    altaf-husain Spryker Solution Partner Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    I am attaching screenshot for the reference

  • altaf-husain
    altaf-husain Spryker Solution Partner Posts: 9 πŸ§‘πŸ»β€πŸš€ - Cadet

    On the basis of cart item's weight and dimension, we are calculating delivery method price.