Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include shipment costs #17

Open
arkaitzgarro opened this issue Dec 2, 2014 · 0 comments
Open

Include shipment costs #17

arkaitzgarro opened this issue Dec 2, 2014 · 0 comments

Comments

@arkaitzgarro
Copy link
Contributor

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,
        ))
    ;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant