texts: Magento upgrade problem Fatal error: Uncaught Error: Cannot instantiate interface

texts:
I upgraded from Magento 2.3.4 to 2.4.0
And now I'm getting the following error when running the indexer.
Fatal error: Uncaught Error: Cannot instantiate interface Magento\InventoryCatalogApi\Api\DefaultStockProviderInterface in /app/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php:121

If I disable Magento_InventoryIndexer then the indexer works again but doesn't actually index.
Thanks


texts: Show different wishlist icon, if user has added the icon in his wishlist

texts:
I need to show different wishlist icons when user has added the product to his wishlist.

So, there is icon A (default) and icon B (when user is logged in and has added product to his wishlist already)

I use bootstrap glyphicons.

I was able to achieve this on product pages, but cant get it done on Category listing pages.

Here is the code I have on addto.phtml which works on single product page.

<a href="<?php echo $_wishlistSubmitUrl ?>" onclick="productAddToCartForm.submitLight(this, this.href); return false;" class="link-wishlist btn btn-link">
    <?php
        // Show different icons if product is already added in wishlist
        $isAddedInWishilist = false;
        $_wishlistCollection = Mage::helper('wishlist')->getWishlistItemCollection();
        if($_wishlistCollection){
            $_wishlistCollection->addFieldToSelect('product_id');
            $_wishlistCollection->addFieldToFilter('product_id',$_product->getId());
            if(count($_wishlistCollection)==1) {
                $isAddedInWishilist = true;
                echo '';
            } else {
                echo '';
            }
        }
 ?>

        <?php echo $this->__('Add to Wishlist') ?>

Same code on category pages doesnt work correctly. If user has added at least one product in his wishlist, then on category listing page, it displays icon B on all products, instead of showing icon B only on that specific product that user added to his wishlist.

Following is the code i have on list.phtml (for Category listing) right now.

                <?php if ($this->helper('wishlist')->isAllow()) : ?>
                    <a href="<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class="link-wishlist btn btn-link wishlist-icon-category-page">
                        <?php // echo $this->__('Add to Wishlist') ?>
                <?php endif; ?>


texts: magento 2 crash after set to Client side less compilation

texts:
i'm working on magento 2.2.2 .after i set client side less compilation mod (default value is server side compilation mod can be accessed via STORES > Configuration > ADVANCED > Developer > Front-end development workflow > Server side less compilation) magento crashed.
i got this error when refresh home page see the following screenshot

and when i run php magento setup:static-content:deploy -f i got the following errors see the following screen shot

can anyone help me ?!


texts: Magento 1.9 and SLOW sidebar menu with lots of categories

texts:
I've heard that Magento's (all versions) Categories/Subcategories logic is slow, and resource intensive if you have lots of categories. I've got over 2500 categories and probably will be adding more. My site loads very slow now, and I'm starting to get concerned and worried. I pinpointed the slowness to the cateogylist.phtml and sidebar menu.

Question: Can Magento handle this many categories and process sidebar navigation efficiently?

I have heard from several developers that Magento is a slow dog if you have many categories.

Please advise.


texts:
In Magento I have this to get the the url of a category from its ID

$categoryLink = Mage::getModel("catalog/category")->load(10)->getUrl();

It works but at the end of url there is ?SID=somenumber.

I know I could remove it from

System > Configuration > Web > Session Validation Settings > Use SID on Frontend

But I want to keep it active, so how can i get the url of category without the ?SID=somenumber?


texts:
I have to trigger the void on click of cancel button in admin orders. For this i am using below code in Magento/Payment/Model/Method/Adapter.php
public function cancel(InfoInterface $payment)
{
try {
$this->void($payment);
} catch (\Exception $e) {
$this->_logger->critical($e);
throw new LocalizedException(__('There was an error voiding the transaction: %1.', $e->getMessage()));
}
return $this;
}
but it's not working. Please help if anybody has info on it.


texts: Configuration default Values not showing in magento 2

texts:
I have set default file name in textbox but it's not working. Can you please guide me where I went wrong?

my Code is:

app/code/learning/Custom/etc/adminhtml/system.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../Config/etc/system_file.xsd">
    <system>
        <tab id="custom" translate="label" sortOrder="0">
            Custom Extension
        </tab>

            Customer
            <tab>custom</tab>
            <resource>Learning_Custom::config_custom</resource>
            <group id="magento_customer_logs" translate="label" type="text" sortOrder="4" showInDefault="1" showInWebsite="1" showInStore="1">
                Magento Customer Logs
                <field id="magento_request" translate="label" type="text" sortOrder="1" showInDefault="1" showInWebsite="1" showInStore="1">
                    Magento Customer Request
                </field>
                <field id="magento_response" translate="label" type="text" sortOrder="2" showInDefault="1" showInWebsite="1" showInStore="1">
                    Magento Customer Response
                </field>
            </group>

    </system>
</config>

app/code/learning/Custom/etc/acl.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Magento_Backend::stores">
                    <resource id="Magento_Backend::stores_settings">
                        <resource id="Magento_Config::config">
                            <resource id="Learning_Custom::config_custom" title="Custom Section" sortOrder="80" />
                        </resource>
                    </resource>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

app/code/learning/Custom/etc/config.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Store/etc/config.xsd">
    <default>
        <custom_customer>
            <magento_customer_logs>
                <magento_request>magento_request</magento_request>
                <magento_response>magento_response</magento_response>
            </magento_customer_logs>
        </custom_customer>
    </default>
</config>

Could you please let me know where I went wrong?


texts: In Magento how to find the customer's visit is from the Google Results Page

texts:
As we are moving from the classic google analytics to the Universal google analytics for the marketing requirement, i need to find out from where the customer is coming from. If he is coming from the marketing campaigns then we have the param utm_source from url. So with this I can find out the customer visit. But if the customer is from the google results, then there will be no extra parameters added to the URL.

Because of this, I am unable to differentiate whether the customer is from the Google Results or from the direct URL visit. My idea is to use, HTTP_REFERRER. But this will result in lot of requests to server for each page load which results in unnecessary load on server.

Universal google analytics does support _utmz cookies. It will only supported in classic google analytics. So is there any better way to differentiate the customer visit from the google results and the direct URL visit.


texts: How to extract/get a xml attribute values to display

texts:
I am trying to integrate open weather api in my application and I have invoked weather api and it's returned xml response. But when I am trying to get the values it's throwing error like unknown error.

My code is:

js code:

above code returning below format:

Could you please suggest me how to get the xml values to display?


texts: Magento 1.9: Add property to Mage_Customer_Model_Attribute

texts:
I try to implement a Honeypot on the customer/create form. Therefor I want to implement one input that is prohibited to fill out. All input fields are put into a Mage_Customer_Model_Attribute with several scope properties like scope_is_required that are used for the decision. I want to add a property like scope_is_prohibited but have no idea how.

What I don't want is to add some hardcoded $_REQUEST['myprohibitedfield'] into the validation as I want to keep the field name as flexible as possible, even might add several such fields.

What I do have is a working module with overwritten Models.

Did anyone have the same problem? Or maybe a totally different approach instead of a scope property?


texts: Different shipment charges in magento 1.7?

texts:
How to add different shipping charges to products in Magento 1.7.0.2 and performing different shipping methods in the same.

Thanks.!


texts: Magento 2 check customer is new on Around plugin on Create New account

texts:
How can i check if customer is new in magento 2 using around plugin for Create account action ?
I am trying to check if customer is new then i will send a track event to segment.
Let me know your ideas (according to best practice) how can one achieve this implementation ?
Thankyou


texts: How to Sortable custom columns in magento 2

texts: I want to Sortable custom columns in Product listing Grid. But custom columns not exit in DB.So i want to sortable columm but not exits in DB.


texts: How to change the top position of a div with respect to another div dynamically?

texts:
For now I have displayed the div like this

the code is

createWindow: function()
{
    var qWindow = new Element('div', {id: 'quick-window'});
    qWindow.innerHTML = '
close

';
    document.body.appendChild(qWindow);
    $('quickview-close').observe('click', this.hideWindow.bind(this));
},
showWindow: function()
{

    $('quick-window').setStyle({
        top:  document.viewport.getScrollOffsets().top + 100 + 'px',
        left:  document.body.clientWidth/2 - $('quick-window').getWidth()/2 + 'px',
        display: 'block'
    });
},

I need the position to be changed dynamically..accoring to the product list height in magento.. Something like this

Need your help..
I am using prototype.js


texts:
I am trying to call getProducts method from content.phtml file.

Block file:

class AdminModules_Topjob_Block_Topjob extends Mage_Core_Block_Template
   {
        public function getProducts($pro_cond, $terminal_block)
        {
           $model = Mage::getModel('topjob/topjob');
           return $model->getProductsByCond($pro_cond, $terminal_block);
        }
   }

Content.phtml :

$myProducts = $this->getProducts('24 - 16 AWG', '2-CONDUCTOR TERMINAL BLOCKS');

Layout file:

<?xml version="1.0"?>
<layout version="0.1.1">
    <topjob_index_index>
        <reference name="content">
            <block type="topjob/content" name="topjob" template="topjob/content.phtml" />
        </reference>
    </topjob_index_index>
</layout>

Error:

Invalid method Mage_Core_Block_Template::getProducts(Array
(
    [0] => 24 - 16 AWG
    [1] => 2-CONDUCTOR TERMINAL BLOCKS
)
)

Trace:
#0 /home/usauto/public_html/app/design/frontend/b-responsive/default/template/topjob/content.phtml(90): Varien_Object->__call('getProducts', Array)
#1 /home/usauto/public_html/app/design/frontend/b-responsive/default/template/topjob/content.phtml(90): Mage_Core_Block_Template->getProducts('24 - 16 AWG', '2-CONDUCTOR TER...')
#2 /home/usauto/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/usauto/pu...')
#3 /home/usauto/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/b-resp...')
#4 /home/usauto/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#5 /home/usauto/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#6 /home/usauto/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#7 /home/usauto/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#8 /home/usauto/public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#9 /home/usauto/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#10 /home/usauto/public_html/app/design/frontend/b-responsive/default/template/page/1column.phtml(56): Mage_Core_Block_Abstract->getChildHtml('content')
#11 /home/usauto/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/usauto/pu...')
#12 /home/usauto/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/b-resp...')
#13 /home/usauto/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home/usauto/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#15 /home/usauto/public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#16 /home/usauto/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#17 /home/usauto/public_html/app/code/local/AdminModules/Topjob/controllers/IndexController.php(16): Mage_Core_Controller_Varien_Action->renderLayout()
#18 /home/usauto/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): AdminModules_Topjob_IndexController->indexAction()
#19 /home/usauto/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#20 /home/usauto/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#21 /home/usauto/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#22 /home/usauto/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#23 /home/usauto/public_html/index.php(89): Mage::run('', 'store')
#24 {main}


texts:
I am exporting my products for a Google Shopping feed and i need to get the category names in the CSV file. Is there any way to do this with dataflow profiles?

Magento 1.9


texts: HTML Validation Error head and body tags

texts: I have a problem when validating my html. It says stray head tag and some problems with my body tag. Can someone check that out and find my problem? I can't find the problem... My URL is www.magmaar.de


texts:
I save my image dark.jpg to: app/disign/frontend/Vendorname/default/web/images.
rm -R pub/static/*
bin/magento setup:static-content:deploy
Go to site admin panel/home page/content, write <img src="images/dark.jpg">.
But this not work (Not Found). What is the right path should I write?


texts: Multiselect attribute not showing on frontend when two or more options selected

texts:
I have a custom product attribute that uses a multiselect input to select one or more product stockists.

The data is being stored correctly, and selecting 1 option adds the information to the "More information' tab on the product frontend page.

Selecting 2 or more options, the information is no longer visible on the frontend.

Attribute config below

$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                'stockist',
                [
                    'type' => 'varchar',
                    'label' => 'Stockist',
                    'input' => 'multiselect',
                    'source' => 'My\Module\Model\Attribute\Source\Stockist',
                    'backend' => 'Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend',
                    'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                    'visible' => true,
                    'required' => false,
                    'searchable' => true,
                    'filterable' => true,
                    'comparable' => false,
                    'visible_on_front' => true,
                    'used_in_product_listing' => true
                ]
            );

My\Module\Model\Attribute\Source\Stockist:

namespace My\Module\Model\Attribute\Source;

use My\Module\Model\ResourceModel\Stockist\CollectionFactory;
use Magento\Eav\Model\Entity\Attribute\Source\AbstractSource;

class Stockist extends AbstractSource
{
    private $collectionFactory;

    public function __construct(CollectionFactory $collectionFactory)
    {
        $this->collectionFactory = $collectionFactory;
    }

    public function getAllOptions()
    {
        $stockistCollection = $this->collectionFactory->create();
        $stockistCollection->addFieldToSelect('*')->load();

        $result = [];

        foreach ($stockistCollection as $stockist) {
            $result[] = [
                'value' => $stockist->getId(),
                'label' => $stockist->getName()
            ];
        }

        return $result;
    }
}


texts:
The tutorial I'm working through: http://alanstorm.com/category/magento-2
does not explain what to do with the missing app/code directory.

I got Magento by compressed archive and I understand — the vendor directory is equivalent to app/code. I don't understand what this means. Can I create the directory in my computer simply by right-clicking inside the magento  folder an choosing New > Folder. I created an app/code folder directory like this:

xampp>htdocs>magento>vender>magento>app>code

Should I do this?

xampp>htdocs>magento>vender>app>code

Or?

xampp>htdocs>magento>vender


texts:
i have problem when the cronjob run, the page cache is invalidated after the "Category Products" index is reindexed.

this problem happens exactly after each 30min (time of cron job) the FPC become invalidated
-there is no changes or updates to products, categories, catalog price rules, static blocks, 3rd party extensions, etc.
there is no visitor to website as its under construction
there is more than 100K product on website

We use:

magento 2.3.4
PHP version 7.2
mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64)
VPS Cloud hosting
the cpanel cron job -> https://ibb.co/Wg9v2b1

Any idea/solution?
Regards
Gabriel


texts: Changing the address book drop down (for shipping) from drop down list to radio buttons

texts: I need to know how to change the address book drop down on a registered account checkout to radio buttons (similar to Amazon)


texts:
I am just wondering what would be the easiest way to display vehicles using the Magento platform.

So daily I receive a CSV file of all the vehicles that are in stock at my Dealership via FTP, I want to be able to use this CSV file to import vehicles as products onto my store and cron it daily.

Issue 1

Because the CSV file is loaded daily it is formatted differently than the standard CSV import tool that Magento provides. For example in the CSV file one column will be for the Manufacturer of the vehicle there are also columns for price, variant, owners, engine size etc...

Any idea what would be the best way to import this data?

Issue 2

If the CSV file doesn't contain one of the products in the category that I am importing them into I want them not to display. The reason I would like this to happen is because if the vehicle isn't on the CSV we no longer have it in stock.

Any ideas how I could do this?

Thanks


texts:
Hi am trying to create a user in magento 2 by taking custom password fields from the the checkout form
but am getting below error
1 exception(s):
Exception #0 (Exception): Recoverable Error: Object of class Ntz\CaptureShipping\Observer\Convertguest could not be converted to string in E:\xampp\htdocs\m2dev\app\code\Ntz\CaptureShipping\Observer\Convertguest.php on line 62
line 62
$customer->$this->_checkoutSession->getPassword();
$customer->$this->_checkoutSession->getConfirmPassword();

However the order is placed successfully then this observer throws an error


texts: Error after trying to install an extension in Magento 1.9.3

texts:
There has been an error processing your request

  Error in file:
  "/home/khankesa/public_html/app/code/local/Ax/Zoom/sql/axzoom_setup/install-1.4.0.php"
  - PHP "Ioncube loader" is not installed on this server. Please install this extension before installing AJAX-ZOOM; if you encounter any other
  issues please check troubleshooting section at
  http://www.ajax-zoom.com/index.php?cid=modules&module=magento and
  contact AJAX-ZOOM support at
  http://www.ajax-zoom.com/index.php?cid=contact

Trace:

#0 /home/khankesa/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(644): Mage::exception('Mage_Core', 'Error in file: ...')
#1 /home/khankesa/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(421): Mage_Core_Model_Resource_Setup->_modifyResourceDb('install', '', '1.4.3')
#2 /home/khankesa/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(327): Mage_Core_Model_Resource_Setup->_installResourceDb('1.4.3')
#3 /home/khankesa/public_html/app/code/core/Mage/Core/Model/Resource/Setup.php(235): Mage_Core_Model_Resource_Setup->applyUpdates()
#4 /home/khankesa/public_html/app/code/core/Mage/Core/Model/App.php(428): Mage_Core_Model_Resource_Setup::applyAllUpdates()
#5 /home/khankesa/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Model_App->_initModules()
#6 /home/khankesa/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /home/khankesa/public_html/index.php(83): Mage::run('', 'store')
#8 {main}

Above is the list of errors I got when I tried to install the extension.

Please help to fix.


texts: Change Email Template On Specific Order Status:Magento2

texts:
I am trying to use different e-mail template for one of my custom order status when the status is changed from the admin.

I have used the event sales_order_save_after

<observer name="sales_order_save_after" instance="Hawk\OrderFlow\Observer\Sales\Order\SalesOrderAfterSave"/>

And created an observer like follows:

<?php

namespace Hawk\OrderFlow\Observer\Sales\Order;

use Magento\Framework\Event\Observer as EventObserver;
use Magento\Framework\Event\ObserverInterface;

class SalesOrderAfterSave implements ObserverInterface {

/**
 * @var \Magento\Framework\App\Request\Http
 */
protected $_request;

/**
 * @var \Magento\Framework\Mail\Template\TransportBuilder
 */
protected $_transportBuilder;

/**
 * @var \Magento\Store\Model\StoreManagerInterface
 */
protected $_storeManager;

/**
 * For logger, var/log
 */
protected $_logger;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\App\Request\Http $request,
    \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Psr\Log\LoggerInterface $logger
) {
    $this->_request = $request;
    $this->_transportBuilder = $transportBuilder;
    $this->_storeManager = $storeManager;
    $this->_logger = $logger;
}

public function execute(\Magento\Framework\Event\Observer $observer)

{

    $order = $observer->getEvent()->getOrder();
    $lastOrderId = $order->getId();
    $orderStatus = $order->getStatus();

    try {

        if($orderStatus  == "viewed_by_admin") {
            $store = $this->_storeManager->getStore()->getId();
            $template = $this->_transportBuilder->setTemplateIdentifier('13') //Where 13 is the Email Template ID created in the admin pannel under the Stores -> Email Templates
            ->setTemplateOptions(['area' => 'frontend', 'store' => $store]);
            return $template;
        }

    } catch (\Exception $e) {
        $this->_logger->critical($e->getMessage());
        return;
    }
}
}

Still not using my defined email template rather then still using the default email template from admin configuration, Is there anything I am missing here please guide about it.

Any help will be appreciated.


texts:
We keep finding demand for modules that transfer a batch file to or from a remote location. Rather than create redundant code, we thought it would be a good idea to create a sharable module for handling file transfer mechanisms. But we only got as far as a little bit of helper code before we realized that we would have to code the config fields into each "user module" (what we call the modules that use the FileTransfer module). There're multiplying points-of-failure there because each config field that has to be created can be different from the others.

What we really need is a way consistently to generate the needed admin config fields.

Generating actual XML seems like the wrong thing to do.
In our team we discussed creating custom frontend_models in the FileTransfer module, and that's the direction we're headed in now, but that will require us to manually code all the widgets and everything for the frontend and handle the POST specially in the backend. All of that seems unnecessary since we're just trying to duplicate procedures that Magento does anyway.

What we want is to guarantee config consistency across any module that uses a component of the FileTransfer module. Any suggestions?


texts: Call admin controller from another server

texts:
My team and I are building a Magento website for a client and we need to regularly perform data exports from another server to the Magento server.

I'd like to call a custom admin action from another server to start the import of a file sent via FTP on the Magento server.

How can I remotely access to Admin actions ?
Should I use cURL and the admin URL, customized magento SOAP API or REST API requests ?

