#StackBounty: #magento2.3 #bundled-product #x-magento-template How to display product image in summary section in bundle product page i…

Bounty: 50

we are using Magento V 2.3.5-p1

In default Magento when we select options in bundle product page the selected option will be displayed in the summary section. By default, only the quantity and name of the selected option is displayed in the summary section.

I have created one bundle product and created bundle options with input type radio button and added products in that bundle option. I have fetched and displayed product images (which were added as bundle options) on the front end.

what I want to do is display the product image with the product name when the user selects an option in the bundle product. I want display images in the summary section.

I had noticed that summary section is based on x-magento-template. So How can I display product images in the summary section? Is there a way to display product image in x-magento-template?


Get this bounty!!!

#StackBounty: #magento2.3 #php #api #shipping-methods #checkout-page Magento 2 wrong base url on ajax call on checkout page

Bounty: 50

I have upgraded the Magento version to 2.3.7. After that, I have a strange issue on the checkout page that when it calls the ajax function the URL is been wrongly generated. Previously it was like

<website>/rest/default/V1/guest-carts/AC72N37Vmo3uGMIXEVQfIDt1ubuZLJws/estimate-shipping-methods

but after upgrading the Magento version now it’s

<website>/checkout/undefinedrest/default/V1/guest-carts/AC72N37Vmo3uGMIXEVQfIDt1ubuZLJws/estimate-shipping-methods

Not sure from where this undefined gets added within the URL ??

Research Notes: –

The secure & unsecure base URL is correctly set up. I checked it again

Also, I navigated to the file from where this ajax call is generated, the file is

vendor/magento/module-checkout/view/frontend/web/js/model/shipping-rate-processor/new-address.js

enter image description here

Here is the storage. post is from the ajax call is generated and it has
service URL & payload as arguments.

in get Rates function – if we console.log "serviceUrl" then it shows the below URL

rest/default/V1/guest-carts/FsS4QvllSq1vpuxZuC8ycQa0VRMOcQCy/estimate-shipping-methods

which seem to be correct, storage.post() function takes this as an argument and ajax request is called which then gets into the .fail() function

so what I think is that the problem is where the front part of the URL gets added to it for making the ajax call that is
http://sitename.local/checkout/undefined —> and here somehow the undefined gets added which breaks the whole URL

The same issue is encountered by other users also but no solution is available yet.

undefined rest api checkout cart

https://community.magento.com/t5/Magento-2-x-Programming/Magento2-Wrong-base-url-on-ajax-call/td-p/435435

Can anyone help me out with this?


Get this bounty!!!

#StackBounty: #magento2 #magento2.3 #product-attribute #search #magento2.3.5-p2 Magento 2 – Search result not working properly on dropd…

Bounty: 50

I have a dropdown attribute brand
Use in Search is set to "Yes"
Search Weight is set to 10, tried with 7 as well
In configuration Search Engine is set to MySql

There are more than 100 products are set to attribute value like "abc" Brand

But when I search for the word abc it only shows 29 products.

Indexing are up to date.
Cache is cleared

Please guide me fix the search on dropdown attribute?


Get this bounty!!!

#StackBounty: #magento2 #magento2.3 Duplicate orders created when proforma disabled programmatically via module Magento 2.3

Bounty: 250

In my custom module I’m using a custom customer attribute called disable_proforma_email, and using a plugin to stop the proforma email being sent if it is set to yes. This is working (or at least i thought it was) until i noticed that it is creating duplicate orders. If someone was to order 10 products it creates 1 orders every couple of seconds until it hits the amount of items they ordered originally (so until it creates a 10th order)

I’m not sure why this is happening, can anyone help?

etc/di.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="MagentoSalesModelOrderEmailContainerOrderIdentity">
        <plugin name="change_is_enable_method" type="XXBlockProformaPluginSalesOrderEmailContainerOrderIdentityPlugin"/>
    </type>
</config>

Plugin/Sales/Order/Email/Container/OrderIdentityPlugin.php

<?php

namespace XXBlockProformaPluginSalesOrderEmailContainer;
use MagentoCustomerApiCustomerRepositoryInterface;

class OrderIdentityPlugin
{
    /**
     * @var MagentoCheckoutModelSession $checkoutSession
     */
    protected $checkoutSession;

    protected $resourceConnection;

    protected $_customer;

    protected $customerRepository;

    /**
     * @param MagentoCheckoutModelSession $checkoutSession
     *
     * @codeCoverageIgnore
     */
    public function __construct(
        MagentoCheckoutModelSession $checkoutSession,
        MagentoFrameworkAppResourceConnection $resourceConnection,
        CustomerRepositoryInterface $customerRepository, 
        MagentoCustomerModelCustomer $customer
    )
    {
        $this->checkoutSession = $checkoutSession;
        $this->resourceConnection = $resourceConnection;
        $this->customerRepository = $customerRepository;
        $this->_customer = $customer;
    }

