Giter Club home page Giter Club logo

Comments (15)

kevccy avatar kevccy commented on September 24, 2024

Here's the fixed version of the public function,

private function _getAllVisibleItems()
{       
    if (Mage::helper('spranks_configurabletierprices')->isAdmin()) {
    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $adminquote = Mage::getSingleton('adminhtml/session_quote')->getQuote();
    $cartItems = $quote->getAllVisibleItems();
    $adminItems = $adminquote->getAllVisibleItems(); 
        return $adminItems;
    } else {
        return $cartItems;
    }
}

Currency switch now works with the module, if anyone can tidy this code will be great. Thanks for the module!

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

Thanks for the report. I still need to check the issue and will do that asap.

But your "fixed" function looks weird. $cartItems is not defined. Could you clarify what you are trying to do there?

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

Thank you for looking into it,
$cartItems is just a name for the call to get the $quote->getAllVisibleItems (); Can be change to any other name for the call "$configItems" I changed the code because of the infinite loop "Mage::getSingleton('checkout/session')->getQuote()->getAllVisibleItems();" which is causing the memory size exhausted or hangs on currency switch. What i did was just split the code to break the infinite loop the code is around the same as original but different view. I have subscribe to this issue and will await for your good news, Thank again!

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

I could reproduce the issue. I tried to come up with the best fix I can currently find. I now load the quote object if we are in the checkout process to avoid the infinite loop. Otherwise, I simply get the quote object from the checkout session.

@kevccy could you test the current master branch and give me feedback if it resolves the issue for you?

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

Yes, have tested the master branch, the currency switch still hangs and memory size exhausted. I checked the code it could may well be on line 92: "return $quote->getAllVisibleItems();" that is causing the infinite loop. I try adding an instance for it but still not fix the issue, not sure where in the code that is still causing the infinite loop.

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

What is causing the infinite loop is Mage::getSingleton('adminhtml/session_quote')->getQuote(). But when we are in the checkout, we now load the quote directly and do not get it from the session. This solves the problem in my test environment. Could you please check the output of Mage::app()->getRequest()->getRouteName() when you switch the currency and tell me what it is?

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

Fatal error: Allowed memory exhausted, "\app\code\core\Mage\Eav\Model\Entity\Collection\Abstract.php on line 1108"

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

This cannot be the output of Mage::app()->getRequest()->getRouteName(). Do you have a publicly available test system, where I can check it myself? Then please send the data to [email protected]. Otherwise, I think I cannot really help you any more.

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

I got this code on Line:1088 "$select = implode(' UNION ALL ', $selects);" could it be something to do with this? I will test the code on another new setup to see if the error still remains, if not it may well be something on the website or database causing the issue.

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

As said, the only thing which would help me would be the output of Mage::app()->getRequest()->getRouteName() when you switch the currency. You could add a var_dump(Mage::app()->getRequest()->getRouteName()); quick and dirty into my observer to see it.

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

string(20) "configurablegridview"

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

This is the output if you change the currency in the checkout/cart? Sounds like you are switching the currency on another page...

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

I think i may know where that could be causing the error, i have a module for configurable grid view. I will uninstall the module to see if works. I need a little time to test the issue, will let you know once i get the results shortly. Thanks

from customgento_configurabletierprices.

kevccy avatar kevccy commented on September 24, 2024

Got the results, master code working now, it was one of the configurable grid module was using rewrote version of template/catalog/product/view/type/options/configurable.phtml , code all works fine now, Thanks for your help!

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on September 24, 2024

Glad that it works now :-)

from customgento_configurabletierprices.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.