texts:
I'm using Magento 1.9.3.4 AND KeyCDN. I configured the js/media/css files to come from CDN. On the CDN I enabled the CORS. The CDN uses HTTP/2, shared SSL and the Origin Shield setting is set to "disabled".

The problem is with my Magento WYSIWYG editor, because the javascript files come from CDN and I receive the error:

SecurityError: Permission denied to access property "tinymce" on cross-origin object

I tried to deactivate HTTPS for the backend but it's still enabled.

Please tell me if I can make some changes in order to make the tinyMce to work from CDN. Otherwise I'll have to change the JS path to use the server path instead of the CDN.

I changed System/Configuration/Web/Secure and Unsecure Javascript Base URL to: https://examplecdn.com/js/ instead of: {{unsecure_base_url}}js/

If you have any idea please say it. Thanks.


texts:
I created a new attribute and I need to add it to almost all products and since I am new with Magento I don't exactly know how to do that.

Can this be done by simply adding the attribute to an attribute set that is linked with all the products or does this need to be done in a different way?

If this is the correct way just leave a simple yes and if not could you explain me how to do this?


texts: it is possible to remove sidebar for specific category product listing?

texts:
my file : Vendor/theme/Magento_Catalog/templates/category/products.phtml
i made this changes
`

if($category_name == 'Featured Product'){?>
     <!--  when Featured Products -->
            <style>
           .sidebar{
                    display:none;

            }
            .toolbar{
                display:none;
            }
        </style>
       <?php echo $this->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('featured_product_top')->toHtml(); ?>

        <?php if (!$block->isContentMode() || $block->isMixedMode()): ?>
            <?= $block->getProductListHtml() ?>
        <?php endif; ?>
    <?}else{?>
    <!--  other ctegories -->
    <?php
        /**
         * Category view template
         *
         * @var $block \Magento\Catalog\Block\Category\View
         */
        ?>
        <?php if (!$block->isContentMode() || $block->isMixedMode()): ?>
            <?= $block->getProductListHtml() ?>
        <?php endif; ?>

    <?php } ?>`


texts: editing content pages and configuration hangs (spinning donut)

texts:
This has happened to me twice now: I get the site installed, I get the template installed, and eventually I start customizing the site and the content pages in the backend stop loading.  The first time, I couldn't edit the default theme for the global site.  The current time, I can't load pages to edit.

The flow looks something like this:

go to edit some content

go to edit a page

page appears to load, but the donut doesn't go away

Any suggestions?  I can't continue to update the theme without this working. :(


texts: Admin Login form empty after upgrade to 1.9.4.2

texts:
After upgrading from 1.9.4.1 to 1.9.4.2, the login form for the backend is empty (No input tags for username or password). This is same after cache has been cleared. Does anyone have a solution?

The call to this->getFormKey(); appears to be causing the problem.

<input name="form_key" type="hidden" value="<?php echo $this->getFormKey() ?>" />


texts: Magento 2.3.3 Luma theme Checkout not showing payment options

texts:
Well, Ive seen more questions on this topic but there doesn't seem to be an answer, so let me try with my specific problem

Magento: 2.3.3 stock, nothing added
Theme: Luma (nl_NL mode)
Payment methods: Bank tranfer (enabled)
Added one test product, set taxes, customer class, pricing, all ...

Cannot get anything, not even page title h1 to render on the page. It just shows the header and footer, nothing else.

Tried:

setup:upgrade
setup:di:compile
setup:static-content:deploy -f
setup:static-content:deploy nl_NL -f
cache:clean
cache:flush

Nothing works ... you can see it here: https://blokjeswebshop.nl/checkout/


texts: WYSIWYG editor showing html content in frontend?

texts:
I am adding WYSIWYG editor using the UI component in the magento2 custom module. But when I am adding the data by widget then it is not showing in a proper way. What is the issue?

*custom_hello_data.xml file in uicomponent.*

<field name="content">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">text</item>
                    <item name="formElement" xsi:type="string">wysiwyg</item>
                    <item name="source" xsi:type="string">content</item>
                    <item name="label" xsi:type="string">Content</item>
                    <item name="template" xsi:type="string">ui/form/field</item>
                    <item name="wysiwyg" xsi:type="boolean">true</item>
                    <item name="dataScope" xsi:type="string">content</item>
                    <item name="sortOrder" xsi:type="number">50</item>
                    <item name="rows" xsi:type="number">8</item>
                    <item name="wysiwygConfigData" xsi:type="array">
                        <item name="is_pagebuilder_enabled" xsi:type="boolean">false</item>
                        <item name="toggle_button" xsi:type="boolean">true</item>
                        <item name="height" xsi:type="string">200px</item>
                        <item name="add_variables" xsi:type="boolean">true</item>
                        <item name="add_widgets" xsi:type="boolean">true</item>
                        <item name="add_images" xsi:type="boolean">true</item>
                        <item name="add_directives" xsi:type="boolean">true</item>
                    </item>
                </item>
            </argument>
    </field>

in frontend for print the data I am using template file


texts: Magento 2 is there a faster way to change product media gallery entries programmatically

texts:
I need to do a massive update of product data but what I need to do can't be achieved with product import. In example I need to update media gallery and categories for given products, but the solution I came out with takes too long.

A little recap:
I added a command to the Magento 2 CLI that, given a json configuration file, removes, adds, updates or sorts media gallery entries for a given product like this. Here I paste an excerpt of the code:

/* $product is of type Magento\Catalog\Model\Product */

//get existing media gallery
$existingMediaGallery = $product->getMediaGallery();

/*
   do stuff with media gallery (alter $existingMediaGallery)
   (add, remove, sort, ...)
*/

//set media gallery again
$product->setMediaGallery($existingMediaGallery);

//process media gallery
$mediaGalleryEntries = $product->getMediaGalleryEntries();
$this->getMediaGalleryProcessor()->clearMediaAttribute($product, array_keys($product->getMediaAttributes()));
if ($mediaGalleryEntries) {
  foreach ($mediaGalleryEntries as $k => $entry) {
    if (!isset($entry['removed']) && !empty($entry['types'])) {
      $this->getMediaGalleryProcessor()->setMediaAttribute($product, $entry['types'], $entry['file']);
    }
  }
}

//save product
$product->save();

Since it's a massive update the "$product->save()" line is called many times and always takes from 2 to 4 seconds. Since I need to launch the code for thousands of products I need a faster way to do that.

I tried with

$product->getResource()->saveAttribute($product, 'media_gallery');

and

$product->addAttributeUpdate('media_gallery', $mediaGallery, $storeId);

but that doesn't work for media gallery (only works for eav I think).

Is there a way to save only media gallery and persisting these changes faster?

(What I look for is something like Magento\Catalog\Api\CategoryLinkManagementInterface::assignProductToCategories method that saves category/product association faster than a full product save)


texts:
I have custom module named Rkt_CustomBlock. I am trying to connect it to the database. My table name is socialcoupon. My path of the module is public_html/dev/app/code/local/Rkt/CustomBlock/Model. what I want to know is what should i put in  Rkt.php. The xml declaration is working.

     <?php
class Rkt_customblock_Model_Mysql4_Rkt extends Mage_Core_Model_Mysql4_Abstract
{
     public function _construct()
     {
         $this->_init('rkt/socialcoupon', 'scid');
     }
}

I am confused about $this->init. what should i put in it? is it rkt/rkt? or something else

my config file

<?xml version = "1.0"?>
<config>
    <modules>
        <Rkt_CustomBlock>
            <version>1.0.0</version>
        </Rkt_CustomBlock>
    </modules>
    <frontend>
        <routers>
            <rkt_customblock>
                <use>standard</use>
                <args>
                    <module>Rkt_CustomBlock</module>
                    <frontName>helloworld</frontName>
                </args>
            </rkt_customblock>
        </routers>
        <layout>
            <updates>
                <rkt_customblock>
                    <file>rkt_customblock.xml</file>
                </rkt_customblock>
            </updates>
        </layout>
    </frontend>
    <global>
        <blocks>
            <rkt_customblock>
                <class>Rkt_CustomBlock_Block</class>
            </rkt_customblock>
        </blocks>
        <models>
            <customblock>
                <class>rkt_customblock_Model</class>
                <resourceModel>customblock_mysql4</resourceModel>
            </customblock>
            <customblock_mysql4>
                <class>rkt_customblock_Model_Mysql4</class>
                <entities>
                    <socialcoupon>

socialcoupon

                    </socialcoupon>

                </entities>
            </customblock_mysql4>
        </models>
        <resources>
            <customblock_setup>
                <setup>
                    <module>rkt_customblock</module>
                </setup>
                <connection>
                    <use>core_setup</use>
                </connection>
            </customblock_setup>
            <customblock_write>
                <connection>
                    <use>core_write</use>
                </connection>
            </customblock_write>
            <customblock_read>
                <connection>
                    <use>core_read</use>
                </connection>
            </customblock_read>
        </resources>
    </global>
</config>


texts: Create Shopping cart promotion rule using SOAP API

texts: How to create Shopping cart promotion rule using SOAP API?


texts: I need to add a file upload field on the registration form to allow users to upload documents on their profile, how can I do that? Thanks.


texts: Bundle or Grouped Product set with default quantity

texts:
I have simple products for sale in my store that I want to group together.
We want to create a bundle or grouped listing that has a fixed quantity other of the default (1), thus creating a package deal that can't be altered by the customer and comes as a fixed price.
Is there a way to do this? I've tried making all configurable, bundle and grouped but they all give the option of the customer to have to checkbox something.


texts: Catalog search Page links are not working

texts: I'm having an issue with catalog search page where i can see all the products according to my search but page links and sort by dropdown filter is not working. can anyone please guide me where i need to look into. Thanks


texts: Cancelling an order is messing up the increment IDs

texts:
Here's the scenario. For example $oldOrder has an increment ID of 100000044

if($oldOrder->canCancel()) {
            $order->cancel();
            $order->save();
}

When I call the above, for some reason, it's messing up the increment ID, which is becoming 000000062.
In addition, if I create a new order, it will have the same increment ID of the old ordder, which is 100000044, even though the increment ID is assumed to be unique.

This is causing an issue, as the increment ID might have been used in a call to the 3rd party payment gateway previously, and linked from their side to the old order, as the increment ID is supposed to be unique to each order.

Am I doing something wrong? How do I fix this? I noticed that the increment ID doesn't mess up when I manually cancel it from the admin page, instead of the php script..

