Completed

Fix Foreach

Hello,

i added this If condition

if ($product_type !== 'Bundle') {

to this foreach below, but stop to working

foreach ($orderItems as $item) {

if ($product_type !== 'Bundle') {

$productId = $item->getProductId();

if (empty($productId)) {

continue;

}

$sql = "SELECT * FROM product_expire_date_qty WHERE entity_id = ?";

$data = $this->_connection->fetchAll(

$sql,

array(

$productId

)

);

if (!empty($data) && !empty($data[0])) {

$specialQty = (int)$data[0]['qty'];

$expireDate = date("d-m-Y", strtotime($data[0]['date_expire']));

$now = date("d-m-Y", time());

$qtyOrdered = (int)$item->getQtyOrdered();

$diff = $specialQty - $qtyOrdered;

if ($specialQty == 0 || (strtotime($now) - strtotime($expireDate)) > 0 || $diff <= 0) {

$this->deleteSpecialPrice($productId);

continue;

}

$sql2 = "update product_expire_date_qty set qty = '".$diff ."' where entity_id = ".$productId.";";

$this->_connection->query($sql2);

}

}

}

Please, help me to fix

Skills: PHP, Software Architecture, Magento

See more: foreach number, foreach javascript w3schools, _.foreach javascript, es5 foreach, html foreach, angular foreach in w3schools, css foreach, foreach sum javascript, powershell sql query set, keylogger need help please pls find, php select drop list query mysql, select database dropdown query, joomla help non profits set, swoopo help please, access update query doesnt update, sql query script update, oracle query set mlm upline, hello need help oscommerce website, hello want help last part project, edit a set of 20 model photos airbrush tattoos cellulite slim fix color

About the Employer:
( 190 reviews ) Villanova Mondovì, Italy

Project ID: #22899172

Awarded to:

ryanddavern

Hi! This is a simple error that can be fixed within 30 minutes. Send me a message and I'll get started right away! Thanks - Ryan :)

€15 EUR in 1 day
(5 Reviews)
3.4

17 freelancers are bidding on average €26 for this job

dbuglab

Hello, ⭐⭐ With Proven Track record of successful achievements, I'm pleased to assist you with your project.⭐⭐ ************QUICK CATCH************* - ht More

€60 EUR in 1 day
(189 Reviews)
7.5
coolguyinus2004

Give me URL where its not working. I still need ftp and cpanel access to fix this for you and filename please. PHP/MYSQL expert here. HIRE me now.

€20 EUR in 1 day
(343 Reviews)
7.6
abugosia

Hello, I'm Abu Gosia. I'm interesting in your project very well. I m quite well experienced in these jobs. Let's go ahead with me. Thanks

€20 EUR in 1 day
(170 Reviews)
6.8
abhi98041

Hello, my name is Abhishek.⭐⭐⭐⭐⭐ This project is related to fixing the Foreach loop and I will discuss more in detail to understand project scope and requirement (like features ,functionality , extra required services More

€8 EUR in 1 day
(213 Reviews)
6.5
articontech

Hello, How are you? Hope you are doing well. I have read all the requirements and ready for discuss. Just message me when you're free so we can discuss. Thanks Gaurav

€8 EUR in 1 day
(101 Reviews)
6.0
lukdanpl

Hello. I have big experience in PHP / HTML / JS, so i will do this job with pleasure. Feel free to contact with me. I can start work immediately. Regards, Luke

€20 EUR in 2 days
(41 Reviews)
4.9
anaya8777

Hi, After going through your project Details you want "Fix Foreach",I would love to have an opportunity to work on it. I will do this job as per your expectation, I have more than 7 year experience in SQL, Ajax, OOPS More

€30 EUR in 1 day
(12 Reviews)
3.9
sohustar

I read my job description very carefully and I will surely do the job according to your requirements. Let's find out more. I will start work immediately and deliver it as soon as possible. We look forward to hearing fr More

€19 EUR in 7 days
(1 Review)
3.4
ankurdholakiya91

Hello There I am Ankur, Magento developer having 5 years of experience. I can work on any area in Magento like customization,integrations, design changes etc. I can fix this script within short time. Please message More

€12 EUR in 1 day
(9 Reviews)
2.7
forgeahead

Ready to help you now. Lets connect on chat for more discusion. Thanks ==========================================================

€20 EUR in 1 day
(2 Reviews)
2.5
sixsquare1

Hello Sir, You would have seen many freelancers applied in this project but the best one for this project should be the person who has previous experiences for the relevant skills. We have both experiences and skills. More

€100 EUR in 30 days
(1 Review)
0.5
rsharma583

I would love yo fix your Foreach logic issue in your code . I have seen you used "$product_type" and added functionality to compare and do something. I think I found issue but need to review your all logic to make su More

€19 EUR in 1 day
(3 Reviews)
0.6
artemzlobin900

Hello I've understand your point at once, and It really matchs to me. Bug fix is my talent skill. Because it is my favorite field and I have finished many project like this. Of course, I'm new in freelancer, But I have More

€20 EUR in 3 days
(0 Reviews)
0.0
kunjnayak201925

Hi I am a php / wordpress developer with 5 years of experience I do the tasks very smoothly and efficiently. only your support needed when required. I will give you best technical support. thanks

€19 EUR in 7 days
(0 Reviews)
0.0
V2Infotechnet

Hi There! I have more than 8-year experience in this field. Would you please share more details about the project? I am really interested to work with you for long. Best Regards, Santosh

€19 EUR in 7 days
(0 Reviews)
0.0
geco97

Hi, I am a frontend Developer with more than 5 years in designing with the HTML5, CSS3, Javascript, jquery, php and the latest version of bootstrap. I am ready to start your task right now. Please feel free to contact More

€25 EUR in 1 day
(0 Reviews)
0.0