Skip to content

Detect Success Page on Magento 2

Is there a way to check if am I on Success page on Magento 2? I know in Magento 1 we can check and compare the action name, for example. But in Magento 2, there is something similar? Answer One way would be via URL. In your Class use this in construct: With $this->_urlInterface->getCurrentUrl() you get …

PHP Recursively calculate a formula in an array in reverse

I would like te perform a calculation on the following array eventually the calculation would traverse into: I’ve tried recursively looping through the array using array_walk_recursive and custom functions which basically to the same. but the problem is that the add cannot calculate the ceil before it h…

Query returns old data

I have a mysql query that counts how many orders have been made on my website: SELECT COUNT(`orderid`) FROM `orders` WHERE `completed` = 1 It works fine, but only when you refresh the page. If …

PHP, simple banner pop up in else statement

I have a simple if/else for a php login of sorts: However, I want to make it so that within that else it shows a somewhat nice looking banner on the existing page, as now it just shows the text on a white blank page (as echo should be expected to do) What’s the most simple way to just stay