• Resolved webbus

    (@webbus)


    At the moment we are working on a multisite where two webshops share one shopping cart with the plugin WooGlobalCart.
    Only Mollie appears to miss a number of filters to be able to checkout products from both webshops in one cart.

    It’s about:

    if (isset ($ cart_item [‘blog_id’]))
    switch_to_blog ($ cart_item [‘blog_id’]);
    and

    if (isset ($ cart_item [‘blog_id’]))
    restore_current_blog ();

    it’s for the file: mollie-payments-for-woocommerce\includes\mollie\wc\helper\orderlines.php

    Is there a possibility that this can be included with a next update? I’m afraid that if we add this manually, it will not work with a next update or will be removed. Do you perhaps have a solution for this?

    • This topic was modified 7 years, 1 month ago by webbus.

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Contributor davdebcom

    (@davdebcom)

    Hi @webbus

    What files are you referring to?

    Kind regards
    David

    Thread Starter webbus

    (@webbus)

    Wow, you are fast.

    The file would be
    mollie-payments-for-woocommerce\includes\mollie\wc\helper\orderlines.php

    Plugin Contributor davdebcom

    (@davdebcom)

    As far as I can see the code you mention isn’t in that file. Can you share more information, or possibly a guide explaining what you are trying to do? Does this WooGlobalCart have a manual for developers?

    I can then review it and then we can decide if we will support this in the Mollie plugin.

    Thread Starter webbus

    (@webbus)

    Hello Davdebcom,

    Sorry I’m not completely clear.
    We contacted WooGlobalCart after everything was put together but after testing we continued to get a server error during checkout.

    We contacted Mollie and WooGlobalCart.
    It was giving the following error

    “Internal server error”.
    Mollie gives us the following message:
    2019-02-11T14: 16: 28 + 00: 00 CRITICAL Uncaught Error: Call to a member function get_sku () on boolean in /var/www/vhosts/decorabel.nl/httpdocs/wp-content/plugins/mollie-payments -for-woocommerce / includes / mollie / wc / helper / orderlines.php: 375
    Stack trace:
    # 0 /var/www/vhosts/decorabel.nl/httpdocs/wp-content/plugins/mollie-payments-for-woocommerce/includes/mollie/wc/helper/orderlines.php(90): Mollie_WC_Helper_OrderLines-> get_item_reference (false )
    # 1 /var/www/vhosts/decorabel.nl/httpdocs/wp-content/plugins/mollie-payments-for-woocommerce/includes/mollie/wc/helper/orderlines.php(52): Mollie_WC_Helper_OrderLines-> process_cart ()
    # 2 /var/www/vhosts/decorabel.nl/httpdocs/wp-content/plugins/mollie-payments-for-woocommerce/includes/mollie/wc/payment/order.php(120): Mollie_WC_Helper_OrderLines-> order_lines ()
    # 3 /var/www/vhosts/decorabel.nl/httpdocs/wp-content/plugins/mollie-payments-for-woocommerce/includes/mollie/wc/gateway/abstract.php(413): Mollie_WC_Payment_Order-> getPaymentRequestData (Object (WC_Order), NULL)
    # 4 /var/www/vhosts/decorabel.nl/httpdocs/wp-conte in /var/www/vhosts/decorabel.nl/httpdocs/wp-content/plugins/mollie-payments-for-woocommerce/includes/mollie/ wc / helper / orderlines.php on line 375

    The server gives the following error:

    GET /wp-content/plugins/woo-global-cart/sync/woogc-pong.php?woogc_hash=0&rand=6614846&bounce=https://www.decorabel.nl/wp-content/plugins/woo-global-cart/sync/woogc-ping.php HTTP/1.0

    [client “ip adres”] ModSecurity: Access denied with code 403 (phase 2). Match of “beginsWith %{request_headers.host}” against “TX:1” required. [file “/etc/apache2/modsecurity.d/rules/tortix/modsec/50_plesk_basic_asl_rules.conf”] [line “179”] [id “340162”] [rev “294”] [msg “Protected by Atomicorp.com Basic Non-Realtime WAF Rules: URL detected as argument, possible RFI attempt detected”] [data “%TX:1,TX:1”] [severity “CRITICAL”] [hostname “blancotextiel.nl”] [uri “/wp-content/plugins/woo-global-cart/sync/woogc-pong.php”] [unique_id “XGKMvX8AAQEAAAU58HoAAAAN”], referer: https://www.domainname.nl/wp-content/plugins/woo-global-cart/sync/woogc-ping.php

    Mollie indicates that they can not get the SKU from the order because of the Globalcart plugin.

    After this problem they looked from WooGlobalCart into the problem on our multisite and found the following findings.

    “Unfortunate the Mollie plugin does not include the required filters to allow a workaround to be implemented through such way, so you need to modify a file:
    File wp-content\plugins\mollie-payments-for-woocommerce\includes\mollie\wc\helper\orderlines.php
    Near Line 78 at function process_cart()

    1) After
    foreach ( WC()->cart->get_cart() as $cart_item ) {
    if ( $cart_item[‘quantity’] ) {

    Add

    if( isset($cart_item[‘blog_id’]))
    switch_to_blog( $cart_item[‘blog_id’] );

    2) After
    $this->order_lines[] = $mollie_order_item;

    Add

    if( isset($cart_item[‘blog_id’]))
    restore_current_blog();

    After above changes, everything will work fine. ”

    But this will give a problem with every new update.

    Documentation from Wooglobalcart:
    https://wooglobalcart.com/documentation/
    https://wooglobalcart.com/articles/

    Hopefully it has become a little clearer.
    If you want to know something, I’d like to hear that.

    Regards and thank you for your time,
    Glenn

    • This reply was modified 7 years, 1 month ago by webbus.
    Plugin Contributor davdebcom

    (@davdebcom)

    Thank you, I think I now have enough info. I’ll review everything next week.

    Thread Starter webbus

    (@webbus)

    Hello Davdebcom,

    Do you maybe have an update for me about the progress?

    Thanks and a nice weekend!

    Plugin Contributor davdebcom

    (@davdebcom)

    Hi @webbus

    Could you ask the people at WooGlobalCart if they have enough if we implement these hooks in the Mollie plugin. They should be able to then add custom process there.
    https://take.ms/hqrXU

    Kind regards
    David

    Thread Starter webbus

    (@webbus)

    Hello David,

    Good news!

    They answered me:

    Yes it looks fine to me, it will be enough to create a compatibility module within our code. Please let me know when the code become available and i’ll check it further.

    Regards,
    Glenn

    Plugin Contributor davdebcom

    (@davdebcom)

    Hi @webbus

    Good to hear it!

    > Please let me know when the code become available and i’ll check it further.

    I might be misunderstanding, but it looks like they are assuming we will build the integration with their plugin. That is not so. We have made the hooks available, they will be in 5.1.1 (next week). But either yourselves or WooGlobalCart will have to develop the actual code snippets/integration.

    Please let me know if anything is unclear or you need anything else.

    Kind regards
    David

    Thread Starter webbus

    (@webbus)

    Hi David,

    No, they just need the filters that were mentioned.
    They have there own plugin that just needs those filters to work on a multisite of WordPress.

    Thank you and we will see the update soon.

    When it all works, I will let you know.

    Kind regards,
    Glenn

    Plugin Contributor davdebcom

    (@davdebcom)

    Great!

    Thread Starter webbus

    (@webbus)

    Hello David,

    It’s all working perfect.

    Thanks!

    Regards,
    Glenn

    Plugin Contributor davdebcom

    (@davdebcom)

    Hi @webbus

    Good to hear that, thank you!

    Regards
    David

    Thread Starter webbus

    (@webbus)

    Hello David,

    Unfortunately, another error crept in with the new update from Mollie.
    We reviewed this together with WooGlobalCart and came up with the following:

    It appear there’s a bug in Mollie plugin, they add a new code block but it miss an action.

    WooGlobalCart already sent a fix proposal. That’s the message bug report from nsp-code.com
    Hopefully they can do something with this. Since we cannot update Mollie without the webshop being unable to pay.

    Regards,
    Glenn

    Plugin Contributor davdebcom

    (@davdebcom)

    Can you give me a direct link to that proposal. I don’t see it anywhere.

Viewing 15 replies - 1 through 15 (of 16 total)

The topic ‘Multisite, two webshops with one cart’ is closed to new replies.