ngCart icon indicating copy to clipboard operation
ngCart copied to clipboard

Send additional fields values to checkout

Open webiox opened this issue 10 years ago • 6 comments

Is there any way to send additional field's values like "Shipping Address" and "Contact Number" to Checkout along with cart data?

webiox avatar Jan 04 '16 06:01 webiox

I'd also like the ability to "extend" the ngCart object to include custom fields like: description, size, etc.

kthomas80 avatar Feb 03 '16 15:02 kthomas80

+1

Jesus82 avatar May 26 '16 07:05 Jesus82

Hei, @webiox! Did you find a way to resolve this? I also want to send some customer data along with the cart data.

interngalactik avatar Jun 22 '16 21:06 interngalactik

Hi @Intergalactik, I solved this by storing the form data in an array this.formData = {};

And then "getting out" the cart info from the directive this.productData = ngCart.$cart;

Then adding both objects and then sending an unique http request

this.checkoutData = angular.extend(this.formData, this.productData);

this.submitForm = function() {
        $http.post('process.php', this.checkoutData)
};

Hope this can help you!

Jesus82 avatar Jun 24 '16 08:06 Jesus82

Oh, @Jesus82 , thank you! :+1:

interngalactik avatar Jun 25 '16 07:06 interngalactik

The same issue I am having , in cart page I need to send set of extra fields:

  1. Delivery (either express or fast) , in form of radio burtons.
  2. Shipping note and few more.

It will be great if anyone can prepare a plnkr or fiddle source and share it over here. Will be great help.

Thanks

Attamjot avatar Jan 06 '17 05:01 Attamjot