Custom code not working inside my cms/eccomerce structure

Hi everyone,

So I’m struggling with my latest project, which is a profile database with a booking (ecommerce) attached to it.

The main structure is a product collection with filters, but instead of directing traffic to each product page individually, I used an easy-to-navigate (open/close) pop-up window for each profile.

Because I’m not really on the profile/product page, my custom code is not running on the pop-up windows. It is running properly on the product pages, though.

Problem 1: I have an age calculator running on each profile based on the date of birth, which isn’t working on the profiles but is working on the cards themselves (see project link).

Problem 2: My add to cart button is not registering which profile/product page is currently getting the demand to add.

Any help or insight would be much appreciated!


Here is my site Read-Only:

https://preview.webflow.com/preview/the-profiles?utm_medium=preview_link&utm_source=designer&utm_content=the-profiles&preview=cd44f787db09141ed86fe9350a9a0d9c&pageId=6659b964ee4e86d22b670731&locale=en&workflow=preview

@memetican any ideas? :wink:

Hi Ruben, I don’t work with Webflow’s ECom enough to have many recommendations here, and I can see you’re using it somewhat creatively. It would take me a little time to unpack your setup and solve your two issues properly.

But I can give you two guesses that might help you-

For the age calc, that would likely be JS that you need to also have on your profiles page as well. I don’t see any code there in the designer.

For the Add to Cart button, you will need to work with Webflow’s ECom design on this. You might be able to fix it in your popup design directly, but if not, you could potentially place a proxy button in the popups that triggers some JS which clicks a second, hidden add to cart button in a separate set of collection lists.

1 Like

Tried fixing issue one first, the age calculator and code is now placed correctly on all pages, but instead of displaying, nothing is visible. If I redirect on the page itself, it works fine…

Anyone else have experience with this specific?

On pop up modal:

On product page itself:

In regards to Problem 1: We also ran across this issue in a client project and created a script that allows you to fill an age output based on a date input.

Here is a link to the tutorial video that goes through the problem as well as walking you through the solution.

If there are any questions please feel free to tag me!

Happy Friday!