I'm creating an order the following way:

    $billingAddress = $quote->getBillingAddress()->addData($billingAddress);
    $shippingAddress = $quote->getShippingAddress()->addData($shippingAddress);

    $shippingAddress->setCollectShippingRates(true)->collectShippingRates()
                    ->setShippingMethod('flatrate_flatrate')
                    ->setPaymentMethod('purchaseorder');
    $quote->setBillingAddress($billingAddress);
    $quote->setShippingAddress($shippingAddress);
    $quote->getPayment()->importData(array('method' => 'purchaseorder'));
    $quote->collectTotals()->save();
    $quote->setReservedOrderId(null);  //----This solved the increment issue.
    $quote->reserveOrderId();
    $quote->save();

    $service = Mage::getModel('sales/service_quote', $quote);
    $service->submitAll();
    $order = $service->getOrder();
    // Mage::getSingleton('checkout/session')->setOrderId($order->getId());
    //$quote->setIsActive(0)->save();
    return $order;


texts: PayPal, Authorize.net, and other payment gateways and PSPs

texts:
I have a generic question concerning processing payments with Magento.

First of all, what is the difference between the PayPal Website Payment
Standard option available in Europe and the PayPal Payment Standard
option available in the USA?
Also, some European countries also display a separate Paypal Express Checkout
option. Is this option mutually exclusive with PayPal Website Payment Standard?
That is, do I need to configure either one or the other. Is it advantageous or
even possible to configure both options?

A. PayPal Payment Standard:
   Accept credit card and PayPal payments securely.

B. PayPal Website Payment Standard:
   Accept credit card and PayPal payments securely.

C. PayPal Express Checkout:
   Add PayPal as an additional payment method to your checkout page.

It seems to me that A and B are really the same thing, just offered
in different locations around the globe under a different name, and
that if I choose option B then this is equivalent to option C plus
I can also process credit cards, so B is more advantageour than C
and if I go with option B then I do not need option C. Is this correct?

This may sound like a stupid question, but if I go with PayPal then
do I still need to go through a PSP (Payment Service Provider)?
Presumably PayPal cannot act as a PSP and so I need one to
enable transactions between my online store and Paypal?
What is the difference between a payment gateway and a PSP?
I'm tempted to go with Authorize.net as the PSP, just because it is
available by default and should thus be proven, tested, and stable,
unlike some other extensions which might be buggy, especially now
that a new release of Magento has been published. Or are the other
Magento PSP extensions equally viable alternatives? How do these
compare in terms of pricing and availability. Is Authorize.net
available globally, or is it just available, say, in the US?

Thanks for answering my questions.

I appreciate your input.


texts: Porto Theme in Magento 2 Doesn't Match Demo Site

texts:
I’m having some issues installing the Porto Theme into Magento 2.3.1. I began installing the theme using the Documentation (as linked above). I uploaded the theme files into my server along with the patches that Porto has added for better functionality. Then I went in and applied the setup:upgrade command and imported my demo of choice. What came out was not an exact replica of the demo I wanted. The header was white and blue, not the black with white text I was expecting.

So then I tried using the Quick Start Package files which ended up taking my site down altogether. Luckily I created a snapshot in DigitalOcean so I could reset things back to the working order. I don’t have any products or customizations yet. I’m wanting to do that after I setup the theme correctly.  But now, I have no idea what I am supposed to do.

Here are some snapshots: Installation Results vs Desired Demo


texts: cacheable="false" not working in catalog_product_view.xml file

texts: I am trying to make product view block non cacheable so that on depending upon cart item count i can dynamically show some messages to user. The message is properly displaying when full page cache is disabled but not working when full page cache is enabled. I am using magento 2.1.8.


texts: Attempting to install SUPEE 6285 CE 1.8.1.0

texts:
Trying to install the above and I am running into this error:

  1 out of 1 hunk ignored -- saving rejects to file
  app/design/frontend/default/modern/template/checkout/cart.phtml.rej
  The next patch would create the file downloader/Maged/.htaccess, which
  already exists!  Assume -R? [n] Apply anyway? [n] Skipping patch. 1
  out of 1 hunk ignored patching file downloader/Maged/Controller.php
  patching file downloader/Maged/Model/Session.php The next patch would
  create the file downloader/lib/.htaccess, which already exists!
  Assume -R? [n] Apply anyway? [n] Skipping patch. 1 out of 1 hunk
  ignored patching file downloader/template/connect/packages.phtml
  patching file downloader/template/connect/packages_prepare.phtml Hunk
  1 FAILED at 33. 1 out of 1 hunk FAILED -- saving rejects to file downloader/template/connect/packages_prepare.phtml.rej patching file
  downloader/template/login.phtml patching file
  downloader/template/settings.phtml patching file errors/processor.php
  Hunk #1 FAILED at 460. 1 out of 1 hunk FAILED -- saving rejects to
  file errors/processor.php.rej

How do I fix this to patch correctly?


texts: how to get current csv row number in magento2?

texts:
I want to add condition on rownumber :

like if ($row==1){
echo "test";
}
else{
echo "done";
}

file path:Magento\ImportExport\Model\Import\Source\csv

protected function _getNextRow()
{
    $parsed = $this->_file->readCsv(0, $this->_delimiter, $this->_enclosure);
    if (is_array($parsed) && count($parsed) != $this->_colQty) {
        foreach ($parsed as $element) {
            if (strpos($element, "'") !== false) {
                $this->_foundWrongQuoteFlag = true;
                break;
            }
        }
    } else {
        $this->_foundWrongQuoteFlag = false;
    }

    return is_array($parsed) ? $parsed : [];
}

i want set condition like below in this function :

     if($row==0)
    {
         $parsed[]=
   \Magento\CatalogImportExport\Model\Import\Product::COL_TYPE;
    $parsed[]=
    \Magento\CatalogImportExport\Model\Import\Product::COL_ATTR_SET;
    $parsed[]= self::COL_ATTR_SET;
    }else{
$parsed[]=something else;
         }

}


texts: How to trigger an event only on record creation and not on updation?

texts:
I have a custom admin grid module. When I add an item to that grid it calls the saveAction() in the controller of my module (obviously).

I need to trigger a custom event after the record gets saved (like shown below).

