I created an observer for catalog_product_upsell to add products from the same category, but I'd like to show bundle products first, if there are.

So i check collection by a logger:

$upsell = $observer->getCollection();
$this->logger->debug(print_r($upsell->getAllIds(), true));

but bundle products ar not there.

My module.xml is:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Vendor_UpsellProducts" setup_version="1.0.0">
            <module name="Magento_Catalog"/>
            <module name="Magento_Bundle"/>

How can I get my observer called after the bundle module observer?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.