Display Shipping Cost on Product Page

  • Posts: 68
  • Thank you received: 6
10 years 6 months ago #154584

In the same idea of this request www.hikashop.com/forum/shipping-methods/...on-product-page.html

I would like to display not the per product shipping cost, but the actual shipping cost of the product to a chosen country.
I am using Manual Shipping with different costs per min/max product weights.

I would need to query the table hikashop_shipping, but the min/max product weights are "compiled" in the variable shipping_params, which make it difficult to manipulate.

Is there an existing function or class that gives the shipping cost knowing a destination country and the product weight?

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
10 years 6 months ago #154610

Hi,

There is no such easy to use function. That would require code similar to that of the other thread but you would have to load all the shipping methods for the zone, and then filter out the shipping methods on the weight by checking each one against the weight of the product with PHP code.

Please Log in or Create an account to join the conversation.

  • Posts: 68
  • Thank you received: 6
10 years 6 months ago #154722

Understood. Could you please guide me in hikashop files to find reference php code?
Which files and which lines are relevant?

Thanks.
Max.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 6 months ago #154730

Hello Max,
If you want it to appear on you product page, the solution will be to add your code through the "show_default" file of the "product" view of your front-end template via "Hikashop->Display->Views".

Please Log in or Create an account to join the conversation.

  • Posts: 68
  • Thank you received: 6
10 years 6 months ago #154850

Thanks Mohamed I got the view.
Now can you let me know in which hikashop file I can find reference PHP code for the calculation of shipping costs?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #155398

Hi,

I think that the code you want is in the "administrator/components/com_hikashop/helper/helper.php", in the class "hikashopShippingPlugin()". But the prices can be set depending on the shipping method by the shipping provider.

Please Log in or Create an account to join the conversation.

Time to create page: 0.081 seconds
Powered by Kunena Forum