Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #639766

    Hi,

    I have a new installation of WordPress, WooCommerce, Enfold & Foodpress (a food menu/ordering plugin). The Add to Cart button which sits on the products through Foodpress works on the standard Twenty Sixteen theme, but with Enfold enabled the button does not actually add any product to the cart, although all of the messaging remains as if it does (button changes text to ‘Added’ & the ‘Product Added to Cart’ message appears below the Mini-Cart icon).

    Are you able to determine what it is with Enfold which is preventing this functionality? The Foodpress plugin developers have stated that the functionality is designed just to work on the base Woocommerce install which it does, so this is a theme issuing.

    Ben

    #639771

    Hey,

    Sounds like a theme-plugin issue indeed, try disabling enfold’s WC Js modifications, go to /config-woocommerce/config.php and remove/comment:

    	wp_enqueue_script( 'avia-woocommerce-js', AVIA_BASE_URL.'config-woocommerce/woocommerce-mod.js', array('jquery'), 1, true);
    

    Best regards,
    Josue

    #639788

    Hi Josue,

    I commented out & it solved the Add to Cart issue but it removed all the other dependent functionality (not sure which is Enfold and which Foodpress), like showing the dynamic number of items on the mini-cart & having adjust quantity buttons in the cart & on product listing :(
    Is there a way of isolating this single action re. Add to Cart button?

    Regards, Ben

    #639870

    Hi,

    Try removing some functions in the actual file (woocommerce-mod.js, i’m not sure which block could be causing the issue.

    Best regards,
    Josue

    #639950

    Hi,
    In the woocommerce-mod.js I eventually isolated the issue: it was in Line 25 where the + & – buttons live,

    var minus = jQuery('<input type="button" value="-" class="minus">').insertBefore(newNum),

    Specifically .insertBefore is coloured as a function in Sublime unlike insertAfter & is causing the issue. If I remove this line everything works, & if I use .insertAfter instead then everything works. However, in the former case there’s no minus button & in the latter there’s a misplaced minus button sitting to the right of the plus button not the left of it. I would like formatted buttons & everything to work. Can you suggest a re-write to have this all work, or if there is something associated with .insertBefore elsewhere in my set-up, how I would find that (I can’t think of a ctrl+f way of doing that?)?

    Thanks,
    Ben

    #640314

    Hi Ben

    I’m really sorry but unfortunately making third-party plugins compatible with the theme is beyond the support scope we can offer.

    Regards,
    Josue

    #640330

    Hi Josue,

    I have to strongly disagree here — your theme is affecting the basic Woocommerce functionality as the third-party plugin works fine with just WooCommerce using WooCommerce hooks. I’ve done the work isolating the 12 letters of your function which causes the error but I don’t know enough to know why InsertBefore doesn’t work but InsertAfter does — there must be a reason. I’ve also highlighted for you that Sublime Text is showing it as a function — does this strike you as odd or help you to figure out a possible reason for this?

    Happy to help locate a solution by doing what I can my end, but I have to insist a work-around is found here, or at a minimum this issue is escalated to someone who wrote the codebase.

    Regards,
    Ben

    #640334

    Hi,

    It’s a conflict between the plugin and the theme’s WC modification, either way, in this case:

    in the latter there’s a misplaced minus button sitting to the right of the plus button not the left of it

    Does it gets fixed? if so, you could apply that and adjust the button position with CSS.

    Best regards,
    Josue

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.