Site logo

Archived topic

Sticky add to cart at composite products

43 replies · Started by roadlink on April 8, 2021

Viewing posts 31–44 of 44

Hi there,

We haven't been able to tackle this yet, sorry!

Reviewing this thread now, but I'm unsure what's outstanding vs what was fixed. Do you have an updated list of things that are broken on our end so I can investigate for GPP 2.3?

Thanks!

Hi Tom,

Sure. Sticky add to cart is completely off in composite products.
Thus we use custom codes to make it work.
I just added the codes in below. Between 76-100 I believe.

Hi Tom,
We moved to pressable.com as hosting.
And changed some part of this plugin. Not GP part actually.

But now add to cart button doesn't work at all.
I mean you click it but it doesn't add to cart.

Any advice would be great.
I just shared codes again.

Is there a page where I can test the add to cart button to see the issue? I'm not seeing anything obviously wrong with the code.

Hi Tom,
Developer added few more line to JS and solved it.

jQuery(function () {
jQuery(".custom-add-to-cart").click(() => {
jQuery('button[name="add-to-cart"]').click()
});

I just shared staging site's info in below.

Very strange, that code should definitely not be necessary. Did they give an explanation for why that code worked?

nope.
And unfortunately this is different developer.
We don't work with the other one anymore.

So they're not sure why they decided to write that code?

I'm having a tough time seeing what exactly we need to fix in the plugin. For example, what problem was being solved? If we know the problem, we can replicate it and see if it's something we can improve within the plugin itself so strange code like the above isn't necessary.

Hi Tom,
Sorry to keep you busy.

Plugin was having solve few issues in old hosting with old plugins.
We have renewed hosting and get rid of some plugins which are encrypted with iconcube.

So we ask new developer to get rid of the old unnecessary codes and make it work.
They did it but it didn't work for add to card button.
Simply button was doing nothing.

Latest code solved this issue.
I am putting old plugin and new plugin just for reference.

Again, I somehow solved my case. But I am kindly check if you can make GP compatible with composite products.

Thanks

I just compared the codes and saw that they changed 1 line.
Maybe they have that this line and broke it, then need to add these lines?

OLD
'<form action="%1$s" class="cart%2$s" method="post" enctype="multipart/form-data">%3$s<button type="submit" class="button alt">%4$s</button></form>',

NEW
'<form action="%1$s" class="cart%2$s" method="post" enctype="multipart/form-data">%3$s<button type="button" class="button alt custom-add-to-cart">%4$s</button></form>',

I'm not sure what difference that would make, really. However, I'm definitely missing context.

I'll try to test out the composite plugin, but I'm still not 100% sure what kind of incompatibility I should be looking for. Is there anything specific you'd like me to test/debug?

Hi Tom,

Above changes solved the problem and no need to add below lines. So, we come back to original discussion.

jQuery(function () {
jQuery(“.custom-add-to-cart”).click(() => {
jQuery(‘button[name=”add-to-cart”]’).click()
});

Let me explain what the issues are.

When we open a composite products sticky add to cart bar can't be shown.

Composite products plugin takes regular add to cart button and put it at end of the page.
I believe that may be one of the reasons for this problem.

I believe they are manipulating something about add to cart button.

What we did via this plugin is simply copy "add to cart" button which created by composite products plugin and show it in sticky bar.

We add a control.
If this is composite product
Copy composite products plugin's add to cart button and put it sticky bar.

Just fyi.
Composite products plugin removes regular add to cart button and put their add to cart button to end of the page.
It is different than what users get used to. We have report this to team and put it back :), but till now no progress.

I think the generate_wc_sticky_add_to_cart_action filter is the way to integrate this, but it really depends on what they're changing about the normal add to cart button.

Are you still using that filter anywhere on the site?

Hi Tom,
I didn't add it as far as I remember :)

This archived topic is closed to new replies.