1

I want to add tracking code to last step checkout success.phtml

This file should be:

app/design/frontend/THEME/THEME_NAME/Magento_Checkout/templates/success.phtml

but here I have only folder:

Magento_Checkout/templates/cart/
  • coupon.phtml
    • form.phtml
    • minicart.phtml
    • shipping.phtml

@Wisam

I have found code in

app/design/frontend/THEME/THEME_NAME/Magento_Checkout/layout/checkout_onepage_success.xml

and here I have added google tracking code.

What do you think about this? Will it work?

2

If you don't have this file in your theme, that's mean the file is coming from the core module,

check this path

vendor\magento\module-checkout\view\frontend\templates

you will find the success.phtml inside this folder, Copy this file to your path

app/design/frontend/THEME/THEME_NAME/Magento_Checkout/templates/success.phtml

Refresh the cache, then modify it as you wish

  • I have update my topic. – Sylvester Apr 21 '18 at 9:44
  • It is very important to do some test, Try to place order then try to use inspect element in the browser and search for your code to insure that the code is exist and the success.phtml taking from right place – WISAM HAKIM Apr 21 '18 at 14:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.