Site logo

[Resolved] Sticky add to cart at composite products

Home Forums Support [Resolved] Sticky add to cart at composite products

Home Forums Support Sticky add to cart at composite products

Viewing 14 posts - 31 through 44 (of 44 total)
  • Author
    Posts
  • #2364427
    Tom
    Lead Developer
    Lead Developer

    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!

    #2364501
    roadlink

    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.

    #2382408
    roadlink

    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.

    #2383490
    Tom
    Lead Developer
    Lead Developer

    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.

    #2391902
    roadlink

    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.

    #2399199
    Tom
    Lead Developer
    Lead Developer

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

    #2399314
    roadlink

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

    #2402219
    Tom
    Lead Developer
    Lead Developer

    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.

    #2402548
    roadlink

    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

    #2402579
    roadlink

    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>’,

    #2407345
    Tom
    Lead Developer
    Lead Developer

    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?

    #2407678
    roadlink

    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.

    #2415808
    Tom
    Lead Developer
    Lead Developer

    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?

    #2420339
    roadlink

    Hi Tom,
    I didn’t add it as far as I remember 🙂

Viewing 14 posts - 31 through 44 (of 44 total)
  • You must be logged in to reply to this topic.