I've never used any of the above (I've used Magento SOAP API but I haven't customized it), so please mind to redirect me to tutorials or explain thoroughly.

PS : I thought of using Cron job to import regularly (night time), but then I'd need to be sure the cron is launched after the FTP transfer (in case of slow connection) and that the server has the last version (stamped with current date). Is there a way to postpone a cron job without modifying the original ? Like a Magento way to say "sleep(15minutes)" to a cron job, or maybe should I check within my scrip and use "sleep()" until file is uploaded and updated ? (I would cancel the import and notify an admin after X hours of postponing)


texts: Add active class when product is in wishlist at category page

texts:
I'm trying to add an active class when product is in wishlist.

I tried below code.

<?php
    echo $_product->getId();
    $wishlist = $this->helper('Magento\Wishlist\Helper\Data')->getWishlistItemCollection()->addFieldToFilter('product_id', $_product->getId());
    print_r($wishlist->getData());

                    ?>

                            <?php if ($this->helper('Magento\Wishlist\Helper\Data')->isAllow() && $showCompareWishlist): ?>
                                <a href="#"
                                   class="action towishlist"
                                   title="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
                                   aria-label="<?php echo $block->escapeHtml(__('Add to Wish List')); ?>"
                                   data-post='<?php /* @escapeNotVerified */ echo $block->getAddToWishlistParams($_product); ?>'
                                   data-action="add-to-wishlist"
                                   role="button">
                                    <?php /* @escapeNotVerified */ echo __('Add to Wish List') ?>

                            <?php endif; ?>

If I dump collection data then it returns me all products which are currently in wishlist but after I filter collection with product_id then it returns always first array.

But product ID is printing correctly.

Does anyone has idea what's issue here ?


texts: Magento 2.1.3 adding menu.xml in new module causes redirect loop after login

texts:
Adding menu.xml in a new magento 2.1.3 installation causes redirect loop in the admin

I am creating a new module, but when tried to add menu.xml in etc/adminhtml directory in the module directiory, the browser shows error of redirect loop
Magento Version: Magento CE 2.1.3
Mysql Version:  5.6.28
PHP version: 7.0.8

Steps to reproduce issue
1. Install new Magento CE 2.1.3
2. Create new module in app/code with all required files in etc directory of the module
3. Add menu.xml and add items in the menu

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Ktpl_Testimonial::menu" title="IntroBrand" translate="title" module="Ktpl_Testimonial" sortOrder="0" resource="Ktpl_Testimonial::menu"/>
        <add id="Ktpl_Testimonial::testimonial" title="Manage Testimonials" translate="title" module="Ktpl_Testimonial" sortOrder="0" parent="Ktpl_Testimonial::menu" resource="Ktpl_Testimonial::testimonial"/>
    </menu>
</config>

Edit
Added acl.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Backend::admin">
                <resource id="Ktpl_Testimonial::menu">
                    <resource id="Ktpl_Testimonial::testimonial"/>
                </resource>
            </resource>
        </resources>
    </acl>
</config>

Expected result

It should add a main menu item in the admin menu and a child menu item in the new menu item.

Actual result

It creates a redirect loop when try to log in to the admin


texts:
I am really new to this world of magento, I installed Magento 2.4 in XAMPP with the help of compposer, elastic search, I did everything to the letter, when I checked my installation I saw that it does not load content neither in the frontend nor in the backend, does not mark an error, it just does not load the content already run ----reindex, upgrade, static-content: deploy –f and flush
upgrade
But it remains the same, I would appreciate if you could help me give clues of what it could behere de image without content


texts: Share inventory between my 3 stores (MSI disabled - Same Environment)

texts:
I have 3 stores that share the same stock for products. The stock is being handled by an external system, and in order for everything to work properly, they have been recommended to disable MSI (inventory) and activate Manage Stock. My Magento's version is 2.3.1
But if I do this, only the default store works, the other two stores don't work and show the following error:
Fout filteren sjabloon: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magentodb.inventory_stock_sales_channel' doesn't exist, query was: SELECT inventory_stock_sales_channel.stock_id FROM inventory_stock_sales_channel WHERE (code = 'my_store_2' and type = "website")

Any ideas how I can keep this setting (MSI disabled) and be able to share the stock with the three stores?


texts: Live Reload work with Magento 2 Live Server

texts:
Today i am tried to use live reload on live server.

Almost working but when socket call, it showing error

Provisional headers are shown

Request URL:wss://domain_url:35729/livereload

is any body did that?


texts: Customer Data error after logging in as a customer

texts:
I add some products (esp. Configurable product) in the cart and when I login I get following customer data error.

When I click on the error it redirects me to the following error

Due to which my cart gets empty. To manually fix this issue, I have to add a simple product (for eg: bag) and then my cart shows products including the configurable product, and when I delete any product from cart, I don't get the customer-data error again.

Can someone please give me a permanent solution to the above problem?


texts: magento 2: How to use the order by and limit clause in sql query

texts:
I am using following code to filter result and i want to limit the result.

$giftColletion = $this->_giftFactory->getCollection();
$giftColletion->addFieldToFilter('store_id', 1);
$giftColletion->setOrder('position','ASC');


texts: Get On sale product collection in magento 2

texts:
I want to show all the on sale product on one page.
Can any one help me with the code to get the products collection which are on Sale i.e which has special price assigned in magento 2
This is my block code
<?php

 namespace Vidushi\Contact\Block;

 use Zend_Db_Expr;

 class OnSaleProduct extends AbstractSlider
   {
     /**
       * @inheritdoc
    */
  public function getProductCollection()
  {
      $visibleProducts = $this->_catalogProductVisibility-
     >getVisibleInCatalogIds();
    $collection = $this->_productCollectionFactory->create()-
>setVisibility($visibleProducts);
    $collection = $this->_addProductAttributesAndPrices($collection)
        ->addAttributeToFilter(
            'special_from_date',
            ['date' => true, 'to' => $this->getEndOfDayDate()],
            'left'
        )->addAttributeToFilter(
            'special_to_date',
            ['or' => [0 => ['date' => true,
                                               'from' => $this-
  >getStartOfDayDate()],
                                         1 => ['is' => new Zend_Db_Expr(
                                             'null'
                                         )],]],
            'left'
        )->addAttributeToSort(
            'news_from_date',
            'desc'
        );
    return $collection;
}

}


texts: Adding Tracking to sales_flat_order table

texts:
We use an module call iparcel for International Orders.

These orders get immediate tracking information and this updates in the correct tables needed for normal tracking use case, however, we use a middle-ware service called celigo  to map order data to our ERP, Netsuite(NS).

Celigo uses sales_flat_order table to gather all records involved with order data , to import via an API call, and tracking is not a default field in this table.

I've managed to figure out how to correctly add the table based on a few fields in iParcels sql scripts, but I can not figure out what model to use to write to these tables.

Here you see where iParcel writes the tracking

 protected function _submitParcel($shipment, $order)
    {
        $api = Mage::helper('iparcel/api');
        $response = $api->submitParcel($shipment);

        // Find the name of the Service Level as defined in the Admin
        $serviceLevels = Mage::helper('iparcel')->getServiceLevels();
        $responseServiceLevelId = $response->ServiceLevels[0][0]->ServiceLevelID;
        $serviceLevelTitle = 'I-Parcel';
        if (array_key_exists($responseServiceLevelId, $serviceLevels)) {
            $serviceLevelTitle = $serviceLevels[$responseServiceLevelId];
        }

        // Add tracking number from submitParcel response
        Mage::getModel('sales/order_shipment_api')->addTrack(
            $shipment->getIncrementId(),
            $order->getShippingCarrier()->getCarrierCode(),
            $serviceLevelTitle,
            $response->CarrierTrackingNumber
        );
    }

What I am asking is, is there a way to directly update this field right after it writes tracking , so its there before celigo imports the order ?


texts: Magento2 javascript tests only possible through phpstorm?

texts:
I don't quite understand how magento2 implements tests in javascript.

From this doc: http://devdocs.magento.com/guides/v2.1/extension-dev-guide/test/test_js-unit.html it looks like it is possible to run javascript tests only though phpstorm?