public function saveAction() {
    if ($data = $this->getRequest()->getPost('tendor')) {
    try {
            $tendor = $this->_initTendor();
            $tendor->addData($data);
            $products = $this->getRequest()->getPost('products', -1);
            if ($products != -1) {
                $tendor->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));
            }
            $tendor->save();
            // custom event to save vendor code
            $evtData = array('tendor_info' => $data, 'tendor_instance' => $tendor);
            Mage::dispatchEvent('my_custom_tendor_save_after', $evtData);

Now I want this event to be triggered only when a new record is added and not when the existing record is edited.

  How can I find the difference between creation of record and updation
  of a record?

can someone help me in figuring this out?


texts: Custom styles not work in new theme Magento 2

texts:
Read a lot: Create a storefront theme
My steps:

Create a theme directory app/design/frontend/My-vendor/default
Copy all files from vendor/magento/theme-frontend-luma to app/design/frontend/My-vendor/default
Change files: registration, theme. So now I have my theme same luma.
I chose in admin-panel my new theme.
Important remove pub/static.
Now I try add or change style theme, chenge _theme.less in app/design/frontend/My-vendor/default/web/css/source, but not have changes. Why? What i do wrong? I always delete pub/static. Realy need help.


texts: How to use step wizard ui component in Magento 2?

texts:
I want to add the step-wizard form in my UI form, but I am unable to find the xml configuration needed to create the step-wizard in Magento 2.

Note: I already have tried the Modifier way as in Product Form but was not successful.

The example are given below.

https://devdocs.magento.com/guides/v2.3/pattern-library/navigation/wizard/wizard.html


texts:
When I'm trying to edit a product(the product already has an image) and add another image, the image is uploaded correctly in the /media/catalog/.. directory. The image is displayed correctly in the Admin-area, the mousehover and everything is working fine.

After save the product, the image is disappeared in the Admin-area and that is not displaying on front end either.

There are no errors in the php or Magento log.

Thank you for your help.


texts: Magento 2 REST API: Get list and details of all active coupons

texts:
Is there an API to get the list of all active coupon codes from magento 2?

  /V1/coupons/search

this shows me all the coupons, but it doesn't give any information about if the coupon is active or it's description.

and

  /V1/salesRules/search

This gives the details but not the coupon code.

Is there any way to get all details in a single api call?

Please help!

Thanks!


texts: Magento 2.0: How to override the name.phtml

texts:
How Can I override below name.phtml file from customer module

vendor/magento/module-Customer/view/frontent/templates/Widget/name.phtml


texts:
When I open the edit form in admin, the fields are empty, the data is not loaded from DB. Loading still work.

Files:

Form.php
https://pastebin.com/8TJ54KSi

StoreController.php
https://pastebin.com/utZ0ydHR

Edit.php
https://pastebin.com/WHTCQ03c

Grid.php
https://pastebin.com/MrxfYpTc


texts: Success confirmation page not showing after checkout

texts: By using cash on delivery it is not redirecting to success or failure page, It is one page checkout, with other online payments it is redirecting well.. but not using cash on delivery


texts:
As a developer many times, I need to test created module/functionality.
For example I need to create an observer which listening to sales_order_place_after.
For check whether observer is working correctly or not I need to place actual order.

Sometimes to test code, I need to place 50-60 orders.

Is there any way in which I can test my code without actual order ?

because creating an order is a time consuming process.

Thanks in advance.


texts: How to remove 'Subscribe' field from Luma footer

texts: I've gotten rid of the links but 'subscribe' field is still there. How is this referenced? Meaning I want it gone, not just hidden. Seems like this should be easy but can't figure it out - Thanks.


texts: Why the new keyword has been used directly?

texts:
Why the new keyword has been used in dispatch method in \Magento\Framework\Event\Manager class ?

/**
     * Dispatch event
     *
     * Calls all observer callbacks registered for this event
     * and multiple observers matching event name pattern
     *
     * @param string $eventName
     * @param array $data
     * @return void
     */
    public function dispatch($eventName, array $data = [])
    {
        $eventName = mb_strtolower($eventName);
        \Magento\Framework\Profiler::start('EVENT:' . $eventName, ['group' => 'EVENT', 'name' => $eventName]);
        foreach ($this->_eventConfig->getObservers($eventName) as $observerConfig) {
            $event = new \Magento\Framework\Event($data);
            $event->setName($eventName);

            $wrapper = new Observer();
            $wrapper->setData(array_merge(['event' => $event], $data));

            \Magento\Framework\Profiler::start('OBSERVER:' . $observerConfig['name']);
            $this->_invoker->dispatch($observerConfig, $wrapper);
            \Magento\Framework\Profiler::stop('OBSERVER:' . $observerConfig['name']);
        }
        \Magento\Framework\Profiler::stop('EVENT:' . $eventName);
    }


texts:
I am working with magento 2, I created an e-commerce site and everything works fine, but suddenly the payment page displays No Payment Methods.

I cleared the browser cache, but the problem persists.

Can anyone help me?


texts: Direct change of multiple products possible?

texts:
Is there a way to change multiple products without using Bulk Actions?
I am on 2.3.5 version.
I remember, that this was possible in former version. Just selcting more products, select "change atrributtes", do the changes and save.
Maybe somebody knows how to setup this, if it is still possible.
Regards,
Chequille


texts:
I am trying to override Magento's addLinkRel method to set custom canonical tags: I want my shop's canonical tags to point to the main shop's pages.

So I created code/local/Fkoessler/MyProduct/etc/config.xml:

<config>
    <modules>
        <Fkoessler_MyProduct>
            <version>0.1</version>
        </Fkoessler_MyProduct>
    </modules>
    <global>
        <blocks>
            <page>
                <rewrite>
                    <html_head>Fkoessler_MyProduct_Block_Html_Head</html_head>
                </rewrite>
            </page>
        </blocks>
    </global>
</config>

And code/local/Fkoessler/MyProduct/Block/Html/Head.php:

class Fkoessler_MyProduct_Block_Html_Head extends Mage_Page_Block_Html_Head
{
    /**
     * Add Link element to HEAD entity
     *
     * @param string $rel forward link types
     * @param string $href URI for linked resource
     * @return Mage_Page_Block_Html_Head
     */
    public function addLinkRel($rel, $href)
    {
        $href = str_replace('/paris', '', $href);
        $href = str_replace('/nimes', '', $href);
        $href = str_replace('/niort', '', $href);
        $this->addItem('link_rel', $href, 'rel="' . $rel . '"');
        return $this;
    }
}

However, my custom method is not picked up at all. What am I doing wrong?

EDIT:

So I understand that using an observer is better than using class inheritance. Here is how I set it up:

etc/modules/Fkoessler/Canonical.xml
<?xml version="1.0"?>
<config>
    <modules>
        <Fkoessler_Canonical>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
              <Aitoc_Aitsys/>
            </depends>
        </Fkoessler_Canonical>
    </modules>
</config>

-

app/code/local/Fkoessler/Canonical/etc/config.xml
<?xml version="1.0"?>
<config>
    <modules>
        <Fkoessler_Canonical>
            <version>0.1</version>
        </Fkoessler_Canonical>
    </modules>
    <global>
        <models>
            <fkoessler_canonical>
                <class>Fkoessler_Canonical_Model</class>
            </fkoessler_canonical>
        </models>
        <events>
            <core_block_abstract_to_html_before>
                <observers>
                    <fkoessler_catalog_core_block_abtract_to_html_before>
                        <type>singleton</type>
                        <class>fkoessler_canonical/observer</class>
                        <method>coreBlockAbstractToHtmlBefore</method>
                    </fkoessler_catalog_core_block_abtract_to_html_before>
                </observers>
            </core_block_abstract_to_html_before>
        </events>
    </global>
</config>

-

app/code/local/Fkoessler/Canonical/Model/Observer.php
class Fkoessler_Canonical_Model_Observer
{

    public function coreBlockAbstractToHtmlBefore($observer)
    {
        error_log('im observing you');
        $block = $observer->getBlock();
        if ($block instanceof Mage_Page_Block_Html_Head) {
//            $block->removeItem('link_rel', [the current URL]);
//            $block->addLinkRel('canonical', [edited URL]);
        }
    }
}

So I managed to enter my coreBlockAbstractToHtmlBefore method when the core_block_abstract_to_html_before is fired. Now how can I get the canonical url set by Magento core to modify and return it?

$observer->getBlock(); returns an instance of Mage_Page_Block_Html


texts: Invalid date type error when saving date inline from ui grid in magento2

texts:
Getting error Invalid date type in magento2

my code is:

<column name="from_date" class="Magento\Ui\Component\Listing\Columns\Date">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">dateRange</item>
             <item name="editor" xsi:type="array">
                <item name="editorType" xsi:type="string">date</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">true</item>
                </item>
                 <item name="options" xsi:type="array">
                    <item name="dateFormat" xsi:type="string">yyyy-MM-dd</item>
                    <item name="timeFormat" xsi:type="string">HH:mm:ss</item>
                    <item name="showsTime" xsi:type="boolean">true</item>
                </item>
            </item>
            <item name="component" xsi:type="string">Magento_Ui/js/grid/columns/date</item>
            <item name="label" xsi:type="string" translate="true">Starting Date</item>
            <item name="dateFormat" xsi:type="string">yyyy-MM-dd hh:mm:ss a</item>
        </item>
    </argument>
</column>


texts:
How can one limit the change of scope in Magento 2 admin https://nimb.ws/QVDXuL.

Like if a user is ABC then he can only view ABC store view and not default store settings in (dashboard and configuration page).

Because I am using a multi-store with websites and created different users for each store. So I don't want any user to see default configurations.


texts: Magento2 import sales tax rates via admin panel

texts:
I have a Excel file saves as a .csv and no matter what I do it keeps saying invalid file format.

I exported the excel the tax rates that where on the site then edited the file in excel and saved as csv


texts: How to call controller action from another controller or model in magento 1

texts:
Requirement:
How to call the controller action from another controller or model with post data


texts:
With method catalogProductAttributeCreate SOAPv2 ver. 1.7.0.2 the product attribute label is "0" after creating the attribute, I expect "testlabel".

What is the correct XML code I have to use?


texts: Saving cms blocks after 2.3.1 upgrade now display the html on frontend

texts:
After the 2.3.1 upgrade, which included/enabled Page Builder, a custom section we have that loads block content and displays it now escapes the html tags so it outputs all of the html visible on the page.

This only happens to blocks after we save them with Page Builder enabled, looking in the database table cms_block before and after save the main differences are that it is now wrapped in an extra div, and the html is escaped so that <div> is saved as &lt;div&gt;. These blocks are "html" type in the new Page Builder UI, so we expect them to accept html.

The code does the following:

$block = $this->blockRepository->getById($blockId);
$content = $block->getContent();

which is then output in a template.


texts: Magento 2 - How I can get the filesize of a pdf file

texts:
I try to get the php filesize of a pdf file but I have the following error:

Exception #0 (Exception): Warning: filesize(): stat failed

This is my code:

<?php
$_helper = $this->helper('Magento\Catalog\Helper\Output');
$_product = $block->getProduct();
$usermanual  = $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block, $block->getProduct()->getUserManual(), 'user_manual');
?>

<?php /* @escapeNotVerified */ echo __('User Manuals and Fitting Guides Downloads: ') ?>

        <?php $attr = explode(";",$this->helper('Magento\Catalog\Helper\Output')->productAttribute($block, $block->getProduct()->getUserManual(), 'user_manual'));
            if(isset($usermanual)) {
        ?>

                <?php foreach ($attr as $attrValue) {
                    $pdf = '.pdf';
                    $file = $attrValue;
                    $url = $block->getUrl('pub/media/attachments/');
                    $filesize = filesize($url.$file.$pdf); // bytes
                    $filesize = round($filesize / 1024 / 1024, 1); // megabytes with 1 digit

                    echo "The size of your file is $filesize MB.";

                ?>

<a href="<?php echo $block->getUrl("pub/media/attachments/")?><?php echo $attrValue; ?><?php /* @escapeNotVerified */ echo __('.pdf') ?>"><img src="<?php echo $block->getUrl("pub/media/attachments/")?>pdf.gif"/> <?php echo $attrValue; ?><?php /* @escapeNotVerified */ echo __('.pdf') ?><?php /* @escapeNotVerified */ echo __('Size:') ?>

         <?php
                }
        ?>

         <?php
            }
        ?>

What I do wrong?
Or how I can do this in Magento 2? I found something in the vendor/magento/framework/File/Size.php but how I can use the function in my code?

Thank you in advance.


texts: Free Shipping orders over 100$ AND Free shipping with Coupon Code

texts:
Im currently kinda struggeling. I did set free shipping for orders over 100$ in Stores->Configuration->Shipping Methods.

Now I created a Coupon Code which gives 5$ discount on a product (that works so far) and should also give free shipping for that product. I set "Free shipping: For matching Items only", but it doesnt work.

Does it maybe not work because I have set a minimum order amount of 100$ to get free shipping in the Stores->Configuration->Shipping Methods options?

Any idea how to fix?

Thanks alot!


texts: magento 1.9 How to change css only for my Brasilian shop throught store configuration system.xml?

texts: I have a multiple stores. In one of my stores (Brasilian) i want to remove the bulletpoints from an  on the registration page. Somehow I need to do that via store configuration system.xml file, but I have no idea how to do that


texts: Magento 2, email validation problem with new TLD (.shop)

texts:
I have a .shop domain and adding email address in the backend (user info) i get the following errors:

... is not a valid hostname for email address
... appears to be a DNS hostname but cannot match TLD against known list
... appears to be a local network name but local network names are not allowed

exactly the same issue as described here: https://github.com/magento/magento2/issues/4547

Is there a way to turn-off the email validation in magento 2.1?


texts: How can i configure re-targetting of my ecommerce site

texts: How can i use re-targetting of my site. when user come out my site without purchase, i need to follow through adds what ever site user going to look via google adds.


texts: Magento 2.x PHP memory_limit requirements

texts:
I noticed that Magento 2.1 manual recommends memory_limit=2G in php.ini.  That is a crazy amount of memory, isn't that memory allowed per HTTP request?  I doubt there is any hosting provider that provides that amount of memory for PHP scripts, and certainly makes Magento not viable for shared hosting.

Is that perhaps an amount for setup and migration?  Is that amount really needed for production?

I also found in the documentation:

Set the PHP memory limit.
Our detailed recommendations are:
Compiling code or deploying static assets, 756M
Installing and updating Magento components from Magento Marketplace, 2G
Testing, 2G

It doesn't mention production recommendations. What is recommended for production?


texts:
Is there any easy way to log all query executed by Magento ?

The goal is to print all the SQL executed, for example during page load


texts: add to cart has been disabled after installing check delivery netsolutions from magento connect

texts:
I have installed Check availability by zip/postal code from magento connect so that it checks product availability using pincode.

reference :

http://www.magentocommerce.com/magento-connect/check-availability-by-zip-postal-code.html

It is working fine but my add to cart button in all my product page is disabled.

I guess checkdelivery.xml is conflicting. please guide me how to enable add to cart button.

<?xml version="1.0"?>
<layout version="0.1.0">
<catalog_product_view>
<reference name="head">
<action method="addItem"><type>skin_js</type><name>js/Checkdelivery/jquery-2.1.4.min.js</name></action>
<action method="addCss" ifconfig="checkdelivery/nsi_general_grp/active" ><stylesheet>css/checkdelivery/style.css</stylesheet></action>
</reference>
<reference name="content">
<!--<block type="checkdelivery/checkdelivery" name="checkdelivery.checkdelivery" template="checkdelivery/checkdelivery.phtml"/>-->
<block type="checkdelivery/checkdelivery" name="checkdelivery.checkdelivery">
<action method="setTemplate" ifconfig="checkdelivery/nsi_general_grp/active">
                      <template>checkdelivery/checkdelivery.phtml</template>
                </action>
</block>
</reference>
</catalog_product_view>


texts: Magento 2 Fatal Error :: Maximum Functions Nesting Level of '100' reached

texts:
I got this error after installing Magento 2 on my local machine over wamp software:

  Fatal error: Maximum function nesting level of ’100′ reached, aborting! in \magento2\lib\internal\Magento\Framework\ObjectManager\Config\Config.php on line 69


texts: How can I get a list of all of the product Attributes?

texts:
I have some code to get the product in my block template:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$_product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');

Is there a method that I can call to get me a list of all of the product attributes ?

Something like :

$_product->getAttributes();

Thanks.

I can use this (my bad) :

$attrs =  $_product->getAttributes();
foreach( $attrs as $attr ){
}


texts: How to remove extra index from Url and make it user friendly

texts:
In Magento 2:

I Want to change this route/URL in myproject
from
http://myproject.com/style/index/index/parameter/paravalue

to
http://myproject.com/style/parameter/paravalue

This is a custom Url

I have added the route in XML file i.e routes.xml

          <route id="style" frontName="style">
              <module name="modulename"/>
          </route>

n i have a layout file style_index_index.xml where the template file is included.

/app/vendor/module/etc/di.xml

   <?xml version="1.0"?>
           <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-
               instance"  xsi:noNamespaceSchemaLocation
               ="urn:magento:framework:ObjectManager/etc/config.xsd">

<type name="Magento\Framework\App\RouterList">
  <arguments>
      <argument name="routerList" xsi:type="array">
          <item name="style" xsi:type="array">
              <item name="class" xsi:type="string">vendor\module\Controller\Style</item>
              <item name="disable" xsi:type="boolean">false</item>
              <item name="sortOrder" xsi:type="string">22</item>
          </item>
      </argument>
  </arguments>
 </type>
 </config>

Created the app/vendor/module/controller/Style.php

   namespace vendor\module\Controller;

    class Style implements \Magento\Framework\App\RouterInterface
    {
        protected $actionFactory;
        protected $_response;
        public function __construct(
            \Magento\Framework\App\ActionFactory $actionFactory,
            \Magento\Framework\App\ResponseInterface $response
        ) {
            $this->actionFactory = $actionFactory;
            $this->_response     = $response;

        }
        public function match(\Magento\Framework\App\RequestInterface $request)
        {

            $identifier  = trim($request->getPathInfo(), '/');
            $identifiers = explode('/', $$identifier);
            if (strpos($identifier, 'style') !== false && count($identifiers) == 3) {
                $request->setModuleName('style')->//module name
                    setControllerName('index')->//controller name
                    setActionName('index')->//action name
                    setParam($identifiers[1], $identifiers[2]); //custom parameters
            } else {
                return false;
            }
            return $this->actionFactory->create(
                'Magento\Framework\App\Action\Forward', ['request' => $request]
            );
        }

    }


texts:
Hey i deleted my homepage and thought it would be easy to create a new one.
But i cant find any solutions how to do this. I found many threads about this Problem in Magento1 but not one for magento 2.
How can i create a new HomePage?


texts: magento 2 : how get the list of themes in my magento site?

texts:
I want all information about  the theme in my module code how can I grab the theme information.The Theme that I have in my Magento like WordPress we can get all the themes information is it possible here.

This example is useful for magento 1.X what about magento 2.

Mage::getSingleton('core/design_package')->getPackageList();
Mage::getSingleton('core/design_package')->getThemeList();


texts: How to get price items of bundle product in order API-REST Magento 2.3?

texts: How to get the price of items of bundle product in order?


texts: No matter that sales_flat_order and sales_flat_order_grid have same column names, some common fields are not inserted

texts:
I have column in sales_flat_order_grid that is same name and structure like in sales_flat_order The column name is customer_note.

When I create new order from frontend, in sales_flat_order is everything OK (order row with customer note data is inserted),

But in sales_flat_order_grid only customer_note value is empty (so order is inserted, but field stays empty).

When I update order from backend, customer_note is being copied and shows on both tables.


texts: Magento 2 : setOrder not working in collection

texts:
In my custom collection $career_collection->setOrder('career_id','ASC'); not working.

My function is below

public function getAllCareers(){

    $Careers = $this->_careersFactory->create();
    $career_collection = $Careers->getCollection();
    $career_collection->addFieldToFilter('active',1)->setOrder('career_id','ASC');
    //$career_collection->setOrder('career_id','ASC');

    echo $career_collection->getSelect(); exit;
    return $career_collection;
}

getSelect return the query like below

SELECT `main_table`.* FROM `e25_careers` AS `main_table` WHERE (`active` = '1').

What is the wrong i am doing here


texts: Rewrite of block and helper for checkout getCheckoutUrl() not working

texts:
I'm trying to rewrite the getCheckoutUrl() functions in

  Mage/Checkout/Blocks/Onepage/Link.php

and

  Mage/Checkout/Helper/Url.php

but the rewrites don't seem to work.

My config.xml file contains the following:

...
<global>
    ...
    <blocks>
        <stores>
            <class>Zzyzzx_Stores_Block</class>
        </stores>
        <checkout>
            <rewrite>
                <onepage_link>Zzyzzx_Stores_Block_Link</onepage_link>
            </rewrite>
        </checkout>
    </blocks>
    <helpers>
        <stores>
            <class>Zzyzzx_Stores_Helper</class>
        </stores>
        <checkout>
            <rewrite>
                <url>Zzyzzx_Stores_Helper_Url</url>
            </rewrite>
        </checkout>
    </helpers>
    ...
</global>
...

Everything else defined in the ocnfig seems to be working fine, only the rewrites don't seem to.

the block rewrite refers to my file

  .../app/code/community/Zzyzzx/Stores/Block/Link.php

which contains:

class Zzyzzx_Stores_Block_Link extends Mage_Checkout_Block_Onepage_Link
{
    function getCheckoutUrl()
    {
        //my changes
    }
}

the helpers rewrite refers to

  .../app/code/community/Zzyzzx/Stores/Helper/Url.php

which contains:

class Zzyzzx_Stores_Helper_Url extends Mage_Checkout_Helper_Url
{

    function getCheckoutUrl()
    {
        //my changes
    }

}

with the helper, I am able to directly access the function with Mage::helper("stores/url")->getCheckoutUrl(); but the rewrite doesn't work.

Where am I going wrong?  How do I get my rewrites working?


texts: How to make customer login required in magento module?

texts: I created a custom module in magento, and I need to make it work only for customers who are logged in. How should I make customer login required for a magento module?


texts: How to add title to header without breaking search box

texts:
I am creating a theme for magento 2.2. Created my first custom block in app/frontend/CUSTOM VENDOR/CUSTOM THEME/Magento_Theme/templates/heading.phtml containing the following code:

<?php
//create block_identifier static block
echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('block_identifier')->toHtml();?>

<?php echo __('

Murky
Apparel

');
?>

I have also successfully loaded the new block within app/frontend/CUSTOM VENDOR/CUSTOM THEME/Magento_Theme/layout/default.xml using this code:

<referenceContainer name="header-wrapper">
<block class="Magento\Framework\View\Element\Template" name="customblock" before="top.search" template="Magento_Theme::heading.phtml" />
</referenceContainer>

The block is displaying on the front-end, but it pushes down the search bar and floats to the left, leaving no space between it and the logo. Here is an example image:

I would like to know the following:

1) How do I implement a clearfix so that the search bar displays where it is supposed to, to the left of the cart button?

2) How do I add either padding or margin to the  tag or its parent div?

Desired outcome would be something like this:

I am a newcomer to magento, so a clear explanation of how to implement custom styles might be helpful. TIA!


texts: 301 Redirection on nginx server (thousands of 404 errors)

texts:
we have an issue with the website (using Magento, on nginx) as it has ~5k URLs returning a 404 error. Most of these are product pages.

We need to make a 301 redirects for all these URLs, e.g.:
redirect from www.example.com/category1/product.html to www.example.com/product.html.

What would be the best way to do that? Should we do this manualy for every page or is there a better way?

I would appreciate your help,


texts:
How useful are "modman" Technology in Magento2?

Anyone have an idea about modman?

Compare with another like as Github/bitbucket.


texts: Magento2 in How to Remove options and price section on configurable product by custom module?

texts:
I want to Remove options and price section on the configurable product by the custom module.

I have one configurable product attribute yes/no type. If select yes then remove this section if no select then no need to remove.

Ref-

<referenceContainer name="product.info.media">
            <block class="Magento\Catalog\Block\Product\View" name="product.info.test" template="Magento_Catalog::test.phtml" after="-" />
        </referenceContainer>


texts: Getting Fatal error when refund method throw exception

texts:
I am getting below error when any exception throws in refund() method

  Fatal error: Uncaught TypeError: Argument 1 passed to
  Magento\Framework\Exception\LocalizedException::__construct() must be
  an instance of Magento\Framework\Phrase, string given, called in
  /vendor/magento/module-sales/Model/Service/CreditmemoService.php on
  line 185 and defined in
  /vendor/magento/framework/Exception/LocalizedException.php on line 34

I know solution but this is core file so how can i handle above error.


texts: How to get configuration value from default

texts:
I want to get a config value from core_config but the default level
I know we can get it by using scope config but I want default


texts:
What is the event name for when a new product is added?

I have looked here:

http://blog.chapagain.com.np/magento-event-observer-with-save-before-and-save-after/

But catalog_product_save_before doesn't seem to be on any Magento event list for 1.7, 1.8 or 1.9.


texts: URL Key Priority for Pages from different Modules

texts:
I have a challenge where we have multiple modules + the core that builds URL Keys.  From time to time duplicate URLs are created.  Therefore I have been told there is a way to prioritise by module which URL Keys to use.

For example.  I have the Amasty Improved Navigation & Landing Pages modules.  On the improved navigation I have enabled the SEO urls.  I have an attribute called "Gloves", so this has automatically created the URL /gloves.html.  However I have decided that gloves is a strong keyword for us and I have built out the page /gloves.html using the Landing Pages module.  So the challenege is that by default magento is selecting the Improved Navigation page, where I would like it to select the Landing Pages page.

I have been told there is a way to create a config file to prioritise modules in this way, but cannot find any documenation on it.  Please can someone give some advise.


texts: Magento 2: How to move currency switcher

texts:
I'm fairly new to Magento 2 and I need guidance on how to move the currency switcher from the top-header-content and into the middle-header-content. I'm using the Claue theme.

I understand the that there is a move instruction that can be used in xml, but I have no idea in which xml file I would need to put this or if I should create a new xml file.

Underneath I have posted a couple of images that show what I am trying to achieve.

(I only have this project setup locally.)


texts: set default value for date in Ui component

texts:
This is my UI component form

 <field name="test[start_date]">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="dataType" xsi:type="string">string</item>
                    <item name="label" xsi:type="string" translate="true">text</item>
                    <item name="formElement" xsi:type="string">date</item>
                    <item name="source" xsi:type="string">sales_rule</item>
                    <item name="sortOrder" xsi:type="number">33</item>
                    <item name="dataScope" xsi:type="string">test[start_date]</item>
                    <item name="validation" xsi:type="array">
                        <item name="required-entry" xsi:type="boolean">true</item>
                    </item>
                </item>
        </argument>
    </field>

I want to load default value for date. I added a plugin for

Magento\SalesRule\Model\Rule\Metadata\ValueProvider

this is my code

public function aroundGetMetadataValues(
        SalesRuleValueProvider $subject,
        \Closure $proceed,
        Rule $rule
    ) {
        $result = $proceed($rule);
        $actions = &$result['actions']['children']['simple_action']['arguments']['data']['config']['options'];

        $result['actions']['children']['test[start_date]']['arguments']['data']['config']['value']
            = '2014-09-01';
        return $result;
    }

All other input field are working very well. I was able to pre populate it with a value except date. I tried all date format available, Any help on this


texts:
After migrating data and products from Magento 1.9 I can see all my categories and products available in the backend. But not on the frontend.

I've checked all options;

Products are "enabled"
Products have stock + saleable stock
Products are added to categories
Products are added to website
Set catalog to show out of stock products as well
Using base-theme

And of course, reindexed and cache-cleaned countless times.

At some point I saw a few products show up after I changed the "Product has weight" toggle, but that doesn't seem to work anymore either.

And 1 thing changed; I see my layered navigation filled with the product choices, but the products themselves don't show. What am I missing?

See the dev site here to see for yourself.
I'm at a loss, what is going on?


texts: Product custom options in cart page magento 2

texts:
I have to add product custom options in cart page. Is that possible . kindly help me anyone. I tried

$this->getLayout()->createBlock("Magento\Catalog\Block\Product\View\Options")->setTemplate("Magento_Catalog::product/view/options.phtml")->toHtml();

include ($block->getTemplateFile('Magento_Catalog::product/view/options.phtml'));

not working. please help me


texts: overridden controller's layout handler not working

