Alex
Alex

Reputation: 34978

Magento: Performant display available shipping and payment methods on product detail page

I want to display available shipping and payment methods on the product detail page.

Payment method availability might for example depend on the product price. Shipping methods / price on the product type, weight, special attributes for the shipping type.

One way to display this information on the product detail page would be to create a temporary quote and collect the totals.

Is there a faster way to accomplish this without reproducing the logic that lies in the specific shipping and payment methods?

Logic tells me: no there isn't - because the payment and shipping methods can depend just on any properties of the quote.

But maybe somebody has an idea?

Upvotes: 0

Views: 339

Answers (1)

pzirkind
pzirkind

Reputation: 2338

Maybe try using an ajax call to the controller that handles the calculations.

This gains you 2 things:

  1. You are using the central Magento logic (thus avoiding any potential errors when calculating it).
  2. The page does not need to reload thus avoiding a lot of overhead and user frustration.

Hope this was helpful.

Upvotes: 1

Related Questions