Skip to content

Include shipment costs #17

Description

@arkaitzgarro

In most of the projects, when the items are shipped to the client, we need to know the costs of this shipment.

I've seen than @mmoreram and @alch are working in a shipping component, but it seems that is not included into the order yet. Are you ok if we include a shipping cost method into PaymentBridge?

/**
 * Get shipping amount
 *
 * @return integer
 */
 public function getShippingAmount() {
     // Calculate the costs for this order
     // 0 if it is free
 }

And then create the form field if applicable:

/*
 * PaymentBridge stores shipping amount in cents
 */
$shippingAmount = $this
        ->paymentBridge
        ->getShippingAmount();

if ($shippingAmount > 0) {
    $formBuilder
        ->add('shipping_1', 'hidden', array(
            'data' => $shippingAmount,
        ))
    ;
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions