Giter Club home page Giter Club logo

Comments (10)

sprankhub avatar sprankhub commented on June 23, 2024

Thanks for your useful feedback. Indeed, the tagged version is quite old. I would accept a pull request with such a change. Afterwards, I would tag a new version. Mind that we switched the namespace from Spranks to CustomGento though.

from customgento_configurabletierprices.

shineability avatar shineability commented on June 23, 2024

Great, one pull request coming up! :)
We're aware of the changed namespace, btw...

from customgento_configurabletierprices.

shineability avatar shineability commented on June 23, 2024

@sprankhub

In the observer on line 58...

if ($item->getParentItem()) {
    continue;
}

Is that used to filter out non-configurable products?

If so, isn't that already covered by...

if (Mage::registry('current_product') || !$product->isConfigurable()) {
    return $this;
}

If not, please explain :)

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on June 23, 2024

It's been a while since I wrote this code :-)

Mind that we iterate over all visible quote items and then filter by $item->getParentItem(). This has nothing to do with the current product. Hence, I guess both filters make sense.

from customgento_configurabletierprices.

shineability avatar shineability commented on June 23, 2024

Correct, I realized that right after posting my comment :)

I'm still a bit confused, though.
I have one simple product and two configurable products (t-shirts - medium and large).
I would have expected that for the two t-shirts, $item->getParentItem() would return the parent configurable product, but then the code wouldn't work of course...

So I think my question is, what scenario is the if statement covering? Bundled products?

(Hope I'm making sense)

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on June 23, 2024

Mind that $item->getParentItem() returns a quote item and not a product. If you add a configurable product to the cart, there are two quote items - a parent and a child item. Simply add a configurable product to the cart and check the quote item table. This should make things a bit clearer.

from customgento_configurabletierprices.

shineability avatar shineability commented on June 23, 2024

Aha, makes sense, tnx!

from customgento_configurabletierprices.

shineability avatar shineability commented on June 23, 2024

Actually, checking for $item->getParentItem() is not necessary since you're using getAllVisibleItems()...

It's already being filtered out in Mage_Sales_Model_Quote...

public function getAllVisibleItems()
{
    $items = array();
    foreach ($this->getItemsCollection() as $item) {
        if (!$item->isDeleted() && !$item->getParentItemId()) {
            $items[] =  $item;
        }
    }
    return $items;
}

You agree?

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on June 23, 2024

I think you should be right :-)

from customgento_configurabletierprices.

sprankhub avatar sprankhub commented on June 23, 2024

This will be fixed with #34.

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.