Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Products in Carts #1

Open
kinjal153mehta opened this issue Dec 21, 2017 · 0 comments
Open

Products in Carts #1

kinjal153mehta opened this issue Dec 21, 2017 · 0 comments

Comments

@kinjal153mehta
Copy link

hello i used your solution for resolve my issue but in listing product name and price and orders in not display only product id is displayed actully i directly update the below code in vendor location not create a code folder inside app folder $items = $this->getItems();
$productIds = [];
foreach ($items as $item) {
$productIds[] = $item->getProductId();
}
$productData = $this->getProductData($productIds);
$orderData = $this->getOrdersData($productIds);
$existing = $this->productResource->getAllIds();
foreach ($items as $item) {
if(in_array($item->getProductId(),$existing)){
continue;
}
$item->setId($item->getProductId());
$item->setPrice($productData[$item->getProductId()]['price'] * $item->getBaseToGlobalRate());
$item->setName($productData[$item->getProductId()]['name']);
$item->setOrders(0);
if (isset($orderData[$item->getProductId()])) {
$item->setOrders($orderData[$item->getProductId()]['orders']);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant