up sell – Magento2, how you can use the object manager to get an upsell product on the category list

Note: First, it is not recommended to use the Object Manager directly on a file. Use only the Magento standard

The following code is only intended to show how we can easily get the upsell product on the category list page.

$objectManager = MagentoFrameworkAppObjectManager::getInstance();
$category = $objectManager->get('MagentoFrameworkRegistry')->registry('current_category');
$categoryId = $category->getId();
$categoryFactory = $objectManager->get('MagentoCatalogModelCategoryFactory');

$category = $categoryFactory->create()->load($categoryId);
$categoryProducts = $category->getProductCollection()
                         ->addAttributeToSelect('*');

foreach ($categoryProducts as $product) {
    $current_product_id = $product->getId();
    $current_product = $objectManager->create('MagentoCatalogModelProduct')->load($current_product_id);
    if ($current_product) {
    $upSellProducts = $current_product->getUpSellProducts();

    if (!empty($upSellProducts)) {
        foreach ($upSellProducts as $upSellProduct) {
                $productId = $upSellProduct->getId();
                $product = $objectManager->create('MagentoCatalogModelProduct')->load($productId); 
                echo 'Upsell Product name---'.$product->getName().'

'; } } } }

magento2 – I want to connect Odoo 12 to Magento 2.3.4

I am a beginner and need advice [end of study project]

I want to connect Audio 12 to Magento 2.3.4 using the old magenta connector.
It is possible!!
is it possible with old magento connector?

And I found some points in the documentation that ask me questions, for example:

1] Compatible with the latest version of Odoo 8.0 and the latest versions of Magento.

2] I cannot find this path. "Go to System> Web Services> SOAP / XML-RPC – Roles in the Magento administration area."

If you have an idea, please guide me

magento2 – Magento 2: Implement the function columnControls (hide / show) in a user-defined administrator grid

Here I created a user-defined grid (within admin) with block. Now I want to add the controlColumns (Hide / Show) function to this custom grid.
With the Ui component, it's easy to add this functionality using the following code (on the grid list page):


But I want to put this functionality in a custom grid that is created with block.

I am also attaching an image file related to this problem.

Enter the image description here

Please give me an idea how I can achieve it. Any help is appreciated.

magento2 – Custom password check in register.phtml

I know there are some password verification answers already, but I have another problem here.

I follow this answer

My custom validation has been added, but it depends on the value of store_config. If the administrator selected Yes for the numeric value, the password must have a numeric value that is the same for capital and special characters.

I am trying to create a script that checks whether the password is perfect according to the value of store_config or not.


Nothing is currently displayed, but when I // $. remove mage (), a message appears, but it does not meet the requirements.

Let me know if I make a mistake in my loop.

Thanks a lot

magento2 – Magento 2 – class provider module model cbdom_main does not exist?

I try to integrate myself Ccavenuepay in my shop, but when I click on order it gives me errors like

a:4:{i:0;s:60:"Class MagekmfCcavenuepayEmiModelCbdom_main does not exist";i:1;s:7558:"#0 /home/dell/workspace/local.magento2/public/vendor/magento/framework/ObjectManager/Definition/Runtime.php(44): MagentoFrameworkCodeReaderClassReader->getConstructor('Magekmf\Ccavenu...')

Enter the image description here

I also created the class Cbdom_main.php, but the bug is not fixed. please help

magento2 – What is the difference between the customer attribute properties user_defined and system and what are they used for?

How to create a customer attribute is explained in different answers like this or that. What they all have in common is that when the attribute is created, its properties are present user_defined and system are always defined as follows:

'user_defined' => true,
'system' => false,

It doesn't work for me. If you set the properties as shown above, the attribute will not appear in the customer adminhtml edit form. When setting user_defined => false and system => true it is displayed but now saved. It only works (in form and save) if both properties are set to false.

So my question is, what's the difference between the two properties and what are they used for?

magento2 – How to get the Magento 2 customer group ID

How do I get the Magento 2 customer group ID when the user is logged in to an HTML file?
I've already tried:

protected $_customerSession;

public function __construct(
    MagentoCustomerModelSession $customerSession,
) {
    $this->_customerSession = $customerSession;
}

public function getGroupId(){
if($this->_customerSession->isLoggedIn()):
    echo $customerGroup=$this->_customerSession->getCustomer()->getGroupId();
endif;
}

but it doesn't work, I get this error:

Parse error: syntax error, unexpected 'protected' (T_PROTECTED), expecting end of file in..

Magento2 customer registration – change the template text during checkout

Is it possible to change the text displayed? "You can track your order status by creating an account." at the checkout for customer registration through the MAGENTO backend?

* This must be done in the Magento backend because the text has to be localized and translated into the different languages ​​of the different shops. Also, I'm not a developer and I can't access the code.

Enter the image description here

This question has been resolved at
Magento2 customer registration during checkout.

However, since I am not a developer, I cannot access the code. And I need another solution.

Thanks a lot

magento2 – move custom options under the main image

Regards Stack Community –
I want to move the first custom option group under the main picture (see picture). Separating the options is probably not that easy, so I think moving the "Add-to-Cart Options" button on its own line in front of the main description registers is the solution (then I could just format it with CSS). .

Move a group of custom options under the main image

How would I do that in the catalog_product_view.xml File?



    
        
    
    
    
    
    
    
    
        
        
    
    
        
    
    
    
    
        
    
    
        
        
        
        
    
    
    
    
        
    

Thanks in advance for any help.