texts:
I'd overridden a controller CatalogSearch/ResultController.
My config.xml look likes:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Excellence_Excatsearch>
            <version>0.1.0</version>
        </Excellence_Excatsearch>
    </modules>
    <frontend>
        <routers>
            <excatsearch>
                <use>standard</use>
                <args>
                    <module>Excellence_Excatsearch</module>
                    <frontName>excatsearch</frontName>
                </args>
            </excatsearch>
        </routers>
        <layout>
            <updates>
                <excatsearch>
                    <file>excatsearch.xml</file>
                </excatsearch>
            </updates>
        </layout>
    </frontend>
    <global>
        <rewrite>
            <excatsearch_result>
                <from><![CDATA[#^/catalogsearch/result/#]]></from>
                <to>/excatsearch/result/</to>
            </excatsearch_result>
        </rewrite>
    </global>
</config>

and my excatsearch.xml:

<?xml version="1.0" encoding="UTF-8"?>
<layout version="0.1.0">
    <excatsearch_result_index>
        <reference name="root">
            <action method="setTemplate">
                <template>page/1column.phtml</template>
            </action>
        </reference>
        <reference name="search.result">
            <action method="setTemplate">
                <template>excatsearch/noresult.phtml</template>
            </action>
            <block type="catalog/product_new" name="new_arrival" template="excatsearch/newarrival.phtml"></block>
            <block type="page/html" name="best_seller" template="excatsearch/best_seller.phtml"></block>
        </reference>
    </excatsearch_result_index>
</layout>

I'm supposed to see the result from <excatsearch_result_index> but still I'm getting result from <catalogsearch_result_index>

Why its happening so?


texts: Elastic search throws errror while running upgrade command via CLI in magento 2

texts:
I have successfully cloned & installed a Magento cloud environment Magento 2.4.2 in my local instance.
And also installed elastic search and tested it via the command line and it's working fine.
Note: I have followed his link to install and configure elastic search https://www.emizentech.com/blog/magento-2-4-with-elasticsearch-complete-guide.html
Output from the command line:

But while running upgrade command throws following error.

Elastic search configuration file
/etc/elasticsearch/elasticsearch.yml

Can anyone please help me to sort out this?


texts:
I have installed Magento2.3.3 on my system and created one configurable product which has two swatch attribute colour and speed. Colour is image swatch and speed is dropdown. So upon loading product out of stock swatches are showing clickable means there are no red line on it.

Here I'm attaching a screenshot where colour Champagne Gold and speed 820 RPM product is out of stock but still, it is clickable.

I'm not getting any errors in the console. Any help will be appreciated.


texts:
I'm trying to remove the notice in the cart about how the customer must have a subtotal of say $20 in their cart however I still want the restriction there for when the customer tries to go into the cart (I personally think we shouldn't remove the notice but the order comes down from up high)

At the moment, this is my code

$messages = $this->getMessagesBlock()->getMessages();
unset($messages[1]);
$this->getMessagesBlock()->setMessages($messages);
echo $this->getMessagesBlock()->getGroupedHtml();

I've been testing the code by going into the cart with 1 item and using the update cart button when they new qty is something stupid like 99999999999999

from the var dump i did of $this->getMessagesBlock()  there is a protected piece of data called _messages, using getMessages() return an array of 2 items, one is the error about the qty at index 0, the other is an notice about the minimum purchase.

I tried using unset($messages[1]); to remove the notice as a test to see if I could remove it. If it worked, I would later fix it up to search for the notice and remove it no matter where in the array it is.

I called setMessages($messages) and did another var dump. I can see it's been put back into $this->getMessagesBlock() so i thought it would work, however nothing appeared.

I did a var_dump of $this->getMessagesBlock()->getGroupedHtml() and it shows an empty string.

I'm wondering what i could be doing wrong here or if there is a better way to just remove the message i don't want.

this is what is vardumped from $messages

array (size=2)
  0 =>
    object(Mage_Core_Model_Message_Error)[196]
      protected '_type' => string 'error' (length=5)
      protected '_code' => string 'The requested quantity for "6899WSAND" is not available.' (length=56)
      protected '_class' => string '' (length=0)
      protected '_method' => string '' (length=0)
      protected '_identifier' => null
      protected '_isSticky' => boolean false
  1 =>
    object(Mage_Core_Model_Message_Notice)[820]
      protected '_type' => string 'notice' (length=6)
      protected '_code' => string '' (length=0)
      protected '_class' => string '' (length=0)
      protected '_method' => string '' (length=0)
      protected '_identifier' => null
      protected '_isSticky' => boolean false


texts: Magento 2: Error when trying to run command php bin/magento catalog:images:resize

texts:
I'm currently trying to run the following command

php bin/magento catalog:images:resize

But when it gets part way through I get the following error:

  587/1490 [>]  39% 9 mins 54.0 MiB      | /d/o/download_6_.pngWarning:
  imagecreatefrompng(): gd-png: fatal libpng error: Read Error:
  truncated data  in
  /var/www/vhosts/mywebsite.com/httpdocs/vendor/magento/framework/Image/Adapter/Gd2.php
  on line 72

I've looked into the file in question and this seems to be the piece of code around line 72.

$this->_imageHandler = call_user_func(
            $this->_getCallback('create', null, sprintf('Unsupported image format. File: %s', $this->_fileName)),
            $this->_fileName
        );

I'm not sure what I need to to to correct this issue. I'd appreciate any advice on how to resolve this.


texts: Magento2 Try to rewrite \module-layered-navigation\Block\Navigation.php

texts:
i have an custom design were we overload the:
\app\design\frontend\Come\schlafgut\Magento_LayeredNavigation\templates\layer\view.phtml

We add there a new block methode .. fe. sayHello()

<?php

namespace Come\ProductListSwatches\Block\Catalog;

class Swatches extends \Magento\LayeredNavigation\Block\Navigation
{
    public function sayHello()
    {
        return "something";
    }
}

In view.phtml:

<?php if ($block->canShowBlock()): ?>
    <div class="block filter">

        <?php echo $block->sayHello(); ?>

Than we create a di.xml file:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\LayeredNavigation\Block\Navigation" type="Come\ProductListSwatches\Block\Catalog\Swatches" />
</config>

We work in developer mode, but we received this error:

PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\\Catalog\\Model\\Layer\\FilterableAttributeListInterface
in /var/www/schlafgut/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:73\nStack trace:\n#0 /var/www/schlafgut/vendor/magento/framework/ObjectManager/ObjectManager.php(71):
Magento\\Framework\\ObjectManager\\Factory\\Dynamic\\Developer->create('Magento\\\\Catalog...')\n#1 /var/www/schlafgut/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(126):
Magento\\Framework\\ObjectManager\\ObjectManager->get('Magento\\\\Catalog...')\n#2 /var/www/schlafgut/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(53):
Magento\\Framework\\ObjectManager\\Factory\\AbstractFactory->resolveArgument(Array, 'Magento\\\\Catalog...', NULL, 'filterableAttri...', 'Magento\\\\Catalog...')\n#3 /
var/www/schlafgut/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\\Framework\\ObjectManager\\Factory\\Dynamic\\Developer->_resolveArguments('Magento\\\\Catalog...', Array, Array)\n#4
/var/w in /var/www/schlafgut/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

Do anyone know what is wrong?


texts: How to retrieve full customer name with SQL?

texts: Can anyone provide an SQL command that retrieves a customer's first and last name in one row?  All my attempts at JOINs have resulted in multiple rows, with first name in one row and last name in the next.


texts: Add Custom JS to Modal Insert Widget Admin Form

texts:
I am wanting to do custom javascript to manipulate the Widget Options when adding a widget (using the WYSIWYG editor) in the Admin panel.

I have found that the layout handle adminhtml_widget_index is being loaded via AJAX to get that content, however, I have noticed that any script tags in my template file are being removed.

For demonstration purposes the phtml file I am using looks like

// Module_Vendor::test.phtml
<?php
/** @var \Magento\Backend\Block\Template $block */
?>

Modal windows strip custom js...

I have the
 tag showing on the widget modal form, but looking at the source there is no script tag.

Looking further into how the widget renders, using the \Magento\Widget\Block\Adminhtml\Widget class, there is a protected $_formScripts array that might be used with a plugin which could solve the issue, however I'm wondering if there is another way to render custom javascript on the Insert Widget modal form?

If anyone has any useful information, I'd be delighted to hear it.

Thanks in advance!

As a side note there is an initialisation of the wysiwyg widget javascript component which is added as a string to the $_formScripts array, which doesn't seem like best practice, so even if using the $_formScripts array is how we should do it, if you could provide an example of how, that would also be fantastic!


texts: Backorder quantity wrong when unshipped reservations

texts:
Magento version: 2.3.5-p1
(magento/module-inventory-sales) version: 1.0.8
--
The backorder quantity shown in checkout and stored in sales_order_item.qty_backordered can be wrong when there are reservations for the product.  The backorder quantity is calculated using the current stock count, not the salable count which considers reservations.
--
Example:

Global config: Decrease Stock When Order is Placed = Yes.
Product config: stock qty = 2, no reservations, manage stock = Yes, out of stock threshold = 0, backorders = Allow Qty Below 0 and Notify.
Add to cart 1 qty (no backorder shown). Place order.
Add to cart 2 qty (no backorder shown, but should be 1 qty).
Add to cart 1 qty (3 total). (1 qty backorder shown, but should be 2 qty).
Place order. (1 qty backorder stored in sales_order_item.qty_backordered, but should be 2 qty).

--
The culprit is here:
vendor/magento/module-inventory-sales/Model/IsProductSalableCondition/BackOrderNotifyCustomerCondition.php
Line: $backOrderQty = $requestedQty - $stockItemData[GetStockItemDataInterface::QUANTITY];
The stock qty is being used to calculate the backorder qty, so reservations are not considered.
--
It's not even consistent in ignoring reservations though, as they are correctly considered when checking if add to cart should be allowed here:
vendor/magento/module-inventory-sales/Model/IsProductSalableCondition/IsSalableWithReservationsCondition.php
--
I know that this is due to the order not being shipped yet, so the stock isn't being decreased yet. But still, surely this isn't intentional? You cannot sell the same salable qty multiple times to different customers. I haven't found an answer for this, which makes me think I'm missing something. Thanks in advance.


texts: Installing patches on Magento 1.6.1.0 - ERROR with existing folders "/app/etc/"

texts:
I would like to ask you some help.. I'm working on installing the security patches on Magento 1.6.1.0
I think I'm doing correctly. I uploaded the patches for the version, on the Magento root as you can see in the SSH results >>

login as: ssh.mydomain.com.ar
ssh.mydomain.com.ar@ssh.user.com.ar's password:
Linux 2.6.32.23-grsec.
ssh.mydomain.com.ar@ssh:/$ cd www/mydomain.com.ar/htdocs/tiendavirtual
ssh.mydomain.com.ar@ssh:/www/mydomain.com.ar/htdocs/tiendavirtual$ ls
FileuploaderInstallationManual.docx includes
LICENSE.html index.php
LICENSE.txt index.php.sample
LICENSE_AFL.txt install-em0006.php
PATCH_SUPEE-1533.sh install.lib.php
PATCH_SUPEE-5346.sh install.php
PATCH_SUPEE-5994.sh js
RELEASE_NOTES.txt lib
app mage
applypatch.php media
core php.ini.sample
cron.php pkginfo
cron.sh robots.txt
downloader shell
errors sitemap.xml
favicon.ico skin
get.php sp-magento-patch.php
google51d0b8abd14122e0.html var
<ww/mydomain.com.ar/htdocs/tiendavirtual$ sh PATCH_SUPEE-1533.sh
PATCH_SUPEE-1533.sh: line 25: wc: command not found
PATCH_SUPEE-1533.sh: line 25: ((: > 0 : syntax error: operand expected (error token is "> 0 ")
PATCH_SUPEE-1533.sh: line 32: which: command not found
PATCH_SUPEE-1533.sh: line 33: which: command not found
PATCH_SUPEE-1533.sh: line 34: which: command not found
PATCH_SUPEE-1533.sh: line 35: which: command not found
PATCH_SUPEE-1533.sh: line 36: which: command not found
PATCH_SUPEE-1533.sh: line 38: PATCH_SUPEE-1533.sh: command not found
ERROR: "/app/etc/" must exist for proper tool work.
ssh.mydomain.com.ar@ssh:/www/mydomain.com.ar/htdocs/tiendavirtual$

The strange thing is the "/app/etc/" folder exist.
Do you know what can I do to install them correctly?

Thanks!


texts: Get product collection based on entity_id in magento2

texts:
How to Create product collection with filter based on entity_id in Magento 2?

I tried below:

$model = $this->_objectManager->create('Vendor\MOdule\Model\Queue');
$ProductId = $this->skuProcessor->getNewSku($rowSku)['entity_id'];
$getId = $tagmodel->getCollection()
    ->addFieldToFilter('entity_id', $ProductId);

// Tried this too
/*
   $getId=$model->getCollection()->create()
    ->addAttributeToSelect('*')
    ->addFieldToFilter('entity_id',$ProductId);   */
if ($getId = '') {
    $tagmodel->setEntityId($ProductId);
    $tagmodel->save();
}

I am  not getting the collection! nor the id is saved

My id should no be saved if already present in DB.


texts:
After upgrading a Magento 1.3 database to 1.9 I am seeing empty payment methods in admin. How can I find and remove redundant / empty payment methods from the database?

In the screen shot you can see the first 7 payment methods are selectable but empty.


texts: How to add +1 day to the "To Date" if "From Day" is Sunday?

texts:
shipout_day_from = 2

  shipout_day_to   = 3

If shipout_day_from is Sunday then add +1 day to shipout_day_from & shipout_day_to

If shipout_day_to is Sunday then add +1 day to shipout_day_to. (shipout_day_from wont add +1 day)

Postage: FREE (UK MAINLAND)

As of current Script the Output will be Estimated Delivery: 25th March (Sat) - 27th March (Mon) If today is 23rd March Thursday. (Adding +1 day to the TO DATE successfully).

But

As of current Script the Output will be Estimated Delivery: 27th March (Mon) - 27th March (Mon) If today is 24th March Friday. (Adding +1 day to the From Date but the TO DATE remains same.)

I need the output like Estimated Delivery: 27th March (Mon) - 28th March (Tue) If today is 24th March Friday.


texts: Magento 2, minicart, change "Go to Checkout" text to "Checkout" only

texts:
I have been trying to change Go to Checkout text to Checkout in mini cart in Magento 2.
I have new theme applied and placed override file as follows:

 app/design/frontend/Darkmage/newtheme/Magento_Checkout/web/template/content.html

Whatever I change the texts  (only) like Go to Checkout, View and edit cart, it is not reflecting in minicart, though i clean, flush cache.


texts: before and after module in route.xml - magento 2

texts:
can anyone explain what is the right situation to use before and after attribute in route.xml?

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="admin">
        <route id="routename" frontName="routename">
            <module name="vendor_module" before="Magento_Backend" />
        </route>
    </router>
</config>

I am looking well explain answer.


texts:
I am getting following Error on reindexing:

       Product Attributes index process unknown error:
    exception 'PDOException' with message 'SQLSTATE[23000]: Integrity
constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`databasename`.`catalog_product_index_eav`, CONSTRAINT
`FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY
(`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE
 CASCA)' in .../lib/Zend/Db/Statement/Pdo.php:228

How do I get rid of it?


texts:
I need to add a custom option to a simple product which will be number of pages.
This needs to get multiplied rather than added to other fields.

Example:

Black and white (€0.03) or Colour (€0.15)
Paper quality: Say €0.02

After the user chooses black and white and the paper quality, this adds up to (€0.03+ €0.02) €0.05 which needs to be multiplied by the number of pages (another custom field) that the document being uploaded (in another custom field) contains.

Is this possible in any way?


texts:
I am trying to understand this exception: Unknown entity type: Namespace\Module\Model\Name requested

I have a module and I am loading it like this in my controller:

$model = $this->_objectManager->create(\Namespace\Module\Model\Name::class);
$model->load($id);

and in my resource model: class Namespace\Module\Model\ResourceModel\Name, I have this:

/**
 * Load an object
 *
 * @param AbstractModel $object
 * @param mixed $value
 * @param string $field field to load by (defaults to model id)
 * @return $this
 * @SuppressWarnings(PHPMD.UnusedFormalParameter)
 */
public function load(AbstractModel $object, $value, $field = null)
{
    $this->getEntityManager()->load($object, $value);
    return $this;
}

Then in my di.xml, I have got this:

<type name="Magento\Framework\Model\Entity\RepositoryFactory">
    <arguments>
        <argument name="entities" xsi:type="array">
            <item name="Namespace\Module\Api\Data\NameInterface" xsi:type="string">Namespace\Module\Model\ResourceModel\Name</item>
        </argument>
    </arguments>
</type>
<type name="Magento\Framework\EntityManager\MetadataPool">
    <arguments>
        <argument name="metadata" xsi:type="array">
            <item name="Namespace\Module\Api\Data\NameInterface" xsi:type="array">
                <item name="entityTableName" xsi:type="string">my_table</item>
                <item name="identifierField" xsi:type="string">my_id</item>
            </item>
        </argument>
    </arguments>
</type>

<type name="Magento\Framework\EntityManager\Operation\AttributePool">
    <arguments>
        <argument name="extensionActions" xsi:type="array">
            <item name="myName" xsi:type="array">
                <item name="Namespace\Module\Api\Data\NameInterface" xsi:type="array">
                    <item name="read" xsi:type="string">Namespace\Module\Model\ResourceModel\ReadHandler</item>
                    <item name="create" xsi:type="string">Namespace\Module\Model\ResourceModel\SaveHandler</item>
                    <item name="update" xsi:type="string">Namespace\Module\Model\ResourceModel\SaveHandler</item>
                </item>
            </item>
        </argument>
    </arguments>
</type>

Why is that throwing the exception?

How do I understand this MetadataPool?

UPDATE 1

I have checked further and found that Magento\Framework\EntityManager\MetadataPool::getMetadata($entityType) is receiving Namespace\Module\Model\Name as argument. It supposed to receive Namespace\Module\Api\Data\NameInterface.

Doing var_dump($this->metadata) does shows there is Namespace\Module\Api\Data\NameInterface in the $this->metadata array.

What am I missing?


texts: Magento 2.3 : I can't login to admin after making changes to Admin Base URL

texts:
I made modifications to the Admin Base URL section, the login page changed but the form is available (See Image). So when I login in using

Chrome : I get "ERR_TOO_MANY_REDIRECTS"
IE     : There were too many redirections.
Error Code: INET_E_REDIRECT_FAILED"

and in the url the admin url appears twice eg. admin_Fra/admin_fra ...

when I change the admin url in env.php the old one is still seen eg. admin_Fra/admin_new ...

I have cleared cache, removed http to https redirect in .htaccess, reset both web/secure/use_in_frontend and    web/secure/use_in_adminhtml to 0 but no change,

I will appreciate any timely support as I cant make any transactions currently.

How else can I reverse the settings without admin access.


texts: Magento2 details page image once appear and after that disappear

texts:
I am trying to figure out the issue that image once appear when load first time and after 2 to 3 seconds it disappear.

Please check screenshot with inspect element.

First time when it appear

Now after complete loading of page image disappeared


texts: Customer Reviews is not showing up on Product Detail page in magento 2.2.4

texts:
The following container is empty
The reviews are approved in the backend and showing up there as usual


texts:
I premise that I'm a newbie with Magento.
I have to insert some products in my shop (shoes, specifically) and I use drop-down as custom option to do select the size.
So, when I select "dropdown" as custom option, as values I can insert "title", "price", "price type", "sku" and "sort order".
Is there any way to add "availability" field for each size?
Thanks guys!
Giacomo


texts: Magento 2 : How to add observer in core module?

texts:
I would like to add a new Observer class in module-checkout and also add this new observer in etc/events.xml.

What is the appropriate way to achieve that?


texts: Magento 2 - How to get quote shipping method in knockout js?

texts:
In Magento 2 I try to get shipping method in this js file : vendor/magento/module-checkout/view/frontend/web/template/billing-address.html
I try this :
quote.shippingMethod()['method_code'];

And I have this error  :
Uncaught TypeError: Cannot read property 'method_code' of null

But when I console.log(quote); I can see shippingMethod method code exist:

Do you have any idea how can I get shipping method attributes here ?
Thank you
EDIT
My goal is to change data-bind in this file : /vendor/magento/module-checkout/view/frontend/web/template/billing-address.html
<fieldset class="fieldset" data-bind="visible: !isAddressDetailsVisible()">

In order that isAddressDetailsVisible() method return false if current shipping method is "colissimo pickup".


texts: Custom targets for widget Layout Updates in Magento 2

texts:
I would like help working out how to add a custom container as a 'Layout Update' for a widget..

Currently, I only have the 3 basic options to choose from (Main Content Area, Siderbar Main and Sidebar Additional), but I would like to be able to add widgets to containers that I've created through various default.xml files.

Specifically, I'm trying to include the Recently Viewed widget. I have tried updating module-reports/etc/widget.xml, adding an extra  inside the , however that doesn't seem to work..

How can I use a customer container?

Thanks, Luke


texts: Need Magento 2 equivalent for Model Filter

texts:
I need a help to porting below code to Magento 2.

$groups=Mage::getModel('mppartnergroup/mppartnergroup')
                    ->addFieldToFilter('status',array('eq'=>1))


texts:
Why can issue this error in the log?

2014-10-16T09:48:55+00:00 ERR (3): User Notice: 'hashed_directory_umask' is deprecated -> please use 'hashed_directory_perm' instead  in /var/www/html/magento/lib/Zend/Cache/Backend/File.php on line 144


texts: How to check a customer has a billing or shipping address using customer id?

texts:
I am running an update on my customer list.
In this i am retrieving the customer telephone number using

$telephone_number =  $customer->getPrimaryBillingAddress()->getTelephone();

If the customer doesn't has any address there were an error message like below

  Fatal error: Call to a member function getTelephone() on a non-object in /var/www/vhosts/abc.com/public_html/custxxxxxxxx_XXX.php on line 44

I understood that this error is coming because of the customer doesn't have any address.
so before using

$telephone_number =  $customer->getPrimaryBillingAddress()->getTelephone();

is there any way to check the customer has any address?


texts: Mass Print/Export invoices pdf separately

texts:
my tax consultant needs my invoices in separated .PDFs like invoicenumber.pdf - is this somehow possible? I only know the way to select them all in the backend and hit "Create Invoices" which prints one large .PDF file with all invoices - just need to get them separated and with the invoice-number as filename.

Has someone a solution for this please? I've played around with the solution posted in Magento Export All Invoice In PDF but the result is always empty (even if I use $this instead of $invoices).

Thank you so much in advance, best greets, David

I'm using Magento CE 1.9.0.1


texts: Configurable products price starting from price magento 2

texts: How can I show price start range on category list page and detail page of configurable products in magento 2.


texts: Magento 1.9 How to remove values from Products, where the Attribute is no longer in the Attribute Set?

texts:
I have a product P in attribute set S where a value is set to attribute A.

If I now remove attribute A from the attribute set S, the value for A of P remains in the database as long as I don't completely remove the attribute X itself.

How can I remove these values so that the function hasData() of Mage_Catalog_Model_Product returns false?


texts: magento 1.9.3.2 doesn't load CSS and JS on frontend and backend after some intense process

texts:
Sometimes, when I launch some process who uses mySql a bit drastic (the last is a script to write in core_rewrite_url about 3000 line of new redirect), or when I change theme, Magento is so slow to load pages and doesn't load JS or CSS, with 404 errors.
This if I reload frontend or backend in the same browser. If I open it on another browser (not a new window, a different browser, like chrome), everything is working fine.
This appends on different PC, but installation is same hosting server. Flush cache, reindex, logout doens't resolve.

After some hours, everything return to works fine.

It could be a Linux server problem?
.htaccess?
gzip?

Any ideas?


texts: Magento 2 - add product's multiselect attribute values into flat table

texts:
I have custom multiselect attribute and want to get selected values on Product List Page.

If attribute has used_in_product_listing=1, I can get only string of ids on Product List Page (something like $_product->getCustomMultAttr() == '236,238,239').

Could somebody tell me how to save in flat table values of this attribute, but not ids?


texts: I have a magento 1.7.0.2 store and accidently deleted a Category. I have an old backup of the Db but I can not restore it fully as I will loose recent orders and products. Is there any way to restore a category without restoring the whole DB. please help. thanks


texts: Magento 2 - Which function / controller has triggered my plugin?

texts:
I have setup a plugin which runs after a customer is saved. This means that the plugin runs on the following situations

Frontend

When a customer register
When a customer updates their name

Backend

When an admin registers a customer
When an admin updates a customer

What I would like to know is, how can I see which one of the 4 options has triggered the plugin to run?

The reason for this is that I would like to have slightly different logic in the plugin if the admin saves a customer


texts: When a customer visits the website using iphone the logo is displayed in a different way than of android phones. Do refer the images attached.


texts: Is it possible to get system configuration value in Static block/ CMS page

texts: I have eight static block list. Client want to change some part of string in these static block according the current month. I can achieve this though the code, but client have access only of backend, so is there any way to change the content in all static block from the single place without editing the code?


texts: Can't get order data in a sales_order_place_after model observer

texts:
I have an extension that's running with the end goal of subscribing a user to a mailing list when they order a specific product. I have the script working 100% fine outside of my Observer.php, but for some reason the same code doesn't work in Observer.php because loadByIncrementId() is producing a very empty looking object.

So for example here's what I have:

class Namespace_Extension_Model_Observer
{
    public function Myfunction(Varien_Event_Observer $observer)
    {
        $order_number = $observer->getEvent()->getOrder()->getIncrementId();
        $order = Mage::getModel('sales/order')->loadByIncrementId($order_number);
    }
}

It gets $order_number fine, but $order doesn't give me the results I'm expecting. I can't think of anything other than firing a curl to my script that does work and passing the order number to it, which sounds like an ugly way out


texts: Magento 2 : Changes In Default.xml Not Visible in All Store Views

texts:
My online shop has 6 store views: DE, AT, GB, ES, FR, IT
I built very simple module that adds simple DIV element to footer
The DIV block is visible on all store views apart from DE and GB

Default.xml:

    <referenceContainer name="footer">
            <block
                class="Magento\Framework\View\Element\Template"
                name="catchaddtocart"
                template="XXX_YYY::initialization.phtml" />
    </referenceContainer>

initialization.phtml

<div> -- Test -- </div>

I tried setup:upgrade, clean cache etc.

Please advise me on this. Thanks!


texts: How to let 2 Magento shops interact with each other?

texts:
I have 2 separate shops on 2 different servers. One has coupon codes which the other should read and put in a mail which is sent to the customer. The coupon will be used in the store that hsa them in the DB.

What would be the best way to let the 2 interact with each other? Some sort of API maybe?

Thanks!


texts: How can you search products for specific categories in search box?

texts: Trying to find out a way to filter search of products based on specific magento categories. I'm using searchanise search plugin (which is a paid plugin).


texts:
How can I set up Magento 2 cron jobs to work on a Windows server?

I can make the cron tasks run in a similar way to this or by calling the file directly (as far as I can tell this works).

  yoursite.com/update/cron.php

However when trying to do extension installs Magento thinks that the cron process is not running (Magento docs on this issue). How can I make it know it is running?


texts: Magento 2: Programmatically Add a Value to `core_config_data`

texts:
Does Magento 2 have a high level abstraction that allows end-user-programmers to update configuration values in the core_config_data table?  Or is using straight SQL the only way to do this in Magento 2?

i.e. in Magento 1, you could do something like this

$config_model = new Mage_Core_Model_Config();
$config_model->saveConfig('my/config/path', $unique_id, 'default', 0);

and save configuration values into core_config_data.  Is there an equivalent in Magento 2?


texts: which model extend AbstractExtensibleModel by default so i can use extension attributes with it ?


texts: How to change array index position in Magento

texts:
Actually i used this code in my live site

    <?php $path = $_SERVER["HTTP_REFERER"];
    $pathParts = explode('/', $path);
    if (count($pathParts) == 3) {
        echo $currParentCategory = strtolower($pathParts[2]);
    }
    elseif(isset($pathParts[3]) && strtolower($pathParts[3]) == "customize-furnitures") {
        $currParentCategory = strtolower($pathParts[3]);
    }
    if(!$currParentCategory)
    {
        $path = Mage::helper('core/url')->getCurrentUrl();
        $pathParts = explode('/', $path);
        if (count($pathParts) == 3) {
            $currParentCategory = strtolower($pathParts[2]);
        }
        elseif(isset($pathParts[3]) && strtolower($pathParts[3]) == "customize-furnitures") {
            $currParentCategory = strtolower($pathParts[3]);
        }
    } ?>

    <?php if($currParentCategory == "customize-furnitures"): ?>
<?php echo "Customize product" ;?>
<?php else: ?>
        <?php echo "Simple product"  ?>

This is my live site url https://domain.com/customize-furnitures/test-sofa.html

The problem is now i configured in my local system now the url is

localhost:8080/Magento/index.php/customize-furnitures/test-sofa.html

so url is changed that's why array index not working how i fix it??


texts: Magento 2 How to Increase payment session PayUMoney

texts:
Hi Am Testing PayU Payment gateway for magento 2. I have a testing account for payUMoney.
During checkout after the adding credentials and OTP its shows error if it exceeds 30 seconds. If I add credentials and OTP within 30 seconds its getting redirected to success message page.
Fatal error: Uncaught TypeError: Argument 2 passed to PayUIndia\Payu\Model\Payu\Interceptor::postProcessing() must be an instance of Magento\Framework\DataObject, null given, called in /data/www/uat/app/code/PayUIndia/Payu/Controller/Standard/Response.php on line 25 and defined in /data/www/uat/generated/code/PayUIndia/Payu/Model/Payu/Interceptor.php:124 Stack trace: #0 /data/www/uat/app/code/PayUIndia/Payu/Controller/Standard/Response.php(25): PayUIndia\Payu\Model\Payu\Interceptor->postProcessing(Object(Magento\Sales\Model\Order\Interceptor), NULL, Array) #1 /data/www/uat/generated/code/PayUIndia/Payu/Controller/Standard/Response/Interceptor.php(24): PayUIndia\Payu\Controller\Standard\Response->execute() #2 /data/www/uat/vendor/magento/framework/App/Action/Action.php(108): PayUIndia\Payu\Controller\Standard\Response\Interceptor->execute() #3 /data/www/uat/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http)) #4 /data/www/uat/ve in /data/www/uat/generated/code/PayUIndia/Payu/Model/Payu/Interceptor.php on line 124

I am not Understanding how to handle this. Can I get some help? Thank you in advance.


texts: How to add a custom column to Company admin Grid with filtering and sorting options

texts: I want to add a column 'company_seller_name' which is present in database custom table "abc_company" to Company Grid. Can someone please help me with this?


texts:
We began randomly seeing a memory limit issue when attempting to view cart or checkout on the frontend, or create an order in the backend. After reviewing the logs, I disabled AvaTax and the error disappeared. No changes have been made recently and a mirror of the site on my development server did not experience the same issue. The memory limit on the production server is 512M and I ran the dev server down to 128M without any issue.

a:5:{i:0;s:85:"Allowed memory size of 536870912 bytes exhausted (tried to allocate 1768292353 bytes)";i:1;s:2579:"#0 /app/code/community/OnePica/AvaTax/lib/classes/DynamicSoapClient.class.php(27): SoapClient->SoapClient('file:///var/www...', Array)
#1 /app/code/community/OnePica/AvaTax/lib/classes/TaxServiceSoap.class.php(78): DynamicSoapClient->__construct('file:///var/www...', Array, Object(ATConfig))
#2 /app/code/community/OnePica/AvaTax/Model/Config.php(193): TaxServiceSoap->__construct('Magento')
#3 /app/code/community/OnePica/AvaTax/Model/Avatax/Abstract.php(54): OnePica_AvaTax_Model_Config->getTaxConnection()
#4 /app/code/community/OnePica/AvaTax/Model/Avatax/Estimate.php(181): OnePica_AvaTax_Model_Avatax_Abstract->_send(NULL)
#5 /app/code/community/OnePica/AvaTax/Model/Avatax/Estimate.php(109): OnePica_AvaTax_Model_Avatax_Estimate->_getRates(Object(Mage_Sales_Model_Quote_Item))
#6 /app/code/community/OnePica/AvaTax/Model/Sales/Quote/Address/Total/Tax.php(63): OnePica_AvaTax_Model_Avatax_Estimate->getItemTax(Object(Mage_Sales_Model_Quote_Item))
#7 /app/code/core/Mage/Sales/Model/Quote/Address.php(1013): OnePica_AvaTax_Model_Sales_Quote_Address_Total_Tax->collect(Object(OnePica_AvaTax_Model_Sales_Quote_Address))
#8 /app/code/core/Mage/Sales/Model/Quote.php(1331): Mage_Sales_Model_Quote_Address->collectTotals()
#9 /app/code/core/Mage/Checkout/Model/Cart.php(458): Mage_Sales_Model_Quote->collectTotals()
#10 /app/code/core/Mage/Checkout/controllers/CartController.php(144): Mage_Checkout_Model_Cart->save()
#11 /app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_CartController->indexAction()
#12 /app/code/local/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 /app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#15 /app/Mage.php(684): Mage_Core_Model_App->run(Array)
#16 /index.php(88): Mage::run('store_englis...', 'store')
#17 {main}";s:3:"url";s:15:"/checkout/cart/";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:16:"store_english";}


texts: Magento 1.9 multiple pricerules pick the highest discount

texts:
At our magento site we have some different price rules where some of the products affected are the same.
But it should not apply all rules to the product only one, we want it to set the discount bythe rule that gives the highest discount. All rules are set to give a percentage discount.

Is that possible?


texts: What does the Customer is_active flag do?

texts:
During a discussion today I was informed that the Customer is_active flag doesn't actually do anything.

This is a unique flag, like the customer email address, in that it's not an EAV attribute.  Instead, it is a column in the customer_entity table.

I tried setting the flag to 0 for a test customer, but am still able to login.  All other functionality seems to work normally.

Is this flag provided as a convenience to developers?  Is it intended for some future purpose?  What, if anything, does is_active do?

Edit: Here's a related stack overflow: https://stackoverflow.com/questions/3617832/disable-customer-in-magento


texts: Customer custom attribute not being saved

texts:
I'm using magento v2.5 and i tried to create customer programmatically from frontend and backend, i share the same code between frontend and backend, after customer being save then i try to save the customer custom attribute which i made, the problem is when i try to do it from frontend side it works fine, but when i try to create the customer programmatically from backend (adminhtml) the customer was saved, but the customer custom attribute not being save:

// \Magento\Customer\Model\CustomerFactory $_customerFactory,
// \Magento\Customer\Api\CustomerRepositoryInterface $_customerRepoInterface,

$customer = $this->_customerFactory->create();
$customer->setWebsiteId(1);
$customer->setFirstname($data['firstname']);
$customer->setLastname($data['lastname']);
$customer->setPassword($data['password']);
$customer->setGender($data['gender']);
$customer->setDob($data['dob']);
$customer->setEmail($data['email']);
$customer->save();
$customer = $this->_customerRepoInterface->getById($customer->getId());
$customer->setCustomAttribute('dice_sum', '23');
$customer->setCustomAttribute('place_of_birth','joan');
$this->_customerRepoInterface->save($customer);

but if i try to load the old customer from backend try to save the customer custom attribute, it's working fine:

$customer = $this->_customerRepoInterface->getById($customer->getId());
$customer->setCustomAttribute('dice_sum', '9999');
$customer->setCustomAttribute('place_of_birth','dome');
$this->_customerRepoInterface->save($customer);

edit:

i've tried to add the customer attribute from raw query but it still not working either:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
      $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
      $connection = $resource->getConnection();
      $tableName = $resource->getTableName('customer_entity_varchar');
      $sql = "SELECT * FROM " . $tableName . " WHERE attribute_id = '160' and entity_id = '".$data['customer_id']."'";
      $result = $connection->fetchAll($sql);
      if (empty($result)) {
        $sql = "INSERT INTO " . $tableName . " (attribute_id, entity_id, value) Values ('160','".$data['customer_id']."','".$data['place_of_birth']."')";
        $connection->query($sql);
      }
      $sql = "SELECT * FROM " . $tableName . " WHERE attribute_id = '135' and entity_id = '".$data['customer_id']."'";
      $result = $connection->fetchAll($sql);
      if (empty($result)) {
        $sql = "INSERT INTO " . $tableName . " (attribute_id, entity_id, value) Values ('135','".$data['customer_id']."','".$data['dice_sum']."')";
        $connection->query($sql);
      }


texts: Magento 1.9 Unable to Attach Multiple PDF files with email

texts:
I'm trying to send multiple PDFs with an email. Currently, I am only able to send a single file
public function sendMailpart2()
{

    $templateId = 79;
    $sender = Array('name' => "Sender Name",'email' => "sender@gmail.com");
    $requestquotesvars = array(
        'firmname'     =>  "Customer Name"
    );
    $emaiName = 'Request Quote Firms';
    $storeId = Mage::app()->getStore()->getId();

    $translate = Mage::getSingleton('core/translate');
    $transactionalEmail = Mage::getModel('core/email_template');

    $directory = Mage::getBaseDir() . '/pallexpdfs';
    $file = "100185813_P2.pdf";
    $pdfFilePath = $directory . "/" . $file;
    if(file_exists($pdfFilePath) )
    {
        $transactionalEmail->getMail()
            ->createAttachment(
                file_get_contents($pdfFilePath),
                Zend_Mime::TYPE_OCTETSTREAM,
                Zend_Mime::DISPOSITION_ATTACHMENT,
                Zend_Mime::ENCODING_BASE64,
                basename($file)
            );
    }

    $translate->setTranslateInline(true);
    $transactionalEmail->sendTransactional($templateId, $sender, "receiver@gmail.com", "Receiver Name", $requestquotesvars, $storeId);

}

The above code sends the file fine but when I try to add another file by repeating the code
    $file = "SECOND_FILE.pdf";
    $pdfFilePath = $directory . "/" . $file;
    if(file_exists($pdfFilePath) )
    {
        $transactionalEmail->getMail()
            ->createAttachment(
                file_get_contents($pdfFilePath),
                Zend_Mime::TYPE_OCTETSTREAM,
                Zend_Mime::DISPOSITION_ATTACHMENT,
                Zend_Mime::ENCODING_BASE64,
                basename($file)
            );
    }

It sends an empty file named Noname. Am I doing something wrong please guide me


texts: How to make purchase order number optional in checkout page magento 2.3

texts: Is there any way to make purchase order optional in checkout page??


texts: SSL Set-up advice with a Multi Website Magento

texts:
I have Magento website using multiple domains and I need an SSL for each of them has anyone already done this, their advice would be much appreciated.

I need to know if a Multi-Domain SSL be best or should I use SIN and purchase a regular SSL for each of them? and can this be done using the same IP
Also does anyone know if I need a Multi-Domain SSL or Multi-Domain OrganizationSSL to be PC/DSS compliant?

My set-up is:

Centos 11.44
Cpanel/WHM 6.6
Apache
Magento 1.9.2 CE

This question was some help: What is the best way to setup SSL certificates on a Multi Store installation?


texts: Magento 2 Image in product detail not showing

texts:
I have created many products manually and uploaded images to them, only in list is showing the image, but when I click on product to see the details it's not showing.

I have run
php bin/magento indexer:reindex
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento cache:flush

chmod -R 775 magento_folder

It's not working.
Only in this store view is not working, I don't know why.


texts: How to apply patches in old non compatible version

texts:
I know this is not a right way to implement but unfortunately this is the requirement and I have some limitation for this.

I am using Magento EE 1.6.0.0 and in this version I want to apply MasterCard BIN Range Update (8967) patch magento has already mention that this patch is only for 1.9.0.0 and higher but the problem is I can't update this version.

Is there any way to solve this problem.

What are the impacted area and how I can apply patch which is not compatible for the version.

If I want to apply patch manually then how to achieve this.

patch details can be found at this.