If yes, is it possible to use some hacks to simulate the tests using just a text editor and command line? (I just don't understand why you need a specific IDE to develop with magento2)


texts:
I am trying to set up a configurable product but all I get when I click on the product is a completely blank page. No header, etc, nothing. View Source shows no code is output at all.
What could be causing this?
Here is the url to the configurable product:
https://www.design-a-cake.co.uk/photocake-edible-cake-topper-pumpkin-lanterns.html
Thank you.


texts: Show number of prepaid and COD orders on vendor panel

texts: I Want to show the number of COD and prepaid orders on vendor panel dashboard. Can any body please help me how to do it and code for the same. I am using ced commerce marketplace extension.


texts:
I have this diff command in patch SUPPE-10336:

diff --git app/locale/en_US/Mage_Usa.csv app/locale/en_US/Mage_Usa.csv
index 072170d..5e8f844 100644
--- app/locale/en_US/Mage_Usa.csv
+++ app/locale/en_US/Mage_Usa.csv
@@ -99,7 +99,7 @@
 "First-Class Mail Large Envelope","First-Class Mail Large Envelope"
 "First-Class Mail Large Postcards","First-Class Mail Large Postcards"
 "First-Class Mail Letter","First-Class Mail Letter"
-"First-Class Mail Parcel","First-Class Mail Parcel"
+"First-Class Package Service - Retail","First-Class Package Service - Retail"
 "First-Class Mail Postcards","First-Class Mail Postcards"
 "First-Class Package International Service","First-Class Package International Service"
 "First-Class Package Service","First-Class Package Service"

Am I right to assume that all it does is, in Mage_Usa.csv file it changes the name of:

-"First-Class Mail Parcel","First-Class Mail Parcel"

To:

+"First-Class Package Service - Retail","First-Class Package Service - Retail"

Is that right?


texts: How to add different prices for different product sizes?

texts:
I have read many posts here, but didn't found my answer.
I have a perfume store and want to add different price on each perfume size. I don't want to create simple products for each size because this will be time consuming and will create duplicate pages. What i need is to open a product ( lets say perfume: "Gucci" and to be able to add size options with corresponding prices, e.g. :

50ml - price: $50

75ml - price: $70

100ml - price: $100

Can you tell me what is the best way to do it?


texts: Magento 2: catalog_product_save_after only for new products?

texts:
Ive made an observer for the catalog_product_save_after event, but I want to only fire it when a new product is added to the catalog.

I did the same for the sales_order_save_after event and just added this code:

$order = $observer->getEvent()->getOrder();

if($order->getState() == 'new') {
    $this->shipment->write($order);
}

Is there an equivalent to this when making a new product?

I tried with catalog_product_new_action but didnt get any product data then.


texts:
I know that there are hundreds of questions about issues with SUPEE-8788 and I feel like i have been endlessly going through search results here and on Google to try and find a solution to this but here goes...

I recently installed SUPEE 7405 and 8788 on a Magento 1.9.1.0. I have cleared all the Magento caches, browser caches and reindexed but when I try to upload an image to a product it doesn't display in the admin.

Here's what happens:

Click Browse Files
Select image
Click Upload Files
Progress bar shows uploading and then completed

However, the image then doesn't display in the grid and it also hasn't uploaded. I believe that this is different to the permissions issue where the image does then show after upload but as a broken image due to file permissions.

Wondering if anyone can help?

Thanks.


texts: Allow only one simple product per configurable product in cart by configuration?

texts:
I'm currently working on a shop for a customer that sells and rents art. I'm using configurable products that have a rent or buy attribute. Due to the nature of the customer's business you can't rent an object (product) multiple times and you can only buy OR rent a product.

A configurable product consists of 4 simple products (3 for monthly renting options and 1 for buying).

Is there a standard (via configuration) way to prohibit adding one configurable product multiple times to the cart without using the inventory configuration/stock management (currently the scenario only works without deducting quantities from stock/inventory).


texts: Products not appearing in categories (no footer either)

texts:
I have been trying to get this working for the past two days.

None of my products are appearing in my categories. The category title, description and feature image appear but no products and also no footer (like other pages on the site)

It seems the categories have a missing block for the products to appear and the footer block is missing.

Any suggestions on how to fix this?


texts:
I'm trying to write an observer and send product data to external source.

Have everything done except that when I get image it shows default Magento image.

public function __construct(
    \Magento\Sales\Api\Data\OrderInterface $order,
    \Magento\Catalog\Model\Product $product,
    \Magento\Catalog\Helper\Image $imgHelper
) {
     $this->_order = $order;
     $this->_product = $product;
     $this->_imgHelper = $imgHelper;
}

public function execute(\Magento\Framework\Event\Observer $observer){
    ...
    $itemCollection = $order->getItemsCollection();
    foreach($itemCollection as $item){
        $product = $this->_product->load($item->getData('product_id'));
        $this->_imgHelper->init($product, 'product_thumbnail_image')->getUrl();
    }
    ....
}

The image which I get is:

  http://convert.wemessage.it/magento2/pub/media/catalog/product/cache/dc09e1c71e492175f875827bcbf6a37

Do I miss something?


texts: How to change the id in the  tag on magento content pages

texts:
down vote
favorite
I'm sorting out the blog on my magento based site, currently using an aheadworks extension but moving to wordpress.

Both AW and WP have the sidebar (search, recent posts, etc) in an tag, separate from the actual page content, however AW aside has id="aside" whereas WP aside is id="sidebar", however I can't see where this is set (definitely not in any template files that's for sure, and I can't see anything in wordpress.xml or aw_blog.xml)

Can anyone shine some light on this?


texts: Restrict product from adding to cart based on product type

texts:
HI am trying to restrict customer from adding product to cart.
i have a condition where i want to check the item type in the cart if customer adds the same product type to the cart then it should be success else if the product in cart does not match with the product type then its should show an error and should be added to cart
below is my code to restrict product from adding cart but its not working
RestrictAddToCart.php
<?php
namespace Mageplaza\HelloWorld\Observer;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\App\Request\DataPersistorInterface;
use Magento\Framework\App\ObjectManager;
use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Exception\LocalizedException;

    protected $_cart;
    protected $_messageManager;
    protected $_request;
   protected $collectionFactory;
    protected $formKey;
    protected $product;
 protected $checkoutSession;
  protected $product;

    public function __construct(
        \Magento\Checkout\Model\Cart $cart,
        \Magento\Framework\Message\ManagerInterface $messageManager,
        \Magento\Framework\App\RequestInterface $request,
        \Magento\Framework\Data\Form\FormKey $formKey,
         \Magento\Checkout\Model\Session $checkoutSession,
          \Magento\Catalog\Model\ProductFactory $product,
         \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $collectionFactory,
    ) {
        $this->_cart = $cart;
        $this->_messageManager = $messageManager;
        $this->_request = $request;
         $this->collectionFactory = $collectionFactory;
         $this->product = $product;
         $this->formKey = $formKey;
          $this->checkoutSession = $checkoutSession;
    }

    public function getProductCollection()
            {
                $productCollection = $this->collectionFactory->create();
                $productCollection->addAttributeToSelect('*');
                foreach ($productCollection as $product){
                     echo 'id  =  '.$product->getTypeId().'<br>';

                }

    public function execute(\Magento\Framework\Event\Observer $observer) {

        $productId = $product->getTypeId();
          $params = array(
            'form_key' => $this->formKey->getFormKey(),
            'product_id' => $productId, //product Id
            'qty'   => 1 //quantity of product
          );

        $product = $observer->getEvent()->getProduct();
       $_product = $this->product->create()->load($productId);
        $this->cart->addProduct($_product, $params);

        $item = $this->cart->getQuote()->getItemByProduct($_product);
        if ($item == $productId) {
            $this->cart->addProduct($_product, $params);
        } else {
            echo "please remove ". $productId;
        }

    }
}

events.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="controller_action_predispatch_checkout_cart_add">
        <observer name="customname" instance="Mageplaza\HelloWorld\Observer\RestrictAddToCart" />
    </event>
</config>

any help on this thankss


texts: Magento : Product Images and browse and Upload button Missing

texts: I have no solutions found since last one week. In My magento 1.9.3.1 all product images and browse file button and upload files button are missing on product edit in admin show in screen-sort. kindly help me to revert back.


texts: Annotating methods in API interfaces to work with DataObjectHelper::populateWithArray

texts:
I'm trying to build a proper CRUD module for Magento 2.
My module contains for now an entity called Author.
This module contains the main entity table and a many to many relations table with the store views (similar to the cms pages and static blocks).
I've created, among others, an interface for the main model called [Namespace]\[Module]\Api\Data\AuthorInterface following the same guidelines as for CMS pages.

interface AuthorInterface extends ExtensibleDataInterface
{
     const AUTHOR_ID    = 'author_id';
     const NAME         = 'name';
     const STORE_ID     = 'store_id'; //this is missing in the cms page interface
     /**
     * Get ID
     *
     * @return int|null
     */
    public function getId();

    /**
     * Get name
     *
     * @return string
     */
    public function getName();
    /**
     * set id
     *
     * @param $id
     * @return AuthorInterface
     */
    public function setId($id);

    /**
     * set name
     *
     * @param $name
     * @return AuthorInterface
     */
    public function setName($name);
    /**
     * @param $storeId
     * @return AuthorInterface
     */
    public function setStoreId($storeId);

    /**
     * @return array
     */
    public function getStoreId();
}

Now here come the differences and problems.
The cms page interface does not contain the constant STORE_ID nor the methods setStoreId or getStoreId.
But from my point of view they should be there.
Also the cms pages save action uses the $page->save() call that is deprecated.
I decided to use repositories.
So my save action looks something like this:

$data = $this->getRequest()->getPostValue();
....
$author->setName($data['name']);//don't worry, I have a verification for the existence of $data['name']
$author->setStoreId($data['store_id']);
$this->authorRepository->save($author); //authorRepository is an instance of \[Namespace]\[Module]\Api\AuthorRepositoryInterface

This works nicely, but what if my entity has a lot of fields, not just a name?
I don't want to call ->set... a hundred times. Plus, if I add one more field, I need to modify my code.
I discovered the method \Magento\Framework\Api\DataObjectHelper::populateWithArray.
Now I can simply call

$this->dataObjectHelper->populateWithArray($author, $data , '\[Namespace]\[Module]\Api\Data\AuthorInterface'); //where dataObjectHelper is an instance of \Magento\Framework\Api\DataObjectHelper

This, again, works flawlessly except for the store_id.
I get an exception Class array does not exist because the annotation for getStoreId says @return array.   can confirm that changing this annotation changes the exception message or works when changing the return type to string. But my store id is going to be an array not a string.

What is the proper way to handle this kind of case?

[EDIT]
I could go around this by using

$data = $this->getRequest()->getPostValue();
...
if (isset($data['store_id'])) {
    $author->setStoreId($data['store_id']);
    unset($data['store_id']);
}
$this->dataObjectHelper->populateWithArray($author, $data , '\[Namespace]\[Module]\Api\Data\AuthorInterface');

But this looks dirty.


texts: How to create category in magento 2 programmatically

texts:
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
$rootCatNode = $data['catalog'][0];
$websiteId = $storeManager->getWebsite()->getWebsiteId();
$store = $storeManager->getStore();
$storeId = $store->getStoreId();
$rootNodeId = $store->getRootCategoryId();
$rootCat = $objectManager->get('Magento\Catalog\Model\Category');
$cat_info = $rootCat->load($rootCatNode);
echo "<pre>";
foreach($data['catalognew'] as  $newdata){
    $getCatData = $objectManager->create('Magento\Catalog\Model\Category')->load($newdata);
    $categoryFactory = $objectManager->get('\Magento\Catalog\Model\CategoryFactory');
    //  if($getCatData->getLevel()==2) {
    $categoryTmp = $categoryFactory->create();
    $categoryTmp->setName($getCatData->getName());
    $categoryTmp->setIsActive(true);
    $categoryTmp->setUrlKey(rand(0, 999));
    $categoryTmp->setData('description', 'description');
    $categoryTmp->setParentId($getCatData->getParentId());
    $getCatDatan = $objectManager->create('Magento\Catalog\Model\Category')->load($getCatData->getParentId());
    $categoryTmp->setStoreId($storeId);
    $categoryTmp->setPath($rootCat->getPath());
    echo $getCatDatan->getPath();
    echo "<br>";
    echo $rootCat->getPath();
    $categoryTmp->save();
}


texts: Email Template order id in guest checkout

texts:
I have create a new email template in admin and linked a phtml template in content like below.

{{block class='Sketchshot\\EmailTemplate\\Block\\Index\\Index'
area='frontend' template='Sketchshot_EmailTemplate::email/logo.phtml'}}

In my logo.phtml

<?php
   $objectManager = \Magento\Framework\App\ObjectManager::getInstance();

   $storeInformation = $objectManager->create('Magento\Store\Model\Information');
   $storeManager = $objectManager->get('\Magento\Store\Model\StoreManagerInterface');
   $baseUrl = $storeManager->getStore()->getBaseUrl();

   $store = $objectManager->create('Magento\Store\Model\Store');

   $storeInfo = $storeInformation->getStoreInformationObject($store);
   $storeName = $storeInfo->getName();
   $street_line1 = $storeInfo->getData('street_line1');
   $city = $storeInfo->getData('city');

   $postcode = $storeInfo->getData('postcode');
   $variable = $objectManager->create('Magento\Variable\Model\Variable');

   $value = $variable->loadByCode('formattedShippingAddress')->getPlainValue();

   $orderId = $this->orderId();

   $time = time();
   $check = $time+date("Z",$time);
   $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
   $orders = $objectManager->create('Magento\Sales\Model\Order')->load($orderId);

    $custLastName= $orders->getCustomerLastname();
    $custFirstName= $orders->getCustomerFirstname();
    $billingAddress = $orders->getBillingAddress();
    $shippingAddress = $orders->getShippingAddress();
    $orderItems = $orders->getAllItems();
    $number = $orders->getGrandTotal();
    $invoice_id = '';
?>

I can able to get order Id using this code $orderId = $this->orderId(); when ordered as customer. But when I try to order as guest I can't place order I get below issue in exception log.

[2020-06-05 13:47:38] main.CRITICAL: No such entity with orderId =  {"exception":"[object] (Magento\\Framework\\Exception\\NoSuchEntityException(code: 0): No such entity with orderId =  at /home/project/public_html/vendor/magento/framework/Exception/NoSuchEntityException.php:50)"} []


texts: Magento 2 How to add external Js in a page

texts:
I want to add an external js in my home page. The external js loads a popup form in my home page.  I have tried the code in phtml file and also in xml file. In both case the form will appear. But some js errors in the console

https://prnt.sc/mo0mnj

  Uncaught TypeError: Cannot read property 'version' of undefined

  Uncaught TypeError: owl.owlCarousel is not a function

Here is my code

cms_index_index.xml

<body>
   <referenceContainer name="before.body.end">
        <block class="Magento\Framework\View\Element\Template" name="constant_contact" template="Magento_Theme::constantcontact.phtml"/>
   </referenceContainer>
</body>

constantcontact.phtml

<script> var _ctct_m = "5454agf54b30f4dfb97a"; </script>
<script id="signupScript" src="//static.test.com/js/new-form-widget/current/test-form-widget.min.js" async defer></script>

Please help me


texts:
Is there a way to customize (main) menu items?
For example I need to dispaly 2 categories AND 2 subcategories AND a static link
Is there a way to choose explicitly what categories to display and custom links?
Thank you


texts: magento 1.9.4.2 problem with search, server crashes


texts: How To Pass data from Helper Data to Knockout JS file Magento 2

texts:
How i can pass helper data to Knockout JS to show it on my html file. Actually i am working on minicart and  i want to show the product Qty as Dropdown and get value from Helperdata.
Any help would be appreciated!


texts: How to edit cart item in Mageto 2 REST API?

texts:
How to edit cart item in Magento 2 REST API ?

I am adding product in cart using below API.

http://magento.host/index.php/rest/default/V1/carts/mine/items

method : POST
Authorization Bearer <customer token>

Body

{
    "item_id": 7,
    "sku": "MH11-S-Red",
    "qty": 8,
    "name": "Grayson Crewneck Sweatshirt ",
    "price": 64,
    "product_type": "configurable",
    "quote_id": "3",
    "product_option": {
        "extension_attributes": {
            "configurable_item_options": [
                {
                    "option_id": "93",
                    "option_value": 58
                },
                {
                    "option_id": "141",
                    "option_value": 168
                }
            ]
        }
    }
}

How to EDIT this CART ITEM (Like Qty, Attribute options etc.)


texts: Grid/Edit/Tab/Form.php populate from joint collection

texts:
EDITED To Show Progress and Provide More Information

I have a collection that I am building from a join query that displays perfectly in Grid and I now wish to have magento edit and save the data. I am aware I will need to write the updates separately, but will cross that when I get to it.

Additionally all tables are "flat" tables.

I am calling my collection on the form page using

$id = Mage::app()->getRequest()->getParam('id');
$model = Mage::getModel('folder1/folder2')->getCollection()->addFieldToFilter('main_table.id', array('eq' => $id))->allTables();
$form->setValues($model->getData());

allTables() is in Collection.php and looks something like this:

public function allTables() {
    $select = $this->getSelect();
    $select->joinLeft(
        'joined_table',
        'main_table.id = joined_table.id',
        array('joined_val')
    );
    return $this;
}

This displays in the grid view perfectly and var_dump($model->getData()) shows all the data I'm expecting to see. When I press edit and try and populate my form it only displays the items in main_table

For instance:

$fieldset->addField('id', 'text', array(
    'label'     => Mage::helper('csm')->__('id'),
    'name'      => 'id',
    'readonly'  => 'true'
));

Shows the text field populated with the id but

$fieldset->addField('joined_val', 'text', array(
    'label'     => Mage::helper('csm')->__('Joined Val'),
    'name'      => 'joined_val'
));

Doesn't populate the field. Using joined_table.joined_val doesn't seem to work.

Output of var_dump($model->getData())

array(1) {
  [0]=>
  array(24) {
    ["id"]=>
    string(4) "1604"
    //snip
    ["joined_val"]=>
    string(2) "Plain text result to be shown"


texts: Use existing PHP, HTML, and JavaScript based website in the same structure, but use Magento 2.1 Functions and tools such as accounts and Carts

texts:
This is specific to Magento 2.1, but knowledge on other versions may help in pointing me in the right direction.

I have tried a few things and have scoured the internet for similar solutions but most have not been answered or are for previous Magento versions.

I have an existing standalone website that was completely custom built that uses PHP, HTML, CSS and JavaScript and almost all files are '.php'. This existing site is not on any platform and is not 'E-Commerce'. The existing site is visually how we want it, it has a custom dealer locator, custom json and other data retrieval portions. I want to take these files and structure, preferably exactly how it is, and use it as a E-Commerce site that is integrated with Magento. By Integrated I mean having the ability to call Magento's functions/methods so I can use Magento's tools such as creating and editing accounts, shopping cart, checkouts, etc.

Thus far, I have created my own custom theme in Magento, created custom modules and neither of which seem to give me the capabilities of what I am looking for (or else I have misunderstood the documentation and need to expand). Magento uses MVC structure and I would prefer to not use it if possible.
The current format I have my site in is in the structure below.

Above is how I built the existing site and it is structured how we develop. In what direction should I go in order to achieve this custom development structure within Magento while being able to use Magento tools?

My question is very similar to this post, but I would like to use the Magentos tools in a more direct way and potentially exactly how they already exist.
Using Magento as backend ONLY for website

I will elaborate, add code, answers and questions as fast as I can upon a request.


texts: Can Module Version Numbers be only Numeric?

texts:
Is it a problem if I use module versions like

1.1.2-devmaster

or

1.1.2-branch-foobar


texts: How to display tier prices in custom page in magento 2?

texts:
I want to display of tier prices of simple product.I checked in catalog module and find tier prices block and its template defined in catalog_product_prices.xml.tier price block and templte rendering in this handler. And I have every product object so how can I display of tier prices in custom page ?

catalog_product_prices.xml

<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
    <block class="Magento\Framework\Pricing\Render\RendererPool" name="render.product.prices">
        <arguments>
            <argument name="default" xsi:type="array">
                <item name="default_render_class" xsi:type="string">Magento\Catalog\Pricing\Render\PriceBox</item>
                <item name="default_render_template" xsi:type="string">Magento_Catalog::product/price/default.phtml</item>
                <item name="default_amount_render_class" xsi:type="string">Magento\Framework\Pricing\Render\Amount</item>
                <item name="default_amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
                <item name="prices" xsi:type="array">
                    <item name="special_price" xsi:type="array">
                        <item name="render_template" xsi:type="string">Magento_Catalog::product/price/special_price.phtml</item>
                    </item>
                    <item name="tier_price" xsi:type="array">
                        <item name="render_template" xsi:type="string">Magento_Catalog::product/price/tier_prices.phtml</item>
                    </item>
                    <item name="final_price" xsi:type="array">
                        <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\FinalPriceBox</item>
                        <item name="render_template" xsi:type="string">Magento_Catalog::product/price/final_price.phtml</item>
                    </item>
                    <item name="custom_option_price" xsi:type="array">
                        <item name="amount_render_template" xsi:type="string">Magento_Catalog::product/price/amount/default.phtml</item>
                    </item>
                    <item name="configured_price" xsi:type="array">
                        <item name="render_class" xsi:type="string">Magento\Catalog\Pricing\Render\ConfiguredPriceBox</item>
                        <item name="render_template" xsi:type="string">Magento_Catalog::product/price/configured_price.phtml</item>
                    </item>
                </item>
                <!--<item name="adjustments" xsi:type="array"></item>-->
            </argument>
        </arguments>
    </block>
</layout>


texts: Magento backend not working for admin users after server move

texts: Just moved to a new server, everything seem to went fine. The only thing is that any users with "admin" rights on the back-end of Magento just see the image below but staff are fine who dont have administrative permeations in back-end. Ho could I debug this!!


texts: How to add a category in main menu in magento 2

texts: I am new in Magento 2. Can anybody can tell me that how I add a category to the main menu. Thanks


texts: My magento 2 website performs well on pingdom and gtmetrix, but the performance on google pagespeed is very poor. How can I solve it?


texts: Magento2 : Product price coming same for all products

texts:
I have created custom block for home page products which is extend from

Magento\Catalog\Block\Product\ListProduct block.

After that I have called $block->getProductPrice($_product); but it return same price (which is my first product price) for all products.


texts:
I have created a custom attribute(multiselect) for product with the same filter type as category selection on Magento 2. Attribute selection is working fine when creating a new product however it is not working on edit form. I have noticed below error from knockout js on console.

knockout.js:1449 Uncaught TypeError: Cannot read property 'apply' of undefined at Function.ko.observableArray.fn.(anonymous function) [as push]

Also I have attached the screenshots of the error I am facing.

A help to fix this issue would be much appreciated.


texts: Magento 2 InstallSchema not being executed

texts:
I've written a basic Magento 2 custom module. The module is able to register with Magento 2 when I run bin/magento module:enable <module name>. I've checked the setup_module table and the module entry is there and the module is enabled.

I'm having a problem getting my Setup/InstallSchema.php to run. Doesn't matter what I do, the schema installer is never executed. I am assuming this is because when I first performed the bin/magento setup:upgrade command I had a blank InstallSchema.php. Disabling and re-enabling the module doesn't do anything. I've checked the database and Magento doesn't appear to use the database to keep track of the module setup_version. I've tried finding where on disk Magento tracks the currently installed setup_version but so far I've drawn a blank. I know that Magento can call into my module because it is executing the Setup/InstallData.php file quite happily.

This is the Setup/InstallSchema.php file:

<?php
namespace Openxtra\Article\Setup;

use Magento\Framework\Setup\InstallSchemaInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\SchemaSetupInterface;
use Magento\Framework\DB\Ddl\Table;

class InstallSchema implements InstallSchemaInterface
{
    /**
     * Installs DB schema for a module
     *
     * @param SchemaSetupInterface $setup
     * @param ModuleContextInterface $context
     * @return void
     */
    public function install(SchemaSetupInterface $setup, ModuleContextInterface $context)
    {
        $installer = $setup;
        $installer->startSetup();
        $table = $installer->getConnection()
            ->newTable($installer->getTable('openxtra_article'))
            ->addColumn(
                'article_id',
                Table::TYPE_SMALLINT,
                null,
                ['identity' => true, 'nullable' => false, 'primary' => true],
                'Article ID'
            )
            ->addColumn('url_key', Table::TYPE_TEXT, 100, ['nullable' => true, 'default' => null])
            ->addColumn('title', Table::TYPE_TEXT, 255, ['nullable' => false], 'Article Title')
            ->addColumn('content', Table::TYPE_TEXT, '2M', [], 'Article Content')
            ->addColumn('is_active', Table::TYPE_SMALLINT, null, ['nullable' => false, 'default' => '1'], 'Is Article Active?')
            ->addColumn('created_at', Table::TYPE_DATETIME, null, ['nullable' => false], 'Article creation time')
            ->addColumn('updated_at', Table::TYPE_DATETIME, null, ['nullable' => false], 'Article last updated time')
            ->addIndex($installer->getIdxName('article_key_index', ['url_key']), ['url_key'])
            ->setComment('Openxtra Articles');
        $installer->getConnection()->createTable($table);
        $installer->endSetup();
    }
}

Anybody any ideas how I can force Magento 2 to execute my Setup/InstallSchema.php file?


texts:
I'm trying to remove the category from the product page title but I somehow can't get it to work.

Could anyone of you possibly help me ?

It says TITLE and then it displays the category

I was trying to remove

<?php echo $this->getLayout()->getBlock('head')->getTitle(); ?>

From the breadcrumbs.phtml but it removes the whole thing.

Thanks in advance

Armin


texts: magento2 one step checkout order summary item subtotal not display

texts:
Item subtotal not display in one step checkout page. please see attached image.

Please help me why item subtotal not display here?

Price excluding tax call when I see in inspect element.
What will be the cases here why row total not display?
ANSWER:
Hi there
I had the same problem. After some research I noticed that Magento_Wee module is creating these two regions (row_incl_tax and row_excl_tax). I had disabled the Magento_Weee module because I don't need it. But this resulted in both regions that where there but empty. The template checks only if the getRegion() returns something. And that it does! It returns an Empty Array. So by Adjusting this file: vendor/magento/module-tax/view/frontend/web/template/checkout/summary/item/details/subtotal.html and change its contents to:

```


texts: Magento Toolbar problem with custom Sorting code

texts:
I was trying to Sort product listing with created_at and group by Name, that why i added

$this->_productCollection->addAttributeToSort('created_at', 'desc')
                ->getSelect()->group('name');;

before

return $this->_productCollection;

in function _getProductCollection()

//app/code/local/Mage/Catalog/Block/Product/list.php

sorting is working fine but pagination and item quantity showing wrong.

It looks like only 1 products but i have much product here and i have not changed anything in toolbar page.


texts: Magento 1 to 2 data migration root'@'localhost Access denied situation

texts:
Getting there with a Magento 1 to 2 data migration but when I get here http://devdocs.magento.com/guides/v2.0/migration/migration-migrate-settings.html  and run  php bin/magento:settings  I get and permissions issue. How do I open up these permissions in MySql? I have the user root set up to have schema privileges to the DB.

[Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas
  sword: NO)

[PDOException]
  SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using pas
  sword: NO)


texts: Product attribute create issue magento 2

texts:
I am using below script to create product attribute with options.

  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
  $setup = $objectManager->get('Magento\Framework\Setup\ModuleDataSetupInterface');
$eav_setup_factory = $obj->get('Magento\Eav\Setup\EavSetupFactory');

    $setup->startSetup();
    $eavSetup = $eav_setup_factory->create(['setup' => $setup]);
    // Product Attribute
    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'customattribute',
        [
            'type' => 'int',
            'label' => 'Custom Attribute Label',
            'backend' => '',
            'input' => 'select',
            'wysiwyg_enabled'   => false,
            'source' => '',
            'required' => false,
            'filterable' => true,
            'sort_order' => 3,
            'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
            'group' => 'custom attribute group',
            'used_in_product_listing' => true,
            'visible_on_front' => true,
            'option'     => [
            'values' => [
                0 => 'Small',
                1 => 'Medium',
                2 => 'Large',
            ]
        ],
        ]
    );

The options are not getting created with the above code. How can we create options?

The attribute is created once used the above code. Also, can we specify the attribute set to this code? by default, it is adding to the Default attribute set.

Can anybody help me with the above issue?


texts: Magento2: Pre-load cache after clean/flush

texts:
I was wondering if it would be possible to 'preload' the cache after cleaning/flushing it. I know that i.e. 'WP Super Cache' has a function for this in WordPress.

The reason why you want this is that every page loads slowly the first time you open them after cache cleaning. With a preload function, you could make the server read all the pages beforehand, not relying on a visitor to do the first visit.

As far as I know the WP Super Cache plugin calls 5 pages at a time in a loop until it has cached the entire site. Magento would profit from a function like this!


texts: Magento white page at backend and frontend after upgrade to new version

texts:
After Ugrade my website, both the backend and frontend of the site went blank. I have already searched the internet and tried out some possible solutions, but none of them works.

I seriously have no idea how I can solve this, so that’s why I’m here. I hope someone can help me. If you need more information, please ask, I don’t really know what’s necessary to answer my question.

Email: bestlinkt@gmail.com


texts:
I've been encountering an issue where I am unable to translate fields in Magento 2 checkout.

Steps I have take:

Created app/design/frontend/Company/theme/i18n/en_US.csv
Added strings to update:

"Review & Payments", "Review & Pay",
"Apply Discount Code", "Apply Promotional Code"
Ran the following:

bin/magento setup:upgrade
bin/magento cache:flush
php bin/magento setup:content-static:deploy en_US

When refreshing the frontend, the translation in the checkout does not update. However, using the same steps works for all other front-end aspects of the site.


texts:
I flow How to add a tab in product details page using Magento 2 admin panel step to add a custom tab

and I got this error

my file struct

catalog_product_view.xml

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

    <update handle="catalog_product_opengraph" />
    <update handle="page_calendar"/>

        <referenceBlock name="product.info.details">
            <block class="Magento\Catalog\Block\Product\View\Attributes" name="custom.tab" template="product/view/view.phtml" group="detailed_info">
                <arguments>
                    <argument name="title" translate="true" xsi:type="string">Care</argument>
                </arguments>
            </block>
        </referenceBlock>

</page>

view.phtml

<?php
$product=$block->getProduct();
?>

<?php echo $product->getData('custom_tab');?>

How do I add a custom TAB to magento2 product detail？


texts:
Create an SQL script to find a simple product name with its configurable product SKU In Magento 2 [Magento 2]

Anyone with a better solution than my one are appreciated.

Please share your answer.


texts: Magento Server copy to local server giving tmp error

texts:
I copied all the files from live server to local xampp server. when I run the url, getting below tmp error. How to resolve the issue?

Notice: Use of undefined constant tmp - assumed 'tmp'  in C:\xampp\htdocs\shopmyga\lib\Zend\Cache.php on line 153

#0 C:\xampp\htdocs\shopmyga\lib\Zend\Cache.php(153): mageCoreErrorHandler(8, 'Use of undefine...', 'C:\xampp\htdocs...', 153, Array)
#1 C:\xampp\htdocs\shopmyga\lib\Zend\Cache.php(94): Zend_Cache::_makeBackend('File', Array, true, true)
#2 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\Cache.php(137): Zend_Cache::factory('Varien_Cache_Co...', 'File', Array, Array, true, true, true)
#3 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\Config.php(1348): Mage_Core_Model_Cache->__construct(Array)
#4 C:\xampp\htdocs\shopmyga\app\Mage.php(463): Mage_Core_Model_Config->getModelInstance('core/cache', Array)
#5 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\App.php(401): Mage::getModel('core/cache', Array)
#6 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\App.php(295): Mage_Core_Model_App->_initCache(Array)
#7 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\App.php(337): Mage_Core_Model_App->baseInit(Array)
#8 C:\xampp\htdocs\shopmyga\app\Mage.php(684): Mage_Core_Model_App->run(Array)
#9 C:\xampp\htdocs\shopmyga\index.php(87): Mage::run('', 'store')
#10 {main}

After done the changes, now I am getting below error when login as admin:

Warning: Header may not contain more than a single header, new line detected.  in C:\xampp\htdocs\shopmyga\lib\Zend\Controller\Response\Abstract.php on line 360

#0 [internal function]: mageCoreErrorHandler(2, 'Header may not ...',   'C:\xampp\htdocs...', 360, Array)
#1 C:\xampp\htdocs\shopmyga\lib\Zend\Controller\Response\Abstract.php(360): header('Location: http:...', true, 302)
#2 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Controller\Response\Http.php(78): Zend_Controller_Response_Abstract->sendHeaders()
#3 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Controller\Response\Http.php(115):  Mage_Core_Controller_Response_Http->sendHeaders()
#4 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Admin\Model\Session.php(135): Mage_Core_Controller_Response_Http->sendHeadersAndExit()
#5 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Admin\Model\Observer.php(69): Mage_Admin_Model_Session->login('surestce', '12345678', Object(Mage_Core_Controller_Request_Http))
#6 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\App.php(1338): Mage_Admin_Model_Observer->actionPreDispatchAdmin(Object(Varien_Event_Observer))
#7 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\App.php(1317): Mage_Core_Model_App->_callObserverMethod(Object(Mage_Admin_Model_Observer), 'actionPreDispat...', Object(Varien_Event_Observer))
#8 C:\xampp\htdocs\shopmyga\app\Mage.php(448): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#9 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Controller\Varien\Action.php(527): Mage::dispatchEvent('controller_acti...', Array)
#10 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Adminhtml\Controller\Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#11 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Controller\Varien\Action.php(407): Mage_Adminhtml_Controller_Action->preDispatch()
#12  C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Controller\Varien\Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
 #14 C:\xampp\htdocs\shopmyga\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
 #15 C:\xampp\htdocs\shopmyga\app\Mage.php(684): Mage_Core_Model_App->run(Array)
 #16 C:\xampp\htdocs\shopmyga\index.php(87): Mage::run('', 'store')
 #17 {main}


texts: Display validation error on page load on checkout page

texts: Is there any way I can display the validation message 'This is a require field' on page load on checkout page?


texts: Volume check fail - magento 2 data migration delta step

texts:
I have successfully completed migrated data from Magento1-EE(1.12.0.2) to Magento2-EE(2.1.5). To migrate additional data from newer Magento1 database I am trying to use delta step of data migration tool.

I am facing Volume check failed error during migration with warning message Mismatch of entities in the document. I have set map.xml file previously to migrate bulk data using data step.

What should I need to check more to migrate additional data using delta step? Any help would be appreciated.


texts: create category programmatically if not exist - magento 2

texts:
I have one custom table, that table have a column name category which contains the events category like entertainment, national events. Now I need to create category from the table?

note: create category itself enough, don't need to add any products.

I tried with create one category by object manager if the category not exist but it does not work.

    $parentCategory = $this->_objectManager
         ->create('Magento\Catalog\Model\Category')
         ->load('115');
    $category = $this->_objectManager
         ->create('Magento\Catalog\Model\Category');
    $cate=$category->getCollection()->addAttributeToFilter('name',$d["type"])
    ->getFirstItem();
    if(!isset($cate))
    {
    $category->setPath($parentCategory->getPath())
    ->setParentId('115')
    ->setName($d["type"])
    ->setIsActive(true);
    $category->save();
    }

how to deal with automatically create category from table, if not exist already.

Thanks


texts:
I am using Magento 2.3.1 and I am using the Mageside_Stripe module and I am following the instructions from their site, and I am tried to enable the module but it's just been stuck on that for over 15 minutes. What should my next steps be to fix it?

Edit:
When I checked my app/etc/config.php The module wasn't there and now my site is down.


texts: Negative qty on credit memo PDF printout

texts:
I need to have the quantity on the Credit Memo PDF printout with a negative sign.

How can achieve this?


texts: Add noindex to single category in Magento 1.9

texts:
I want to modify this line for only one category:

<meta name="robots" content="INDEX,FOLLOW" />

I want to add noindex like this:

<meta name="robots" content="NOINDEX,FOLLOW" />

I tried to add this code to Custom Layout Update in Custom Design tab of category:

<reference name="head">
    <action method="setRobots"><value>NOINDEX,FOLLOW</value></action>
 </reference>

the result doesn't change.

This is an example of what i have done:

This solution doesn't work.


texts:
I want to install urdu Langauage pack
follow this tutorial

running this command :

  php bin/magento setup:static-content:deploy ur_PK

give this Error:

  [InvalidArgumentException]
  ur_PK argument has invalid value, please run info:language:list for
  list of available locales


texts: Download Orders with VAT/Tax for accounting

texts:
I can't for the life of me see how to export orders which have VAT/Tax. Is this possible?

We need a break down of orders with VAT for accounting purposes for our VAT/Tax return.

Thanks in advance for any help!


texts: Specific hosting options - things to consider

texts:
I find many hosting options whether they be cheap cloud options even up to dedicated servers are aimed (or at least that's how I perceive it) at 1-store setups. We currently host 20+ Magento stores with ranging traffic ranges but all with a similar product base, in fact they're 99.9% similar as they're all resellers for us.

This leads me onto the optimal hosting platform for doing this both now and in the future. We currently have a dedicated server and we're looking to switch to another. However, the new hosting provider (although they haven't pitched this idea to us) offer cloud hosting where you can manage all the sites from one custom control panel. Don't get me wrong, the idea of cloud hosting scares me off, it makes me think of squeezed resources and poor performance, however at the same time it made me think of how a dedicated server is a single point of failure, and for those managing multiple stores, what is the best option?

We have approached several people in the past, but again most of them aim at 1-store setups, not multiple installs. The reason I got thinking about this is that I saw on twitter of another web host I follow having problems on their cloud setup affecting sites beginning with K-P. The more I thought about it, I wondered that although it's a pain for these sites, at least you still have some up. With a dedicated, whilst it's resources are private and you can do as you wish with it, if something goes wrong and the box goes down, so does everything on it.

I'm a bit torn as I kinda like the separation that cloud hosting brings, but it scares me to even approach something like that with Magento.

Thoughts are appreciated.


texts: Magento Commerce Cloud What does cname record do in DNS configuration

texts: I'm going to take the cloud developer certification, and I've been training myselv with some sample tests. there's one question I do not really understand. What is the correct answer in this question? I would choose A. But the correct answer according to the test is B. can someone explain me why B is correct?


texts:
I had a question about Magento 1.8.1.0.
For some reason not start in our Magento installation, the cron jobs.
On the server side, we start the cron.php.
To be sure, we have another cron job started on the server side on a test file. This works perfectly.

Only the original "mymagentofolder / cron.php" to be started cronjobs not start.
We have tested the server-side cron as direct and as a http call.
We have an extension installed for monitoring the Cron (Lanot-CronSheduler).

It displays all the system cron jobs. But no cron job in the queue.

Can it be that you can disable the system or perhaps in a script, the cron job function somewhere? And since we need to activate something?
We have worked in recent months quite a lot of it.


texts: How to clone (copy) an order in magento 2

texts:
I need to create a new order starting for an existing one (but change some options) programatically (I'll create an API to trigger the new order creation passing the starting order id).

Could anyone point me in the right direction to obtain that?

Thank You


texts:
Magento version 2.2.5 doesn't support php 7.1.x and Magento 2.3.0-beta12 requires php ~7.1.3||~7.2.0

  Magento 2.1.x technology stack requirements

  Magento 2.3.0-beta12 requires php ~7.1.3||~7.2.0

Now, what should i do if i want to run both Magento projects ?


texts: Run multiple Magento 2 versions in windows xampp

texts:
I have to work in Magento 2.1.7 and Magento 2.2.5 and for that, I need to install a different version of PHP, I have installed multiple xampp with different port no which resolves PHP requirement.

But now to run Magento CLI with different PHP version is my problem.

Every time to run older Magento I have to change Environment variable in my system. Is there any other workaround for this?

I know windows is not recommended for the Magento 2 development. But I have to use it.

Thanks


texts:
I'd like to set the title and add some scripts in the default Magento Contact page . So in my theme's directory I have added the following file:

Magento_Contact/layout/contact_index_index.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="cms_page_layout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <head>
        <title>Contact1</title>
        <script src="https://....."/>
    </head>
</page>

which is not working. Am I missing something here?

--------------------------------UPDATE-------------------------------------

It seems that many pages have the same issue in my website. Many product pages (not all of them) and some other pages have head title "Create New Customer Account". I have no idea where this comes from and why it affects these pages like that. Any method tested in order to set the head title in these page fails.


texts: Get option Value from Option label for product/store

texts:
Having a option value for an attribute I would like to get the code/id associated to this option value.

How can I get this ?

Sql/Magento model approach are both wellcome

EDIT:
I can retrieve option label for an attribute of a configurable product in this way:

function getRawAttribute($product, $attributeId)
{

$attributes = $product->getTypeInstance(true)->getConfigurableAttributesAsArray($product);

foreach ($attributes as $attr)
    if ($attr['attribute_id'] == $attributeId) {
        foreach  ($attr['values'] as $option)
        $rawAttr[$option['value_index']] = $option['label'];
    }
return $rawAttr;

}

What is missed here for me is the possibility to get the label for a particular store view.

I'm going to evaluate info form this link:
http://blog.chapagain.com.np/magento-how-to-get-attribute-name-and-value/


texts: Add handle from backend into frontend layout

texts:
I am working in a marketplace extension  and I need to use some blocks from adminhtml(backend blocks),  Actually I want to use all blocks in  handle to be used in the frontend by sellers to add their new products .
I try to update current layout by :

 $this->loadLayout('adminhtml_catalog_product_new');

but It doesn't work.


texts:
I'm currently testing a new Magento 2 shop, based on a Templatemonster theme and appear to have a bug with the persistent login welcome message at the top of the page.

It displays the following:

Welcome, Customer Name! Not you?

If I inspect the source, here is the full html that is being outputted-

            <span data-bind="text: customer().fullname ? $t('Welcome, %1!').replace('%1', customer().fullname) : 'Welcome, Customer Name! Not you?'">Welcome, Customer Name! &lt;span&gt;&lt;a href="http://shop2.domain.com/en/persistent/index/unsetCookie/" &gt;Not you?&lt;/a&gt;&lt;/span&gt;

Anyone know where I should look?


texts: Magento Discount Filter IN Layered Navigation

texts: I want To create Magento Discount Filter In Magento. Which Will Be on Base Of Special Product. If Product Price is 400 and special Price is 200. then Discount  Will be 50% like this all.. The Filter is base on price Difference....It will automatically...created on based on price Difference.....


texts: Magento 2: How to get the manage_stock attribute?

texts:
I'd like to get the manage_stock and use_config_manage_stock status in that looping that I've created to check before to apply the new status:

$useConfigManageStock = '0';
$manageStock = '0';

$collection->addAttributeToSelect('*')->load();

$customStock = ['use_config_manage_stock' => $useConfigManageStock, 'manage_stock' => $manageStock];

foreach ($collection as $product) {
            $product->setStockData($customStock);
            $product->save();
        }

Thanks!


texts: Get Subtotal, Discount, Tax, and Total for this address at multiple addresses overview

texts:
How could I get the data for Subtotal, Discount, Tax, and Total for this address at multiple addresses overview checkout like at picture below?

Any help would be greatly appreciated.


texts:
I have added custom form in customer account navigation.

Looking for code to form validation.

is there anything like form-validate like in magento1?

I have used in magento1 like below.

var dataForm = new VarienForm('form-validate', true);

Like that anything is there in magento2? How can we do form validation in magento 2?


texts: Layout handle for product grid and list view

texts:
I have created my own small extension to handle what is displayed for the in-stock and out-of-stock messages.

In the layout file MyModule_Availability.xml I have

<PRODUCT_TYPE_simple>
    <reference name="product.info.simple">
        <action method="setTemplate">
            <template>MyModule/Availability/catalog/product/view/type/default.phtml</template>
        </action>
    </reference>
</PRODUCT_TYPE_simple>

which works like a charm.

But that is only the individual product. I want to display the same changes in list and grid mode as well.

So I am trying to find what I need to put around

    <action method="setTemplate">
        <template>MyModule/Availability/catalog/product/list.phtml</template>
    </action>

For my list.phtml to be used.

When I display handleinformation in the shop I get the following:

frontend/default/ma_erida/template/catalog/product/list.phtml

Mage_Catalog_Block_Product_List

I hope you can help.


texts: Magento 2 : Javascript Developer Certification reading material

texts:
Magento just announced   JavaScript Certification exam for Magento2.

After reading in this page:

  https://u.magento.com/magento-2-certified-professional-javascript-developer

I have some questions about this JavaScript Developer Certification exam.

Which study materials useful for preparation of Java script Certification exam?
What is the passing score for this Java script Certification exam?
Is there any other study materials available for this exam?
What is the retake policy for this exam?


texts: How to search by sku with space in magento?

texts:
I have face some problem in catalog search by SKU.

My sku is PW 512/24. It will give me multiple result for this SKU.
Please help me How can I search product with SKU including space?

Thank you in adavance!


texts: Magento 1.9 Admin Panel is showing Blank...Header with no menus

texts: Magento admin panel is showing blank with header with no menus


texts: Magento 2 API to get all products with filter

texts:
I am working on an API where I need all product of Magento store. I am using postman to make a collection, but I am getting this error.
kindly tell me what is causing this error

image with the new error


texts: Magento 2 - Warm Cache Vs Cold Cache Concept (With Varnish & Redis)

texts:
I want to know the concept difference between warm cache and cold cache.

How do we use both these techniques effectively with varnish and Redis cache.

Any help, knowledge and experience sharing would be appreciated.


texts: Magento 2.2. Get error with ''@param string[] $types' in REST API

texts:
Using magento 2.2. I create rest api for edit address which need pass param in 'array of string' but i get an error:

Doc: Magento Configure services as web APIs

Used array of string for pass param

  "street": ["new, wat phnom, phnom penh"]

Message

  "message": "Error occurred during \"street\" processing. Invalid type for value: \"array\". Expected Type: \"string\".",

My JSON

  {
      "address":{
          "addressId":85,
          "street": ["new, wat phnom, phnom penh"],
          "latitude":"11.33333664",
          "longitude":"104.99778855"
      }
  }

Interface

<?php
namespace Iota\EShopping\Model\Address;

class Address
 {
private $addressId;
private $street;

/**
 * addressId
 * @return int
 */
public function getAddressId(){
    return $this->addressId;
}

/**
 * addressId
 * @param int $addressId
 * @return Address
 */
public function setAddressId($addressId){
    $this->addressId = $addressId;
    return $this;
}

/**
 * street
 * @return string
 */
public function getStreet(){
    return $this->street;
}

/**
 * street
 * @param string[] $street
 * @return Address
 */
public function setStreet($street){
    $this->street = $street;
    return $this;
}
}


texts: Magento2 Website URL redirects to Base URL in order success page

texts:
We are using Magento 2.4.1 Cloud commerce version. We have multi-websites implemented.
We are facing following issue,
Access to font at https://ebase.domain.com/static/version1525635663/frontend/ustheme/fonts/opensans/reqular/opensans-300.woff2 from origin https://eus.domain.com/ has been blocked by CORS Policy: No 'Access-Control-Allow-Origin' header is present on requested resource
On Order success page, We are getting errors as the font files(*.woff) are loaded from base url.
Expected: Like other pages it should load from website url.
For eg:
Website URL : https://eus.domain.com/
Base URL: https://ebase.domain.com/
Any help appreciated, Thanks !


texts: You did not sign in correctly or your account is temporarily disabled. Magento 1

texts:
On localhost can't login to admin panel.

It does not work with newly created admin users also.

After log in attempt i see that magento creates session files in var/session. No error in system.log.

Problem appeared after i moved installation to another computer.


texts:
Im trying to set up a Magento Multistore (1.9) with 300k Products distributed over one website with ~30 stores.  Each store has his own root category (10k products).

Its not possible for me to reindex my products. Reindex fails after several hours with a Mysql Error "The total number of locks exceeds the lock table size"

Anyway while debugging I noticed that when rebuilding the product flat index, a database table for each store is being written. So far so good BUT each product flat db table (i.e catalog_product_flat_4) contains ALL 300k products.

Thats what I dont understand. I thought if you had a different root category for each store only the products of that category had to be indexed for each store.

Expectation:

  catalog_product_flat_4 = 10k rows

  catalog_product_flat_5 = 10k rows and so on

Reality:

  catalog_product_flat_4 = 300k rows

  catalog_product_flat_5 = 300k rows and so on

What is wrong with my expectation?

// edit

One little example to maybe make my issue more clear:
I want to sell shoes and printer. I want to have to different stores, one that has all my shoes and one with all printers. I want to manage Customers,Orders etc in one place. In the printer store/store_view customers should not be able to see/buy printers and vice versa.

To archieve that im using one Magento instance with one website and two stores with two different root categories.

Why on earth would the product flat table for the store with the shoes have also the printers from the other store?


texts: Magento SUPEE-1533 5344 127: not found when patching

texts:
I'm having the following issue with the recent patches.

Magento CE Version 1.9.0.1

usr/home/******/public_html/****** > sh PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh

127: not found 127: not found 0: not found

Checking if patch can be applied/reverted successfully...

/usr/home/******/public_html/****** > sh PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh

127: not found 127: not found 0: not found

Checking if patch can be applied/reverted successfully...

patch: unrecognized option `--dry-run' Usage: /usr/bin/patch [options] [origfile [patchfile]] [+ [options] [origfile]]...

Options:
   [-cCeEflnNRsStuv] [-b backup-ext] [-B backup-prefix] [-d directory]
   [-D symbol] [-F max-fuzz] [-i patchfile] [-o out-file] [-p[strip-count]]
   [-r rej-name] [-V {numbered,existing,simple}] [--check] [--context]
   [--prefix=backup-prefix] [--suffix=backup-ext] [--ifdef=symbol]
   [--directory=directory] [--ed] [--fuzz=max-fuzz] [--force] [--batch]
   [--ignore-whitespace] [--forward] [--reverse] [--output=out-file]
   [--strip[=strip-count]] [--normal] [--reject-file=rej-name] [--skip]
   [--remove-empty-files] [--quiet] [--silent] [--unified] [--version]
   [--version-control={numbered,existing,simple}] [--index-first]

ERROR: Patch can't be applied/reverted successfully.

Hopefully I'm missing something obvious here. If not can someone link to an article on manually applying the patches if such an article exists. I did have to manually remove the cache to get back into the back-end after this so I'm not sure if the patch did something.

As always thank you for the help


texts: Custom Extension to upload images for slider in magento 2.2

texts:
I want to develop new module by custom code for uploading images and store in database, further i want to use that images in custom areas, like slider or in content area.

I had created half module,right now my module can do:

Automatically Create database on installation in phpmyadmin
Insert data in database, right now i had given data manually.
Shows module in menu, "manage tab" under menu.
Manage tab shows list of data stored in module table of database.

Now i am stuck at point to add new data from admin panel.When i click on "add new banner" it must shows form to add new data and store data in database by clicking on Save button.

TIA


texts: Save shipping address after discount code applying

texts:
All previously filled information with shipping address is deleted, if I use coupone code in my cart summary block.

As you can see State and Zip code are chosen.

And then, if I apply discount code all information are gone.

How can I fix it?


texts:
As you all know that MySql 8.X will be released soon.
So is Magento 2 compatible with MySQL 8?


texts: Installing extension from Magento 2 marketplace

texts: I am installing my first Magento 2 extension which I purchased from the Marketplace. Is it necessary to increase the PHP memory limit to 2000M or can I leave it at 768M?