A space to discuss online store customization, theme development, and Liquid templating.
Hey! Now I am making an application in which there will be an extension that will be installed on the product page in the store. It is necessary that the extensions dynamically adjust (find) a place, for example, under the buy button.
Is it possible to implement this? Since the classes or attributes of each theme may be different.
Or you can still do it only through the instruction so that the user adds the snippet to the page manually.
thanks in advance
Use jQuery to select the element on the page where you want to insert the extension. For example, you can use a CSS selector to target the "Buy" button:
var buyButton = $('.buy-button-selector');
Create a new element for the extension and insert it after the selected element. For example:
var extensionElement = $('<div>My extension goes here</div>');
buyButton.after(extensionElement);
Style the extension element using CSS to ensure it is positioned correctly relative to the selected element.
If this fixed your issue, likes and accepting as a solution are highly appreciated
| Build an online presence with our custom-built Shopify Theme: EcomifyTheme
| Check out our reviews: Trustpilot Reviews
| We are Shopify Partners: EcomGraduates Shopify Partner