0

I have created an Observer for checkout_cart_product_add_before event. I am able to retrieve 2 options called locationTo and locationFrom. I then calculate the distance from each location by geocoding the two addresses and using the Vincenty Great Circle Distance algorithm.

I want to show this value on the cart page, how would i go about displaying this value on the cart page?

Is there a way i could create a custom option and set the distance value within the observer and add it to the quote item and then it would be displayed on the cart page, or am i thinking about it wrong? how would i go about doing this.

molleman
  • 2,934
  • 16
  • 61
  • 92

1 Answers1

0

You could use the 'additional_options' field to store your custom option

See Magento - Quote/order product item attribute based on user input

Community
  • 1
  • 1
MagePal Extensions
  • 17,646
  • 2
  • 47
  • 62