Skip to content

Tag: magento2

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 …

Magento 2.4 Custom form post is redirecting 404 or search

I have problem with custom made form that should make post request to custom controller, it’s redirecting me to search page and i have no idea why. When i try to paste action url into browser it’s working corectlly. my form phtml: get action method: controller is located in vendormoduleControllerL…

How to pass storeUrl to default Magento oauth script?

I’m trying to create my first Magento 2 extension and integration and I’ve been following the guide in their docs here. All good so far, I’ve completed the auth handshake, stored all the required keys for api requests and can make requests back to my extension fine. Looking at the OauthClien…

PHP Bold String Before Specific Char

I have product title with this standard: “Brand name – item title” and I need to transform this string like this: Brand name item title So I need 2 things to handle: replace the first dash in the string with “br” and apply bold to the text before the first dash. I have reached on…

Magento 2 Category SEO friendly URLS

I have a Magento 2 website and require some direction with setting up sub-category urls to be SEO friendly. The Navigation menu work just fine i.e Grooming Kit www.mywebsite.com/product-grooming-kit.html the issue i’m having is with sub-categories in the left sidebar filters which when a specific catego…

Magento 2 Attribute Not Show In Navigation

I have a problem when applying magento 2.1.9 to my project. My attribute is ab_size I have created that attribute with code blow. With config in the backend. Enable filter (with result) done Category Is Anchor done Reindex done Enable Category flat done Enable Product flat done Reindex all data done Clear cac…