    /**
     * @param MagentoSalesModelOrderEmailContainerOrderIdentity $subject
     * @param callable $proceed
     * @return bool
     */
    public function aroundIsEnabled(MagentoSalesModelOrderEmailContainerOrderIdentity $subject, callable $proceed)
    {
        $returnValue = $proceed();

        $order = $this->checkoutSession->getLastRealOrder();
        $orderId=$order->getEntityId();  // order id
        
        $connection = $this->resourceConnection->getConnection();
        $sql = "select customer_id FROM sales_order where entity_id = " . $orderId;
        $result = $connection->fetchAll($sql);
        $customerId = null;
        foreach($result as $cid){
            $customerId = $cid["customer_id"];
        }

        $customerGetValue = $this->customerRepository->getById($customerId);
        $dpe = $customerGetValue->getCustomAttribute('disable_proforma_email')->getValue();

        if($dpe == 1){
            return false;
        }
        else{
            return true;
        }

    }
}

The functionality of the proforma not sending or sending depending on the attribute is working but of course I need it to stop duplicating orders.


Get this bounty!!!

#StackBounty: #magento2.3 #webapi #json-response Return JSON response in stead of JSON String

Bounty: 50

I’m working on building REST API which will return data of regions. API is working as expected but problem I’m facing is its returning response with JSON string and not able to parse that. Would like to get JSON response.

webapi.xml

    <route url="/V1/getRegions" method="GET">
        <service class="VendorModuleApiRegionsInterface" method="getRegions"/>
        <resources>
            <resource ref="self"/>
        </resources>
    </route>

Interface

<?php
namespace VendorModuleApi;

interface RegionsInterface
{
    /**
     * @return mixed
     */
    public function getRegions();
}

Next I added preference for interface and here’s that class.

<?php
declare(strict_types=1);
namespace VendorModuleModel;

use VendorModuleApiRegionsInterface;

class Regions implements RegionsInterface
{
    public function getRegions()
    {
        $data = [
            'status' => true,
            'message' => 'We will let you know!'
        ];

        return json_encode($data);

    }
}

When I’m triggering API with above code it returns like,

"{"status":true,"message":"We will let you know!"}"

I want response to be like,

{"status":true,"message":"We will let you know!"}

Any idea how to achieve this ?


Get this bounty!!!

#StackBounty: #magento2.3 #checkout #session #payment-gateway #magento2ccavenue Magento 2 Session Expire after return from payment gate…

Bounty: 50

We are facing the session expire issue, while, return from payment gateway.

We are integrated CCavenue Magento 2.3.4 Toolkit,

we are tried following ways

  1. Cache => somebody told maybe problem of cache content checkout and cart pages, so we tried to disable full page cache, then tried.
  2. Cookie Domain Mismatch => we are given the right hostname in cookie configuration.
  3. Stickie Session => we follow this blog, they suggested to use SameSite=lax.

Still, the session expires, after return from the payment gateway. we debug our toolkit, the session is there, before redirected to the payment gateway. after return from payment gateway only. session expires.

Suggest me, what is the issue and how to fix this.


Get this bounty!!!

#StackBounty: #magento2.3 #setup-di-compile #class-not-found Compile issue: Class AreProductsSalableInterface does not exist

Bounty: 50

Having issue in setup:di:compile and give below issue

enter image description here

Already checked: Magento 2 Setup di Compile Problem

Magento Vesion: 2.3.1

Update:

If i try with command bin/magento setup:di:compile -vvv, it gives below error

[root@server httpdocs]# bin/magento setup:di:compile -vvv
Compilation was started.
Area configuration aggregation... 5/7 [====================>-------]  71% 44 secs 287.0 MiB

In ClassReader.php line 35:

  [ReflectionException]
  Class MagentoInventorySalesApiApiAreProductsSalableInterface does not exist


Exception trace:
 () at /SITE_PATH/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:35
 MagentoFrameworkCodeReaderClassReader->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php:35
 MagentoSetupModuleDiCodeReaderClassReaderDecorator->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php:53
 MagentoSetupModuleDiCodeReaderDecoratorArea->getList() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:112
 MagentoSetupModuleDiAppTaskOperationArea->getDefinitionsCollection() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:87
 MagentoSetupModuleDiAppTaskOperationArea->doOperation() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
 MagentoSetupModuleDiAppTaskManager->process() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:206
 MagentoSetupConsoleCommandDiCompileCommand->execute() at /SITE_PATH/httpdocs/vendor/symfony/console/Command/Command.php:255
 SymfonyComponentConsoleCommandCommand->run() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:893
 SymfonyComponentConsoleApplication->doRunCommand() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:262
 SymfonyComponentConsoleApplication->doRun() at /SITE_PATH/httpdocs/vendor/magento/framework/Console/Cli.php:102
 MagentoFrameworkConsoleCli->doRun() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:145
 SymfonyComponentConsoleApplication->run() at /SITE_PATH/httpdocs/bin/magento:23

In ClassReader.php line 29:
  
