When I click a button that sends me to a controller action in Magento, where is the code that directs the browser to a new URL? I've been trying to trace the code with the debugger, but I can't find the line of PHP code (or lines of code) that actually assign the browser's URL.
The reason I'm asking is that Magento is putting a hash at the end of my checkout URL, and I'm trying to track down what's adding the hash.
Here is the Javascript behind the button that I'm clicking
define([
'jquery'
], function ($) {
"use strict";
return function (config, element) {
$(element).click(function () {
var form = $(config.form);
var baseUrl = form.attr('action'),
buyNowUrl = baseUrl.replace('checkout/cart/add', 'buynow/cart/add');
form.attr('action', buyNowUrl);
form.trigger('submit');
form.attr('action', baseUrl);
return false;
});
}
});
After clicking the button, I get redirected to example.com/checkout/#93=4
. I'm trying to find the code that's adding the #93=4
to the URL. My guess is that the #93=4
is addended to the URL for the "add to cart" action because 93 is the EAV ID of the configurable option, and 4 is my selected configurable option, but I can't find where it's getting appended. My goal is to figure out a way to strip that off when I get redirected to the checkout page.