Try this, To override the selector property in the website_sale module, you will need to create a custom module that depends on the website_sale module. In your custom module, you can define a new website_sale JavaScript class that extends the existing website_sale class and overrides the selector property with your desired ID.
Here is an example of how you could do this:
odoo.define('my_custom_module', function (require) {
"use strict";
// Require the original website_sale module so we can extend it
var website_sale = require('website_sale');
// Define our custom website_sale class that extends the original
var CustomWebsiteSale = website_sale.include({
// Override the selector property with our desired ID
selector: '#my_custom_id a[href$="/shop/cart"]',
});
// Return our custom class to be used in the frontend
return CustomWebsiteSale;
});
You will need to make sure that your custom module depends on the website_sale module, so it is loaded after the website_sale module, and that you add the necessary assets to your custom module so the frontend knows to use your custom class instead of the original website_sale class. You can do this by adding the following lines to your custom module's __manifest__.py file:
'depends': ['website_sale'],
'js': ['static/src/js/website_sale.js'],