- Posts: 23
- Thank you received: 1
Access cart info from Fields step in checkout
10 years 10 months ago - 10 years 10 months ago #226123
by Phane
Access cart info from Fields step in checkout was created by Phane
-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : Chrome latest
Hello,
I'd like to access order informations (full price with tax, shipping address) from the "fields" checkout step in order to display (or not) different custom fields, is it possible and if so, how ?
Thank you very much !
-- Joomla version -- : 3.4.8
-- PHP version -- : 5.4.45
-- Browser(s) name and version -- : Chrome latest
Hello,
I'd like to access order informations (full price with tax, shipping address) from the "fields" checkout step in order to display (or not) different custom fields, is it possible and if so, how ?
Thank you very much !
Last edit: 10 years 10 months ago by Phane.
Please Log in or Create an account to join the conversation.
10 years 10 months ago - 10 years 10 months ago #226180
by Philip
Replied by Philip on topic Access order info from Fields step in checkout
Hello,
This video may help you to understand how the checkout views can be configured.
Video tutorial link
And For the custom field, this tutorial as well will give you some clue to create an Order Custom field.
With all of these, you have to add in your checkout configuration the "Fields" elements and create your required custom field
Regards,
This video may help you to understand how the checkout views can be configured.
Video tutorial link
And For the custom field, this tutorial as well will give you some clue to create an Order Custom field.
With all of these, you have to add in your checkout configuration the "Fields" elements and create your required custom field
Regards,
Last edit: 10 years 10 months ago by Philip.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #226250
by Phane
Replied by Phane on topic Access order info from Fields step in checkout
Hello Philip,
Thank you for your answer.
I understand all of this, I already configured the checkout workflow and added custom fields. The thing is I would like to, in the code (on the checkout/fields.php view), access the order informations with a line like "$this->orderInfos", and use them to hide or show the custom fields. I know it's possible to access these informations from the checkout/step.php view but is it possible from the fields view ?
Thanks.
Thank you for your answer.
I understand all of this, I already configured the checkout workflow and added custom fields. The thing is I would like to, in the code (on the checkout/fields.php view), access the order informations with a line like "$this->orderInfos", and use them to hide or show the custom fields. I know it's possible to access these informations from the checkout/step.php view but is it possible from the fields view ?
Thanks.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #226335
by nicolas
Replied by nicolas on topic Access order info from Fields step in checkout
Hi,
I suppose that you're talking about the cart information, not the order information since there is not yet any order on the checkout.
You can use such code:
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart();
You'll get all the information available for the current cart in $cart.
I suppose that you're talking about the cart information, not the order information since there is not yet any order on the checkout.
You can use such code:
$cartClass = hikashop_get('class.cart');
$cart = $cartClass->loadFullCart();
You'll get all the information available for the current cart in $cart.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #226358
by Phane
Replied by Phane on topic Access order info from Fields step in checkout
That's great, thanks a lot !
Would it be possible to also get the shipping address ? knowing that the client selects it before the fields step.
Would it be possible to also get the shipping address ? knowing that the client selects it before the fields step.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #226382
by nicolas
Replied by nicolas on topic Access order info from Fields step in checkout
Hi,
The shipping address should also be available in $cart.
The shipping address should also be available in $cart.
Please Log in or Create an account to join the conversation.
10 years 10 months ago #226473
by Phane
Replied by Phane on topic Access order info from Fields step in checkout
Hello,
I just need to turn the "additionalInfos" to true : $cart = $cartClass->loadFullCart(true);
Now it works perfectly, thank you very much !
I just need to turn the "additionalInfos" to true : $cart = $cartClass->loadFullCart(true);
Now it works perfectly, thank you very much !
Please Log in or Create an account to join the conversation.
Time to create page: 0.059 seconds