Automatically Add Extra Shipping Charge

  • Posts: 109
  • Thank you received: 5
10 years 2 months ago #203227

Thanks, Mohamed Thelji.

Please could you tell me where the user state "HIKASHOP_COMPONENT.'.shipping_id'" is initially set in the checkout process?

It seems that this value is already set when the __construct in controllers/checkout.php is run (when the checkout button is clicked).

Thanks.

Take care!

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

  • Posts: 12953
  • Thank you received: 1778
10 years 2 months ago #203228

Hello !
It's set through the "before_shipping" function of the file "components\com_hikashop\controllers\checkout.php".

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

  • Posts: 109
  • Thank you received: 5
10 years 2 months ago #203428

Thanks, Mohamed Thelji.

The value is set in __construct (in controllers/checkout.php ) as was mentioned earlier. This is called before the before_shipping function is called. Hence, your answer that the value is initially set in before_shipping is not quite correct.

I need to know the first place when the value is set.

Please could you tell me which code sets the value the first time?

Thanks.

Take care!

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

  • Posts: 109
  • Thank you received: 5
10 years 2 months ago #204596

Hello, Mohamed Thelji.

Good evening!

Yes, you are right; the values are set in before_shipping.

Please could you advise what code I can use to call the before_shipping function from the components/com_hikashop/views/product/view.html.php file?

Thanks.

Take care!

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

  • Posts: 12953
  • Thank you received: 1778
10 years 2 months ago #204601

Hello !
That function is defined through the "Checkout" Controller via : "components\com_hikashop\controllers\checkout.php"
If you want to have access to it through your product view/controller you'll have to create another function which will do the same thing.

Last edit: 10 years 2 months ago by Mohamed Thelji.

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

  • Posts: 109
  • Thank you received: 5
10 years 2 months ago #204735

Thanks, Mohamed Thelji.

Yes, I had already copied the relevant code from components\com_hikashop\controllers\checkout.php hitherto.

What I didn't want was to end up with 2 bits of code that does the same thing. Is there another way (e.g. to call the function in checkout.php from the view.html.php)? If so, how?

Thanks for your help.

Take care!

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

  • Posts: 84233
  • Thank you received: 13673
  • MODERATOR
10 years 2 months ago #204737

Hi,

You can include the file with the normal PHP include_once function and then initialize the controller class and call its function.

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

Time to create page: 0.073 seconds
Powered by Kunena Forum