User Address - Checkout Process
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 40
- Joined: 12 Jul 2018, 19:57
User Address - Checkout Process
Hi there;
I'm working in a some feature in the checkout process
I saw this code in the address-delivery-body-standard.php
I supposed that that block code load the addresses stored in the users_address table.
Now, I checked Aimeos\Client\Html\Checkout\Standard\Address\Delivery\Standard.php in addData method this.
But the $deliveryAddressItems array always is empty, is there something i need to do ?
Thanks
I'm working in a some feature in the checkout process
I saw this code in the address-delivery-body-standard.php
Code: Select all
<?php foreach ($this->get('addressDeliveryItems', []) as $id => $addr) : ?>
.....
<?php endoreach; ?>
Now, I checked Aimeos\Client\Html\Checkout\Standard\Address\Delivery\Standard.php in addData method this.
Code: Select all
$context = $this->getContext();
$controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'customer');
$orderAddressManager = \Aimeos\MShop\Factory::createManager($context, 'order/base/address');
try {
$deliveryAddressItems = [];
$item = $controller->getItem($context->getUserId(), ['address']);
foreach ($item->getAddressItems() as $id => $addrItem) {
$deliveryAddressItems[$id] = $orderAddressManager->createItem()->copyFrom($addrItem);
}
$paymentAddressItem = $orderAddressManager->createItem()->copyFrom($item->getPaymentAddress());
$view->addressCustomerItem = $item;
$view->addressPaymentItem = $paymentAddressItem;
$view->addressDeliveryItems = $deliveryAddressItems;
} catch (\Exception $e) {
} // customer has no account yet
Thanks
--
Jorge A Ramirez
System Engineer
PHP Developer
Jorge A Ramirez
System Engineer
PHP Developer
Re: User Address - Checkout Process
Hi,jramirezgranada wrote:Hi there;
I'm working in a some feature in the checkout process
I saw this code in the address-delivery-body-standard.php
I supposed that that block code load the addresses stored in the users_address table.Code: Select all
<?php foreach ($this->get('addressDeliveryItems', []) as $id => $addr) : ?> ..... <?php endoreach; ?>
Now, I checked Aimeos\Client\Html\Checkout\Standard\Address\Delivery\Standard.php in addData method this.
But the $deliveryAddressItems array always is empty, is there something i need to do ?Code: Select all
$context = $this->getContext(); $controller = \Aimeos\Controller\Frontend\Factory::createController($context, 'customer'); $orderAddressManager = \Aimeos\MShop\Factory::createManager($context, 'order/base/address'); try { $deliveryAddressItems = []; $item = $controller->getItem($context->getUserId(), ['address']); foreach ($item->getAddressItems() as $id => $addrItem) { $deliveryAddressItems[$id] = $orderAddressManager->createItem()->copyFrom($addrItem); } $paymentAddressItem = $orderAddressManager->createItem()->copyFrom($item->getPaymentAddress()); $view->addressCustomerItem = $item; $view->addressPaymentItem = $paymentAddressItem; $view->addressDeliveryItems = $deliveryAddressItems; } catch (\Exception $e) { } // customer has no account yet
Thanks
Are you working on the page where user enters its addressess?
Thanks!
-
- Posts: 40
- Joined: 12 Jul 2018, 19:57
Re: User Address - Checkout Process
Yes, in the checkout process.
I found a bug there, in the Aimeos\Client\Html\Checkout\Standard\Address\Delivery\Standard.php in this line aimeos needs to change this $item = $controller->getItem($context->getUserId(), ['address']); to this $item = $controller->getItem($context->getUserId(), ['customer/address']);
I found a bug there, in the Aimeos\Client\Html\Checkout\Standard\Address\Delivery\Standard.php in this line aimeos needs to change this $item = $controller->getItem($context->getUserId(), ['address']); to this $item = $controller->getItem($context->getUserId(), ['customer/address']);
--
Jorge A Ramirez
System Engineer
PHP Developer
Jorge A Ramirez
System Engineer
PHP Developer
Re: User Address - Checkout Process
The bug should have been fixed in the new 2018.10 version released today. Could you check that please?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star