[ReflectionException]
  Class MagentoInventorySalesApiApiAreProductsSalableInterface does not exist


Exception trace:
 () at /SITE_PATH/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:29
 ReflectionParameter->getClass() at /SITE_PATH/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:29
 MagentoFrameworkCodeReaderClassReader->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php:35
 MagentoSetupModuleDiCodeReaderClassReaderDecorator->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php:53
 MagentoSetupModuleDiCodeReaderDecoratorArea->getList() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:112
 MagentoSetupModuleDiAppTaskOperationArea->getDefinitionsCollection() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:87
 MagentoSetupModuleDiAppTaskOperationArea->doOperation() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
 MagentoSetupModuleDiAppTaskManager->process() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:206
 MagentoSetupConsoleCommandDiCompileCommand->execute() at /SITE_PATH/httpdocs/vendor/symfony/console/Command/Command.php:255
 SymfonyComponentConsoleCommandCommand->run() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:893
 SymfonyComponentConsoleApplication->doRunCommand() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:262
 SymfonyComponentConsoleApplication->doRun() at /SITE_PATH/httpdocs/vendor/magento/framework/Console/Cli.php:102
 MagentoFrameworkConsoleCli->doRun() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:145
 SymfonyComponentConsoleApplication->run() at /SITE_PATH/httpdocs/bin/magento:23

setup:di:compile


Get this bounty!!!

#StackBounty: #magento2.3 #setup-di-compile #class-not-found Class AreProductsSalableInterface does not exist

Bounty: 50

Having issue in setup:di:compile and give below issue

enter image description here

Already checked: Magento 2 Setup di Compile Problem

Magento Vesion: 2.3.1

Update:

If i try with command bin/magento setup:di:compile -vvv, it gives below error

[root@server httpdocs]# bin/magento setup:di:compile -vvv
Compilation was started.
Area configuration aggregation... 5/7 [====================>-------]  71% 44 secs 287.0 MiB

In ClassReader.php line 35:

  [ReflectionException]
  Class MagentoInventorySalesApiApiAreProductsSalableInterface does not exist


Exception trace:
 () at /SITE_PATH/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:35
 MagentoFrameworkCodeReaderClassReader->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php:35
 MagentoSetupModuleDiCodeReaderClassReaderDecorator->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php:53
 MagentoSetupModuleDiCodeReaderDecoratorArea->getList() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:112
 MagentoSetupModuleDiAppTaskOperationArea->getDefinitionsCollection() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:87
 MagentoSetupModuleDiAppTaskOperationArea->doOperation() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
 MagentoSetupModuleDiAppTaskManager->process() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:206
 MagentoSetupConsoleCommandDiCompileCommand->execute() at /SITE_PATH/httpdocs/vendor/symfony/console/Command/Command.php:255
 SymfonyComponentConsoleCommandCommand->run() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:893
 SymfonyComponentConsoleApplication->doRunCommand() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:262
 SymfonyComponentConsoleApplication->doRun() at /SITE_PATH/httpdocs/vendor/magento/framework/Console/Cli.php:102
 MagentoFrameworkConsoleCli->doRun() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:145
 SymfonyComponentConsoleApplication->run() at /SITE_PATH/httpdocs/bin/magento:23

In ClassReader.php line 29:
  
[ReflectionException]
  Class MagentoInventorySalesApiApiAreProductsSalableInterface does not exist


Exception trace:
 () at /SITE_PATH/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:29
 ReflectionParameter->getClass() at /SITE_PATH/httpdocs/vendor/magento/framework/Code/Reader/ClassReader.php:29
 MagentoFrameworkCodeReaderClassReader->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/ClassReaderDecorator.php:35
 MagentoSetupModuleDiCodeReaderClassReaderDecorator->getConstructor() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/Code/Reader/Decorator/Area.php:53
 MagentoSetupModuleDiCodeReaderDecoratorArea->getList() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:112
 MagentoSetupModuleDiAppTaskOperationArea->getDefinitionsCollection() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Operation/Area.php:87
 MagentoSetupModuleDiAppTaskOperationArea->doOperation() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Module/Di/App/Task/Manager.php:56
 MagentoSetupModuleDiAppTaskManager->process() at /SITE_PATH/httpdocs/setup/src/Magento/Setup/Console/Command/DiCompileCommand.php:206
 MagentoSetupConsoleCommandDiCompileCommand->execute() at /SITE_PATH/httpdocs/vendor/symfony/console/Command/Command.php:255
 SymfonyComponentConsoleCommandCommand->run() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:893
 SymfonyComponentConsoleApplication->doRunCommand() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:262
 SymfonyComponentConsoleApplication->doRun() at /SITE_PATH/httpdocs/vendor/magento/framework/Console/Cli.php:102
 MagentoFrameworkConsoleCli->doRun() at /SITE_PATH/httpdocs/vendor/symfony/console/Application.php:145
 SymfonyComponentConsoleApplication->run() at /SITE_PATH/httpdocs/bin/magento:23

setup:di:compile


Get this bounty!!!