texts: I want to disable the default new order email sending functionality and instead I want to send this email with cron job only. How can I identify, if the new order is placed and send email ?


texts: How add a custom layout to show in the select of page ( Custom Layout Update)

texts: i have a page with URL my-name and create a block, but where create a file in /app/design/frontend/Vendor/theme/Magento_Cms/layout/cms_page_view_selectable_my-name_myname.xml i need relationship the block with my page in that select page.


texts: Magento 2: Disable cache for price block

texts:
I want to disable the cache of the price block in detail page. However, I cannot find a place to modify it. I try to add cacheable="false" in

  module-catalog\view\base\layout\catalog_product_prices.xml

but it is still not working. Also, I try to override the class

  module-catalog\Pricing\Render\FinalPriceBox.php

with

protected function getCacheLifetime()
{
    return null;
}

and it also cannot disable the cache.

Please help.


texts: My store has around 30000+ products. I would like to add a new product on fly whenever a customer request for a particular custom product and send that product link to customer via email. I have seen post saying to add product programatically which i didn't understand how to use/run that script, also found a Cart2quote plugin which is way too expensive. So, can anyone help to achieve what is required?


texts:
I want do display a form based on what product / option is chosen, when a user wants to buy this product he has to fill in that extra form so a contract can be printed from that data. I have 2 ways in mind to do this but i wonder what would be the most efficient.

The first i tought off was just catching the add to cart observer and check for the presence of the element there, if its there redirect the form, if it's not there, don't redirect. Off course that would require me to do another check on the cart page itself, otherwise users could just go straight to the url if I am not mistaken.

A second one would be to add an extra form to the checkout, this would make the checkout longer and could cause users to abandon sooner.

I was wondering if you guys had any better ideas or some pointers on wich one is the best.

I am not asking for code (as i want to do it myself), I just want to know if there is any "correct/standard" approach for this.


texts: can the magento2 system work without valid email address?

texts:
I have a question that can we build a magento2 application without valid email id.
the reason why I am asking this is because, I feel that a valid email id is mandatory for all the communications (for orders, updates on sipping etc etc).
so can we go ahead and build a system based on invalid address for customers?
please help me out.


texts: Licence for paid extension when creating extension

texts: I created an extension that i want to put in magento commerce. I am looking for a licence for paid extension which doesn't give the rights to the buyer to distribute it further (the buyer can use it as many times as he wants but not give it to someone else).


texts:
Please help me - How to create autocomplete for city field(checkout form) Magento2?
How to catch click event on "city" field by knockout.js?
thanks.

There are two fields - country and city in checkout form. I want to implement my custom jQuery code:

I want to take country id from the field of the checkout form and sent it to my server than get response from the server with list of related cities and put them to city field of the checkout form with autocomplete functionality.

The main problem - where is the place where I can put my custom jQuery code in order to get the country id because the checkout form is loaded after the checkout page has loaded.


texts: Where can I find the file for product view translation?

texts:
Does anyone know where to find the translation file for this line "Buy 2 for $84.60..." ?

I am trying to change the default Chinese text in the 2nd pic. I am using Magento ver. 1.9.2.4


texts: Magento 2 Refused to frame 'https://www.facebook.com/' because an ancestor violates the following Content Security Policy directive:

texts:
I have installed extension for integrate facebook messenger chat. but giving " Refused to frame 'https://www.facebook.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors https://www.facebook.com" in console and also messenger live chat application not appear in front end.
what should I do for get this work.


texts:
I am working on product import section and i am facing following issue during import csv.

  General system exception happened
  Additional data: URL key for specified store already exists.

Scenario to occur this issue:

I have imported product csv before some day in fresh installation of magento 2, its working fine. But after delete some product and then import same product csv. Above issue has been raised.

Note : i have checked into magento 2.0.0 to 2.0.2

CSV FILE : http://we.tl/8nxdFSDp8R

Any help would be appreciated.


texts: problems in add a new image attribute in magento 1.9

texts:
add an image attribute and assign to a new group to an attribute set, but when I create a new product, I can see the group but could not see the table of the new image attribute.

But it will be no problem if create a new text attribute and assign to the attribute set in  the same way.

What is the problem?


texts:
My Magento store has around 60,000 products. We use flat tables. We are in the process of separating them into different attribute sets, and are adding lots of new attributes to assist with filtering and comparing, etc.

Recently we ran into a database limit from having too many attributes while indexing our flat product catalog:

SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large. The maximum row size for the used table type, not counting BLOBs, is 65535.

Now I know there are ways to adjust Magento to handle this, but the way I see it is that this problem will resurface again and again as the number of attributes in our system increases (which it will).

New question: Should I disable the flat product catalog and run my site off EAV? At what point (if at all) do the flat tables lose their performance gains over EAV? Does anyone have any useful performance benchmarks comparing the two at different database sizes?


texts:
I have issue when install Image Optimizer plugins.

http://connect20.magentocommerce.com/community/Tiny_Compresss_Images
http://connect20.magentocommerce.com/community/Kraken_Image_Optimizer

and i got this error

community/Tiny_Compresss_Images: Encountered end of file
community/Kraken_Image_Optimizer: Encountered end of file

suggest me to get out from this.


texts: Changing product status with Magento (1.9) script not visible in Admin

texts:
I'm trying to get all product without image to desactivate them.
I started from this thread https://stackoverflow.com/questions/3565377/how-can-i-find-all-products-without-images-in-magento

At first, it was just to extract products without images, and it was working fine, but now I need to disable them and it's half working.

The problem is, when the code return that the status has changed, when I go back in Magento Admin, the product is still enable. (cache and indexes refreshed)

But when I run again the code, the status has changed and I can't see the product on the site.

So the code is working BUT I don't know why the admin product manager can't see that change.

I didn't find threads where I can get a glimpse of a solution.
Maybe I'm just doing all wrong and I can't PROPERLY change the status from a collection.

Here my php file (mymagento/var/import/dev/test.php) :

header('Content-Type: text/html; charset=utf-8');
require_once('../../../app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

$storeId = 1; //check in magento admin
echo "Store ID : ".$storeId."\n
\n";
//this builds a collection that's analagous to
//select * from products where image = 'no_selection'
$products = Mage::getModel('catalog/product')
    ->getCollection()
    ->addAttributeToSelect('*')
    ->addAttributeToFilter(
        array(
            array (
            'attribute' => 'image',
            'like' => 'no_selection'
            ),
            array(
                'attribute' => 'image',
                'null' => '1'
            ),
            array(
                'attribute' => 'small_image',
                'null' => '1'
            ),
            array(
                'attribute' => 'thumbnail',
                'null' => '1'
            ),
            array(
                'attribute' => 'image',
                'nlike' => '%/%/%'
            ),
            array(
                'attribute' => 'small_image',
                'nlike' => '%/%/%'
            ),
            array(
                'attribute' => 'thumbnail',
                'nlike' => '%/%/%'
            )
        ),
        null,
        'left'
    );
echo  "SKU;NAME;VISIBLE;STATUS\n
\n";
foreach($products as $product)
{
    $product->load();

    if($product->getVisibility() == 4 && $product->getStatus() == 1) {
        echo  $product->getSku() . ";".$product->getName().";".$product->getVisibility().";".$product->getStatus()."\n
\n";
        try {
            Mage::getModel('catalog/product_status')->updateProductStatus($product->getId(), $storeId, Mage_Catalog_Model_Product_Status::STATUS_DISABLED);
            echo "Product #".$product->getSku()." : Status changed to ".$product->getStatus().". \n
\n";
        } catch(Exception $e) {
            echo "Product #".$product->getSku()." Status could not be changed: ".$e->getMessage()."\n
\n";
        }
    }
    try {
        $product->save();
        echo "Product #".$product->getSku()." : saved\n
\n";
    } catch ( Exception $e ) {
        echo "Product #".$product->getSku()." could not be saved: ".$e->getMessage();
    }
}

It's just a script to run 1 time to get rid of products without images to start on good bases for the next update.

Thank you for your time !


texts: Magento2 How to move add to compare product from guest user to login user?

texts:
Magento2 Rest API & PWA.
Using PWA I want to allow the user to compare products. I added the product to comparison programmatically.
I am facing 2 issues

For Guest User, how do I stop the user from adding the same product to compare, if that product already is in compare list

How am I supposed to transfer the compare products from Guest User to login user?


texts: Magento 2 Custom Customer Account Link Created but that related phtml is coming with out navigeation links on left side?

texts:
Actually I created A Custom Customer Account Navigation link by using This xml

<?xml version="1.0" encoding="UTF-8"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="customer_account_navigation">
            <block class="Magento\Framework\View\Element\Html\Link\Current" name="custom-link" after="-">
                <arguments>
                    <argument name="label" xsi:type="string">My Custom Link</argument>
                    <argument name="path" xsi:type="string">frontname/controller/action</argument>
                </arguments>
            </block>
        </referenceBlock>
    </body>
</page>

It Created The "My Custom Link" at the navigation links list but when I click on that link the corresponding phtml is opening in new page which is not containing customer navigation links at all on left side.How can I display that phtml beside the navigation links same like other link phtml.


texts: How to show a different "store view" when browsing from Mobile and Desktop

texts:
I have read loads of tutorials on how to set up a specific "store view" for the mobile version of my magento store.

My problem is that nobody really explain on how (after the different store views are being created) you can have magento show automatically one store view when browsing from mobile and another one when browsing on the desktop.

Where is the place where to insert the user agent expression?

Please note: I am not looking for how to change the theme, but instead how to show a different store view. What I need to do is being able to "switch on and off" different pages or static blocks when browsing the same theme from mobile or desktop.

maybe you can help me with this.


texts: how can I get the custom customer attributes dropdown box to checkout page?

texts: I created a customer custom attribute with options. It did show on the user profile(able to save and edit). How do I make this dropdown box also show at the checkout page? (above shipping method) It will show this selection box with (user predefined selection), so it will submit into the sales_order table and also update the change of this attributes to user profile?


texts: Fatal error: Class 'Adminmodule_Customerpage_Helper_Data' not found in /home/weburl/app/Mage.php on line 547

texts:
This Error occured durring instalation of extension in magento store.
when i did configuration disable and copmlitaion enabled, then all dashbord of admnin pannel lost and this error showing on my admin pannel.
Please advice me how i can recover my website from this error.


texts: Magento 1.9 - Change Tax in created invoice

texts:
Unfortunately somebody changed the tax class for many of our products.
We needed 2 weeks to recognize that. Now I got 150 orders with wrong tax.
I need to fix that and resend all invoices to the customers.
I tried to check the SQL for the right entrys and fix it manually but I failed in that jungle.
Maybe somebody got any script for things like that? Or could me please say in wich tables i got to fix that manualy?

Thank you!


texts: "Be first to review" not getting displayed (Magento version 1.9)

texts:
I have replaced Review template from rwd default theme

So review tab is getting displayed on my custom theme, on view page.

But the link "Be first to review" is not getting displayed.


texts: I am working with Magento 1.9.2 and send email to a friend is not sending emails. It gives sent successfully report message. But not sending. Any clue how to debug?


texts: Magento 2: get attribute set name for a product in phtml file

texts:
I try to get the attribute-set name for a product in a phtml file.
In magento 1 the code for this is:

$id = 2;
$product = Mage::getModel(‘catalog/product’)->getCollection->load($id);
$attributeSetModel = Mage::getModel("eav/entity_attribute_set");
$attributeSetModel->load($product->getAttributeSetId());
$attributeSetName = $attributeSetModel->getAttributeSetName();
echo $attributeSetName;

i have the attribute_set_id, but i try to get the name.

Which one is equivalent for magento 2?
Any ideas?


texts: Magento 2: Order Increment Id not working

texts:
In our website, magento order increment id is not working as expected. We are getting difference of 3 between every two orders. Like for example,we have order 000005167 and next order we are getting as 000005170.

And when we checked from DB to know the next autoincrement value,it is showing as follows:

  MariaDB [pkdxthkinb4aa_stg]> SELECT AUTO_INCREMENT FROM
  information_schema.TABLES WHERE TABLE_SCHEMA = "pkdxthkinb4aa_stg" AND
  TABLE_NAME = "sequence_order_1";

+----------------+

| AUTO_INCREMENT |

+----------------+

|           5173 |

+----------------+

While we should get 5171 as the last value in sequence_order_1 table is 5170.

Can you please advice me on how can I fix this

Thanks in advance


texts: There are 2 VAT Fields in onepage checkout which one should I be using?

texts:
It seems there are two VAT fields available and I am not sure which one to use.

One of the fields is tied to the customer/address model while the other seems to be tied directly to customer. In checkout/onepage there are places to output both fields (one is hardcoded as an address field) and the other is created with customer/widget_taxvat.

When using guest checkout or registering for an account during checkout both of these fields appear if their respective config are toggled on (customer/create_account/vat_frontend_visibility and customer/address/taxvat_show).

Which one of these should I be using?

Someone posed the same question on the Magento forum but the only response was:

  I have simillar problem.
  Check http://www.magentocommerce.com/bug-tracking/issue?issue=13504
  They say that \"VAT is related to address by design\” - I quess it means that old VAT field, related to customer rather than to billing address, is deprecated.
  So simply disable it…

And that is hardly conclusive given that post is from 2012 and Magento 1.7 and there are no @deprecated tags on the templates or widgets/blocks for the customer taxvat field in 1.9 some 2 years later.

I did try and take a look at that ticket in the bug tracker to see if there was some more detailed info but it seems to have been removed from the system (note: that direct link wont work since the routing has changed, but i tried to look up the ticket number as well as do a keyword search and got no joy).


texts: Magento : Load 2 js libraries into magento 2 homepage, and call some functions in page content

texts: I've been trying to add 2 new javascript libraries into my Magento 2 installation, and to do that, I've added them through "app/design/frontend/theme/themeName/layout/default_head_blocks.xml" and I have also created a "requirejs-config.js" into my theme folder, and I have loaded my libraries into my "web/js" folder. Now one of the librarie is "jquery-3.3.1.min.js" and the other is "jquery.bxslider.min", I've tried to load them from cdn, but wasn't working, so I loaded them on my hosting. Anyway now I'm calling the function for running the sliders, but is now working any of the sliders, and is not working even the menu on mobile, basically is not opening the hamburger menu anymore.


texts: how can I add a link to my navigation menu

texts: I'm wondering the best way to add a custom link to the top navigation menu?


texts: Which concrete job does reset catalogrule rules every day?

texts:
We have disabled catalogrule_apply_all Magento cronjob, because of multi-environment system (to simplify things: let's say we have 1 staging server & 1 production server) in one of our customer. Catalogrule refresh process is done only in one environment (staging), and then we pass database data through a system process from that environment to others (production)

Problem is we have some days when we don't pass data between environments, and then the catalogrule refresh is not executed, but Magento does the reset in production environment.

Somebody here know which concrete Magento cron task does that daily reset? Or maybe this is not done by any cronjob, so the problem is the catalogrule refresh is simply required to be executed every day, even if there aren't any changes in active catalogrule rules?

UPDATE
I suspect this is the cause, can somebody confirm that?

<crontab>
    <jobs>
        <catalog_product_index_price_reindex_all>
            <schedule>
                <cron_expr>0 2 * * *</cron_expr>
            </schedule>
            <run>
                <model>catalog/observer::reindexProductPrices</model>
            </run>
        </catalog_product_index_price_reindex_all>
    </jobs>
</crontab>


texts: Catalog Page Crashes On Backend in Configuration

texts:
After logging into backend and navigating to Stores > Configuration > Catalog, Site crashes and shows this error, also the search on the site shows same error.
Please note that Catalog Search on the index management shows "Reindex Required", which I have tried to resolve through multiple ways but the case remains same.
PS: magento version 2.4.1


texts: How to Disable a Module in a specific store in Magento 2.2.2

texts:
I have a question, guys. Is it possible to disable a module in a specific store view? Also, this is a multistore site with different themes for each store.

If you guys have ideas please help me.

Thanks,


texts: Magento 2.4 - How to enable ajax for add-to-cart button and wishlist button of product widgets on homepage?

texts: I have added products on the homepage using the widget, how to enable ajax for add-to-cart button and wishlist button of product widgets.


texts: custom attribute in customer address grid

texts:
I am trying to add a column in the customer address grid in admin with a custom attribute.
 <column name="addresstypes" class="xxx\AddressAttribute\Ui\Component\Listing\Address\Column\Addresstype" sortOrder="95">
        <settings>
            <filter>text</filter>
            <label translate="true">Address Type</label>
            <editor>
                <editorType>text</editorType>
            </editor>
        </settings>
    </column>

It is added also and shown in the grid. but, the value which I in form, it's showing correctly if the customer has only one address. if they have multiple addresses, then also shows the same value for all. but in form, there is a different value.
this is my UI-component code:
 public function prepareDataSource(array $dataSource): array
{

    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as &$item) {
            $name = $this->getData('name');
            if (isset($item['entity_id'])) {
                $customerId = $item['parent_id'];

                $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $customerObj = $objectManager->create('Magento\Customer\Model\Customer')->load($customerId);

               $billingAddressId = $customerObj->getDefaultBilling();

                $customerAddress = array();
        foreach ($customerObj->getAddresses() as $address)
        {
            $customerAddress[] = $address->toArray();

        }

        foreach ($customerAddress as $customerAddres) {

            $addressId = $customerAddres['entity_id'];
            $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
            $addressshipto = $objectManager->get('Magento\Customer\Model\AddressFactory')->create()->load($addressId);

            $addresst = $addressshipto->getData('addresstype');

             if(isset($customerAddres['addresstype'])){

            $addressType = $customerAddres['addresstype'];
            }

            if(isset($addressType) && $addressType == 21764) {

                $item['addresstypes'] = "Bill to  ";
               }else{
                $item['addresstypes'] = "Ship to  ";
               }

         }

        }
    }
}

    return $dataSource;
}


texts: Unable to add or edit products in magento 1.9.2

texts:
I have a website in Magento 1.9.2. It has nearly 6,000 products. I am trying to update or delete products but I am unable to do so as I am getting a strange error

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'harbourlivingcom_1.premier_prod_priceupdate' doesn't exist, query was: insert into premier_prod_priceupdate (sku,newprice, oldprice, datetime) values('AADZWS','27.99','17.9900',Now())

I have no table in my database and have no idea what to do.


texts: Magento 1.x core config values in mysql upgrade?

texts:
I have the following lines to get a core_config_data value in a mysql upgrade script

$installer = $this;
$installer->startSetup();
$adapter = $installer->getConnection();

$my_store = Mage::getModel("core/store")->load("my_store", "code");
$templatePath = 'foo/bar';
$config_value = Mage::getStoreConfig($templatePath, $my_store);

if I debug $config_value I get null. However if I add this to a controller action I get the expected value. So it seems that I can't retrieve a config value from within a mysql upgrade script?


texts: I need to observe when the user is reordering an order (to delete a product), but i can't find the event, which one is it ?


texts: How to add text below shipping methods on checkout

texts:
I want to add some shipping policy of company below shipping methods on checkout.
Below is image attached which i want to achieve.

I am beginner to magento2. Kindly guide me how can i achieve this.
Thanks


texts: Magento 2: How to implement columnControls(hide/show) functionality in custom admin grid

texts:
Here I have created a custom grid(inside admin) using block, now I want to add controlColumns(hide/show) functionality in this custom grid.
Using Ui Component, it's easy to add this functionality by using below code (in grid listing page):

<columnsControls name="columns_controls"/>

But I want to add this functionality in custom grid which is made using block.

I am also attaching a image file with reference of this problem.

Please give me an idea that how can I achieve it. Any help will be appreciated.


texts: adding and removing product from the cart at the same time

texts:
I have pay pal checkout button on Product page in magento . Clicking on it adds the product with respective quantity to the cart and takes user to the pay pal express checkout page. https://prnt.sc/hv1b1l

Now my problem was If user decides to change the quantity of product on pay pal express checkout page and click browser back button, then they are send to the product page and If they change the quantity and click on pay pal checkout button for checkout process then the product is added to the cart with respective quantity. Say first time 2 quantities of a product was added and second time 3 quantities of the same product was added then this makes total of 5 of the same product in the cart. This should not happen. The cart should update to only 3 products.

What I did for the above problem is I made some changes in addAction function in CartController.php I have added the following code

    $returnUrl = $this->getRequest()->getParam('return_url');
    if (strpos($returnUrl, '/paypal/express') !== false) {

        $quote = $cart->getQuote();
        $existingProducts = array();
        foreach($quote->getAllVisibleItems() as $item) {
            $existingProducts[$item->getProductId()][] = $item->getItemId();
        }

        $item_id = $existingProducts[(int)$params['product']][0];

        if ($item_id) {
            $this->_getCart()->removeItem($item_id)->save();
        }

        $this->_getSession()->setCartWasUpdated(true);
    }
    /*Code to add product is here*/

It checks If I am clicking on pay pal express checkout button on Product page then it checks if the respective product is in the cart then it first removes it from the cart and then the addAction of CartController.php adds it back again with new quantity or parameters.

Now the problem I am facing is if previously I had 2 quantities of a product in the cart and I came back to the product page from pay pal express checkout page and decides to make the quantity 3. I change the quantity to 3 and it works fine. But If I have only 4 quantity of that product in stock then it gives the error "The requested quantity for "Product Name" is not available."

I know this is happening because cart is not getting updated but I could not think of any solution. Please any one can guide me what should I do or try.


texts: How to input these variables in a magento 2.3.4 mail template

texts:
We would like to display these variables in a new email template (which is currently assigned to a orderstate):
Ordernumber, Customername, Order Status & Invoicenumber.
The following code does not work:
{{var order.increment_id}}, {{var customer.name}}, {{trans "%name," name=$order.getCustomerName()}}


texts: Authorized.net is not working in magento2.3.2

texts:
I setup configuration in the Test site. The Sandbox mode credential set now.

https://prnt.sc/ogarkh

when I pay using an authorized payment method it gives an error:

  Root element is missing.

  https://prnt.sc/ogaqcy

anyone have a solution please share it.


texts:
Im trying to change the order of specific categories using a php script. The script below runs fine, and im seeing the position change values in catalog_category_entity, but order is unaffected in the admin, and in the front.

$mageFilename = '../../app/Mage.php';
require_once $mageFilename;

ini_set('display_errors', 1);

Mage::app()->setCurrentStore(0);

//children categories of "Pro Audio"
$catOrder = array(
    70,
    141,
    131,
    382
);

$position = 1;
foreach ($catOrder as $catId) {
    $category = Mage::getModel('catalog/category')->load($catId);
    if($category->getId()){
        $category->setPosition($position);
        $category->save();
        echo "Set position for ".$category->getName()." to ".$position." \n";
    } else {
        echo "Could not load product\n";
        die();
    }
    $position++;
}

echo "end\n";


texts: Magento 2 include xmlToArrayParser php library and use it in module

texts:
I want to include below php library in my custom module

https://github.com/Robhub/trocutc/blob/master/incl/xmlToArrayParser.class.php

and want to use the same in controller or helper.

I have included the class file in Lib folder as lib/xmlToArrayParser/xmlToArrayParser.php but what to do further.

How this can be done.


texts: Magento custom attribute check on cart/checkout page (show/hide shipping method) based on specific attribute selected in backend

texts:
I was figuring out a way to write a functionality that can check on my cart/checkout page (Magento 1.9x) custom attribute either based on YES/NO selected from the backend of that particular product should produce specific action.
The main purpose of writing this code was to restrict people in California purchasing specific products which are not compliant. I hope it helps!
Directory to look for:
design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml
Full working code snippet is shown below with appropriate comments:
<?php

//loads selected shipping state
$shippingst= Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getRegion();

//loads quote in cart variable
$cart = Mage::getModel('checkout/cart')->getQuote();

//loop to handle all items in cart
foreach ($cart->getAllItems() as $item) {

//loading product attribute code
$productAtt= Mage::getModel('catalog/product')->load($item->getProduct()->getId())->getres_california();

//condition that checks selected region is california and product restricted attribute code is true
if ($shippingst=='California' && $productAtt=='1') {

//Perform here whatever action is required on checkout page

echo "";

echo $shippingst.": Restricted
";

echo "We're sorry cart contains product restricted in california";

echo "
Check your cart";

        break; //dont break the loop if you want to repeat action for each product in cart.

    }

    else {echo "";}

      }

?>

$productAtt loads the attribute code, Where res_california is the attribute code value taken out from backend of magento.


texts: Magento: Hiding and not counting out of stock in layered navigation

texts:
About: Hiding and not counting out of stock in layered navigation in Magento

Hi, this has boggled us for quite a while. An I did not find a solution. We upgraded to Mage 1.8.1 hoping that it would be fixed.

We have 19 shirts (configurable products)
that sell in sizes 38, 39, 40 etc
some of these shirts are not available in size 38 or 39
so when a user clicks on the sizes filter in layered navigation it would show only shirts that have stock in that size

But what happens is

Problem A: the count of products per size is 19 everywhere. But this is not correct, some of the 19 shirts are only available in size 38 or 39

Problem B: When I click to filter on size 38, I would expect to see only shirts on the next page that actually are available in size 38

Now how could we solve this? is this a configuration something that I am missing? Show out o stock products yes/no, in attribute settings? or do I need to change this in the code?

Expected behavior would be:
- count only products that actually have a size available
- show only products that actually have a size available

a example http://i.snag.gy/kwhO2.jpg

Help appreciated!!


texts: How to password protect magento cms page.?

texts:
I want to protect my pages (not whole site) with password in magento.

I want to add one password field in magento admin panel at CMS block. So when I create new page, I can also set password for it.

When I hit the URL of a page then it should popup to take password and after inserting proper password then page should be opened.

How can I do this or Is there any extension.?


texts:
Add to cart is not working. When I had product to cart then it display message like

 You have no items in your shopping cart.
 Click here to continue shopping.

I tried,

  Stores -> Configuration -> Web -> Default Cookie Settings -> Cookie Lifetime = 86400

But still no effect.


texts:
I have displayed products in some category page with the help of featured product slider in grid form with static block you can see here (http://demo.wdwil.com/kbd/stone.html), what I need to is I need layerd navigation in the left bar, How Can I do?  please advice.

Thanks in Advance


texts:
My custom payment is blocked by this core function for free orders:

in app/code/core/Mage/Payment/Model/Method/Abstract.php

    public function isApplicableToQuote($quote, $checksBitMask) {
    ...
    if ($checksBitMask & self::CHECK_ZERO_TOTAL) {
        $total = $quote->getBaseSubtotal() + $quote->getShippingAddress()->getBaseShippingAmount();
        if ($total < 0.0001 && $this->getCode() != 'free'
            && !($this->canManageRecurringProfiles() && $quote->hasRecurringItems())
        ) {
            return false;
        }
    }

How can I bypass this? Do I need to overwrite the whole function?


texts: convert a Quote into an Invoice, and mark it as Paid

texts:
Sorry, I'm very new to Magento.

I am following this tutorial to create a new payment method. It provides full sample code here.

In the tutorial, when speaking of StandardController.php::successAction(), it says,

  If everything checks out, we can change the state of the order from STATE_PENDING_PAYMENT to STATE_NEW, so its ready for someone on the store to ship and complete. This is also where we'll convert the quote into an invoice and mark it as paid.

I am able to find that first sentence in the code, however I can't find the second part, which is to "convert the quote into an invoice and mark it as paid":

if($state == Mage_Sales_Model_Order::STATE_PENDING_PAYMENT){

    $msg = 'Payment completed via MockPay.';
    $order->setState(Mage_Sales_Model_Order::STATE_NEW ,true,$msg,false);
    $order->save();

    $quote = Mage::getSingleton('checkout/session')->getQuote();
    $quote->setIsActive(false)->save();

}

Perhaps the author forgot to include that part of the code. I tried reading the Magento docs and could only manage to convert to quote into an Order, not an Invoice:

    $convertQuote = Mage::getSingleton('sales/convert_quote');
    $order = $convertQuote->toOrder($quote);

What should be the code here to "convert the Quote into an Invoice, and mark it as Paid"?


texts: Magento 2.3.4 - How to select shipping method at product level in Magento 2

texts:
I am writing an Android App using Magento 2 REST API. Magento 2 comes with shipping method configuration at order level. I would like to be able to choose the shipping method at product level with REST API support.

I searched several extensions and contacted developers and no extension found with REST API support. I am ready to modify the Magento code, if required. Could someone please suggest a easier method ?


texts: Magento 2: Multiple choice swatch attribute

texts:
I have a product (a 'box') which my customers will add three items to the box product. Is there a way for me to create a multiple choice swatch attribute to allow the users to select the three things they'd like to add to the box?

Put simply, if we were using the color swatch as an example, I'd like to give the user the option of choosing three colors from the swatch attribute. Is that possible?


texts:
Uploading images into my backend for a certain item now 404, it seems the permissions set for them are 0640 instead of 0644? Has an update broken this aswell?

Edit: They only 404 in the Backend, the store view is fine. Also noticed new images uploaded give permission 0666 instead of the usual 0644.

Thanks, Steve


texts: Magento 2 Pub/Static Correct File Permissions

texts:
Installed a fresh Magento 2 CE and I am getting 403 permission errors on pub/static files.

I am seeing folders at 700 and files at 666.

What permissions should pub/static files and folders have?


texts: new product type image of bundled product - price_index not insert into catalog_product_entity

texts: I created a new product type image of bundled product and everything is work except the children product cannot insert the price into database table salt_flat_quote_item and sale_flat_order_item. This turned out to give some problems in the order in the backend cannot show children price of this product but I found the reason is because my new product type cannot insert eav price_type into table catalog_product_entity_int then I test to insert this data in the table by manual and child price of the product insert into table salt_flat_quote_item successful. I don't know how to insert this attribute into table catalog_product_entity_int, anyone can help ?


texts: Magento 2. How to remove widget on just one Product

texts:
I have a widget that is shown on all Category page and on all Product page.
I want to hide that widget from one specific product pages. Can I do It with Layout Update XML, if So how ?

The widget is shown before main columns


texts: Magento Special Price to change grouped.phtml table

texts:
I am trying to edit our grouped.phtml table so that when a product has a special price it displays different columns.
I have edited my grouped.phtml page to include these columns but can not work out the correct PHP statements to make them show only when a product has a 'special price'.

I have tried:
<?php if($_product->getSpecialPrice() ): ?> and also <?php if($_product->getSpecialPrice()){ ?> but this does not seem to work.

I have also found another post showing how to display an icon for products with special price: https://stackoverflow.com/questions/17590849/dsplay-sale-icon-on-special-price-products-in-magento-only-at-homepage-it-is-sh

But again this doesn't not work for me.


texts:
Magento 1.x Multistore product image not showing in in store views

Image showing assigned in the back end.

I've tried by assigning product images to store view level and setting as global value but no result.

It is showing placeholder instead of product image.

Please help.


texts: How can I have the size and color of out of stock products displayed?

texts:
I would need help regarding the out of stock and color/size display function on Magento based website.

I show the items on my website, even after they went out of stock.

But the problem is that after an item goes out of stock, the color and size are not visible anymore.
And I would like to show the color and size available at the origin for the item, even when out of stock. Like on this image, I would like to show them in the red area.

So can somebody help me with this?

Thank you.


texts:
I created a copy of my project for testing. First I duplicated the whole folder and renamed it from "test-foo" to "test-bar".

Then I exported the database and imported it (which was very time consuming because there were many timeouts).

Then I changed the file "app/etc/local.xml" to point to the new database.

However, this is how my site looks now:

It seems like it lost the design or does not point to the correct one?

How can I fix this?

Also If I try to enter the backend, then I get redirected to the original site which I have copied, even though I changed "web/secure/base_url" and "web/unsecure/base_url" to point to the new URL.

I also get The current marker does not contain a unique ("unique") column. (translated from german...) inside Phpmyadmin, on every table of the imported database, and I can't edit anything until I execute e.g. ALTER TABLEcore_config_dataADD UNIQUE (config_id)


texts: Magento 2: Overriding Sales Order DefaultRenderer (Order Items)

texts:
I'm trying to override the DefaultRenderer (commonly found when customer views their order in accounts) so I can do some customisations and include extra data.

I've managed to do this successfully, but when I view the order it doesn't show various bits of data which would normally appear without overriding. This includes item options, price, even SKU. It looks like this is anything with $block-> preceding it.

For example:

$block->prepareSku($block->getSku())

Gives me this error:

Invalid method Vendor\FancyOrder\Block\Item\Interceptor::prepareSku

If I remove this line, the order summary loads as expected, but with important information missing.

This is my block. I'm slowly getting used to module creation and dependency injection, so I have a feeling I've missed out some key things:

<?php
namespace Vendor\FancyOrder\Block;

use Magento\Catalog\Model\Product;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\Registry;
use Magento\Framework\View\Element\Template;

class Item extends Template
{

    /**
     * @var Registry
     */
    protected $registry;
    protected $_imageBuilder;
    /**
     * @var Product
     */
    private $product;

    public function __construct(Template\Context $context,
                                Registry $registry,
                                \Magento\Catalog\Helper\Image $imageHelper,
                                \Magento\Catalog\Api\ProductRepositoryInterfaceFactory $productRepositoryFactory,
                                array $data)
    {
        $this->registry = $registry;
        $this->_imageHelper = $imageHelper;
        $this->_productRepositoryFactory = $productRepositoryFactory;

        parent::__construct($context, $data);
    }

    public function getTheImage($productID)
    {
        $product = $this->_productRepositoryFactory->create()->getById($productID);
        //return $this->_imageHelper->init($product,'thumbnail')->setImageFile($product->getThumbnail())->getUrl();

        $resized = $this->_imageHelper->init($product, 'product_small_image')
            ->constrainOnly(TRUE)
            ->keepAspectRatio(TRUE)
            ->keepTransparency(TRUE)
            ->keepFrame(FALSE)
            ->resize(200, 300);
        return $resized->getUrl();
    }
}

I have a feeling I need to declare the class in a different way, but I'm not sure how. I tried Class Item extends Magento\Sales\Block\Order\Item\Renderer but that errors.

Any information may help :)

Thank you!


texts:
I have a multi language web, and I need to redirect from the controller to the actual language of the web.

So $this->_redirectURL('/foo/'); now is redirecting to example.com/foo/ but I need to redirect to example.com/en/foo/

How to introduce the code language in the url redirection?


texts: Google Invisible reCaptcha : bad redirection with Ajax

texts:
I want to use Google Invisible reCaptcha with my Magento for the registration form.

I download this extension : https://amasty.com/magento-google-invisible-captcha.html

I configure in my BO and that works fine for non-Ajax form. But if I use Ajax form, the redirection back to my page not work : I stay on the Ajax page which display {"success":true,"} (or false if there is mistake in the form).

How can I configure my extension to force the redirection back my page after the Ajax ?


texts:
Being newby I look for a workaround to move Sign in and Store switcher from header.panel to header.container. I just tried this code but won't work

<referenceContainer name="header.container">
        <referenceBlock  class="Magento\Store\Block\Switcher" name="store.settings.language" template="switch/languages.phtml"> </referenceBlock>
</referenceContainer>


texts: Magento newsletter confirmation email sent on placed order

texts:
I have a really bizarre situation where when I am logged in to my magento store, if I place an order I get an automated email for newsletter signup confirmation.

If I place a guest order I don't get this.


texts: How do I make it so my phtml only appears on the shipping part of the checkout page and no where else?

texts:
I've got an extension that adds a OAuth login to the checkout page, I only want it to appear on the shipping part of the checkout page and no where else:

want:

Don't want:

checkout_index_index:

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

        <title>PixelPin Connect</title>
        <css src="Pixelpin_Connect::pixelpin_connect/css/styles.css"/>

    <update handle="customer_account"/>

        <referenceContainer name="content">
            <block class="Pixelpin\Connect\Block\Pixelpin\Account" name="pixelpin_connect_pixelpin_account" template="Pixelpin_Connect::account.phtml" cacheable="false">
                <block class="Pixelpin\Connect\Block\Pixelpin\Button" name="pixelpin_connect_account_pixelpin_button" template="Pixelpin_Connect::button.phtml" cacheable="false"/>
            </block>
        </referenceContainer>

</page>

checkout.phtml:

                <div class="<?php echo $this->_getColSet(); ?>">

                   <?php if($this->_pixelpinEnabled()): ?>
                         <div class="<?php echo $this->_getCol(); ?> inchoo-socialconnect-checkout-pixelpin">

<?php echo __('Pixelpin Connect') ?>

<?php echo __('You can continue with checkout using your Pixelpin account.') ?>

                             <?php echo $block->getBlockHtml('pixelpin_connect_login_checkout_button');?>

                    <?php endif; ?>


texts: Is it possible make a button to change customer group?

texts:
I have 3 customer groups and my store already sets the customer to their group automaticly.
What I'm trying to do is allow the customer in group 2 change their group to 3 (and vice-versa) clicking a button in the cart page. Is it possible?
I'm trying to use:

$customer = Mage::getSingleton('customer/session')->getCustomer();
$customer->setData( 'group_id', 3 );
$customer->save();

But how can I save this changes?

I'm using version 1.9.3


texts: Magento 2 - Stock Qty at the time of the order

texts:
I need to get the stock quantity of each product (at the time of the order) to show a custom message on the customer order page view.

Any help? It seems that the products stock information is not stored.

Many Thanks


texts:
Hello I have created admin grid for my custom module, I have a form where it is possible to add new product comments. The thing is that I have Product id field, where u can enter id for which product to post comment. So if non-existent id is entered and saved the page breaks.

This is my save controller:

<?php

namespace Vendor\Module\Controller\Adminhtml\Comments;

use Magento\Backend\App\Action;
use Magebit\ProductComments\Model\Comments;
use Magento\Catalog\Api\ProductRepositoryInterface;

class Save extends Action
{

    private $productRepository;
    protected $_model;

    /**
     * @param Action\Context $context
     */
    public function __construct(
        Action\Context $context,
        Comments $model,
        ProductRepositoryInterface $productRepository
    ) {
        parent::__construct($context);
        $this->_model = $model;
        $this->productRepository = $productRepository;
    }

    /**
     * {@inheritdoc}
     */

    /**
     * Save action
     *
     * @return \Magento\Framework\Controller\ResultInterface
     */
    public function execute()
    {
        $data = $this->getRequest()->getPostValue();
        /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();
        if ($data) {
            /** @var \Vendor\Module\Model\Comments $model */
            $model = $this->_model;

            $id = $this->getRequest()->getParam('id');
            if ($id) {
                $model->load($id);
            }

            $model->setData($data);

            $this->_eventManager->dispatch(
                'productcomments_comments_prepare_save',
                ['comments' => $model, 'request' => $this->getRequest()]
            );

            try {
                $model->save();
                $this->messageManager->addSuccess(__('Comment successfully saved'));
                $this->_getSession()->setFormData(false);
                if ($this->getRequest()->getParam('back')) {
                    return $resultRedirect->setPath('*/*/edit', ['id' => $model->getId(), '_current' => true]);
                }
                return $resultRedirect->setPath('*/*/');
            } catch (\Magento\Framework\Exception\LocalizedException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\RuntimeException $e) {
                $this->messageManager->addError($e->getMessage());
            } catch (\Exception $e) {
                $this->messageManager->addException($e, __('Something went wrong while saving the comment'));
            }

            $this->_getSession()->setFormData($data);
            return $resultRedirect->setPath('*/*/edit', ['comment_id' => $this->getRequest()->getParam('id')]);
        }
        return $resultRedirect->setPath('*/*/');
    }
}

I was thinking about using productrepository getByID function, but haven't yet figured it out. Hope someone will have answers for me, thanks!

Error:

[error] 997#997: *2510 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: mageRunCode in /var/www/magento/public/pub/index.php on line 45
PHP message: PHP Notice:  Undefined variable: mageRunType in /var/www/magento/public/pub/index.php on line 46" while reading response header from upstream, client: 127.0.0.1, server: magento.test, request: "GET /admin_1c63d9/mui/index/render/key/d4e9ab2bc3f8dae59f5c2d8d7d9c810149e8b2cbe127f209f27a92a316f958ae/?namespace=notification_area&sorting%5Bfield%5D=created_at&sorting%5Bdirection%5D=asc&isAjax=true HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "magento.test", referrer: "http://magento.test/admin_1c63d9/admin_comments/comments/edit/id/24/key/897a6e8fe837ce25195df20fa34bd77ee1be78c70e2e7e2f592f97e33de5fb7f/"


texts: calculate total price of product for different attribute

texts:
I am new to magento and trying to calculate total price of any configurable product in magento 2,and I am struggling with it.

Suppose I have two dropdown attribute as following,

1. Paper size

Option     Price
A4         1$
A3         2$
2. Color option

Option           Price
black & white    1$
colored          2$
Result would have been something like:

If someone selected,
paper size =    A4
color option =  black & white
total price = 1+1 = 2$

If someone selected,
paper size =   A4
color option =  colored
total price = 1+2 = 3$

similarly,if,
paper size =   A3
color option =  colored
total price = 2+2 = 4$

But the total price looks something different than i have expected. And there would be more drop down attribute like this. Did i make something wrong ? Is there any better way to do it. Thanks in advance.


texts: Magento 2.3.1 - Issue with catalog search when using php7.2-fpm

texts:
When we search any string from the search text box, We have encountered a 500 server error into the search result page in our live web site or search page getting blank.

When we check in logs or report, it didn't give us any errors.

When we check our server apache log file then we find below errors.

  [proxy_fcgi:error] [pid 4769:tid 140509781169920] [client
  xxx.xxx.xxx.x:58274] Premature end of script headers: index.php,
  referer: example.com/catalogsearch/result/?q=pink

  [proxy_fcgi:error] [pid 4769:tid 140509781169920] [client
  xxx.xxx.xxx.x:58274] AH01070: Error parsing script headers, referer:
  example.com/catalogsearch/result/?q=pink

  [proxy_fcgi:error] [pid 4769:tid 140509781169920] (22)Invalid
  argument: [client xxx.xxx.xxx.x:58274] AH01075: Error dispatching
  request to : , referer: example.com/catalogsearch/result/?q=pink

Our server has apache version 2.4 , PHP 7.2 FPM and HTTP 2 protocol.

Also When we disable magento cache then it's work fine.
With PHP 7.2(not using PHP-7.2 FPM) it's also work perfectly.
Till I debug I found issue when php 7.2 FPM is running and looks like some issue with the proxy_fcgi module.

Any help would be appreciated. Thank You!!


texts: Help! upgrade 2.x to 2.3 get error magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

texts:
php bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/home/wwwroot/veaul/domain/veaul/web/generated/code/Composer
/home/wwwroot/veaul/domain/veaul/web/generated/code/MSP
/home/wwwroot/veaul/domain/veaul/web/generated/code/Magento
/home/wwwroot/veaul/domain/veaul/web/generated/code/Mirasvit
/home/wwwroot/veaul/domain/veaul/web/generated/code/Symfony
/home/wwwroot/veaul/domain/veaul/web/generated/code/Veaul
The directory '/home/wwwroot/veaul/domain/veaul/web/generated/metadata/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
Notice: Undefined index: checkout_agreement in /home/wwwroot/veaul/domain/veaul/web/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152


texts: Magento blank page - $this->loadlayout() seems to be not working for me

texts:
I have created a custom module Acer_Laptop and trying to display a page when following URL is hit:
http://localhost/project/aspire/check/basic

config.xml

<config>
    <modules>
        <Acer_Laptop>
            <version>0.1.0</version>
        </Acer_Laptop>
    </modules>
    <frontend>
    <routers>
           <Acer_Laptop>
                <use>standard</use>
                <args>
                    <module>Acer_Laptop</module>
                    <frontName>aspire</frontName>
               </args>
            </Acer_Laptop>
        </routers>
       <layout>
              <updates>
                  <aspire module="Acer_Laptop">
                      <file>aspire.xml</file>
                  </aspire>
              </updates>
          </layout>
    </frontend>
</config>

I've created a controller

class Acer_Laptop_CheckController extends Mage_Core_Controller_Front_Action
{
    public function basicAction()
    {
        $this->loadLayout();
        $this->renderLayout();
    }
}

a layout file aspire.xml is created as defined:

<?xml version="1.0"?>
<layout>
    <aspire_check_basic>
        <reference name="content">
                <block type="core/template" name="aspire" template="aspire/laptop/check.phtml" />
        </reference>
    </aspire_check_basic>
</layout>

check.phtml template

<?php echo($this->__("Acer Laptop check")); ?>

It only shows header when I go to http://localhost/project/aspire/check/basic. I have tried many tricks to get this work. I want header + the contents of phtml file.

If I change the layout i.e. aspire.xml like below:

<?xml version="1.0"?>
<layout>
    <basic_check>
        <reference name="content">
            <block type="core/template" name="aspire" output="toHtml" template="aspire/laptop/check.phtml"/>
        </reference>
    </basic_check>
</layout>

and in controller instead of $this->loadLayout(); if I use $this->loadLayout('basic_check'); then it shows only the contents of phtml file without the header.

I would really appreciate if someone can help me to fix this.


texts:
I'm trying to center the text in my nav bar (categories).

I've tried text-align and various other options but nothing seems to be working.

My site is www.lifemaxuk.co.uk

Can someone have a look and please help as this is driving me mad!

Thanks


texts: How to Display Vertical mega menu in Magento 2?

texts: I want to display a vertical menu instead of the default horizontal menu for category and subcategory


texts: Magento2 : How to use 3party library files in custom module

texts:
require  BP . '/var/vendor_name/geoip/geoip.inc'; to include file in class.

$data_inc =   BP . '/var/vendor_name/geoip/data/geoip.dat';


texts: When is the setup folder created by Magento?

texts:
Can I gitignore it in a composer based installation?

I tried deleting vendor/ and composer install, but the setup folder was not newly created.

EDIT

It is not happening on each composer install - at least not on every run.

In a fresh project I deleted setup & vendor and called composer install -> setup is created. But in another project it's not.


texts: system settings withing Ui Component Form

texts:
I want to show a certain text (that is set with a configuration setting from system.xml) within my UI component Form.

The UI component is used in the frontend.
Do i provide it with a DataProvider? And if so how?

Does someone has an idea how this is possible?

Thanks!


texts: Create a maximum weight limit on a bundled product

texts:
[CE 1.8] We have a bundled product that contains simple products that can be ordered by the foot (qty 1 = 1 foot). Weight for this bundled product is dynamic; the greater the lengths of the components the customer orders, the higher the bundled product's overall weight will be. We want to be able to prevent a customer from adding a bundle configuration that exceeds a certain weight to their cart with an error message returned along the lines of "Product configuration exceeds weight limit".

We could place a quantity limit on each simple product component of the bundled product, but this will not work for us as the components can be ordered individually as simple products and by themselves would not have the same limit as they would grouped in a bundle where weights of each product would be added together.

How might this be accomplished?


texts:
I'm using Magento 2.1.2
Since I'm not so good with php language, I would like to know if exists any way to update quantities in my catalog reading a file with 2 columns

    SKU      |  Qty
 889588...       3

and do a query like this

UPDATE table_stock SET qty = x WHERE sku = y

If the qty is 0 the product has to be out of stock.

My Idea is to create a php file and update it on the root of magento installation on the server, and run it calling it's path.


texts: Could there be a problem with using a product as an interface for a slideshow?

texts:
My client has a slideshow on their homepage and to make it easy for them to update it, I was thinking of making a slideshow 'product' where they upload the images and enter their corresponding urls as the image labels.

I thought this would be good because the product interface is familiar to them and magento would be aware of the images to cache.

Is there any reason this might be a bad idea other than them mistakenly deleting the product?


texts:
My magento store is throwing this error:

  Fatal error: Cannot instantiate interface Magento\Framework\View\Design\Theme\ResolverInterface in /Library/WebServer/Documents/magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

I don't know why it started to appear. I made no new module installation. The store was working fine.

I've check file permissions and I see no issue there. Also delete the /var/ dir and, I think, all folders/files where created.

[EDIT] The preference is defined vendor/magento/magento2-base/app/etc/di.xml

<preference for="Magento\Framework\View\Design\Theme\ResolverInterface" type="Magento\Theme\Model\Theme\Resolver" />


texts: Where to find Payment Log file in Magento 2?

texts:
I want to check if there is any failed transactions occurred on our site. I'm aware that this detail can get from Payment Log file but for my case, there is no Payment Log file is available under var/log folder.

We are using DIBS payment method. Please let me know where to find the Payment Log file in Magento 2.


texts: Can i use UI-select component in a widget?

texts:
I'm attempting to use the UI-select component for the Category in a widget. I haven't had any luck finding a resource that shows it is possible. My question is if i can use UI-select component as shown in the image below in my widget and if so how to do it.

Note: I have added the UI-select component to ui_component/form.xml but i wanted to show in the widget to give a better user experience.
The code im talking about:
 <field name="category_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Catalog\Ui\Component\Product\Form\Categories\Options</item>
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Category</item>
            <item name="componentType" xsi:type="string">field</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="component" xsi:type="string">Magento_Catalog/js/components/new-category</item>
            <item name="elementTmpl" xsi:type="string">ui/grid/filters/elements/ui-select</item>
            <item name="dataScope" xsi:type="string">category_id</item>
            <item name="filterOptions" xsi:type="boolean">true</item>
            <item name="showCheckbox" xsi:type="boolean">true</item>
            <item name="disableLabel" xsi:type="boolean">true</item>
            <item name="multiple" xsi:type="boolean">true</item>
            <item name="levelsVisibility" xsi:type="number">1</item>
            <item name="sortOrder" xsi:type="number">30</item>
            <item name="required" xsi:type="boolean">true</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">false</item>
            </item>
            <item name="listens" xsi:type="array">
                <item name="${ $.namespace }.${ $.namespace }:responseData" xsi:type="string">setParsed</item>
            </item>
        </item>
    </argument>
</field>


texts: Which Magento 2 core function creates the url for the static folder files including css, js and images

texts:
I want to add a parameter at the end of the static content urls, but i am unable to find a global method where i can make a change and it starts reflecting on the all static content urls.

My file and code where i tried making the changes:

File path: vendor/magento/framework/View/Asset/Repository.php

code that i tried to modify:

public function createAsset($fileId, array $params = [])
    {
        $this->updateDesignParams($params);
        list($module, $filePath) = self::extractModule($fileId);
        if (!$module && $params['module']) {
            $module = $params['module'];
        }

        if (!isset($params['publish'])) {
            $map = $this->getRepositoryFilesMap($fileId, $params);
            if ($map) {
                $params = array_replace($params, $map);
            }
        }

        $isSecure = isset($params['_secure']) ? (bool) $params['_secure'] : null;
        $themePath = isset($params['theme']) ? $params['theme'] : $this->design->getThemePath($params['themeModel']);
        $context = $this->getFallbackContext(
            UrlInterface::URL_TYPE_STATIC,
            $isSecure,
            $params['area'],
            $themePath,
            $params['locale']
        );
        return $this->fileFactory->create(
            [
                'source' => $this->assetSource,
                'context' => $context,
                'filePath' => $filePath."?mytest='value'",
                'module' => $module,
                'contentType' => $this->assetSource->getContentType($filePath)
            ]
        );
    }

Where "?mytest='value'", is my custom parameter that i want to pass globally for all the static files that load from my pub/static folder through web url.

Example relative url that i want to load for all the static content urls: en_US/Magento_Ui/js/lib/knockout/bindings/bootstrap.js?mytest='value'


texts:
this is my file upload code when i try to upload file which has size more than 75mb i can't upload file i did't get any error i also change php.ini file still its not working

$uploader = new Varien_File_Uploader('csvupload');
                    $uploader->setAllowedExtensions(array('csv'));
                    $uploader->setAllowRenameFiles(false);
                    $uploader->setFilesDispersion(false);
                    $path = Mage::getBaseDir('media') . DS . 'uploads';
                    $fname="customer.csv";
                    $uploader->save($path, $fname );
                    $filename = $uploader->getUploadedFileName();

can anybody give solution?


texts: Admin "Create New User" website assignment dropdown is blank

texts:
I just recently tried adding a new user through my Magento admin panel and the "Associate To Website" dropdown is empty.

I checked the core_store table in the database and it is properly populated with the correct options, but for some reason the dropdown is still empty.

I've tried clearing the cache, flushing the cache, re-indexing the entire site, and I've also searched through this community as well as through google for hours now and have seen absolutely nothing like this.

Because of this, I can't add any new users to my Magento store. There is no way for users to sign up on the front end of my site because of the type of website so this is the only way to add new users.

Any help would be appreciated!


texts: How to write mysql update query in magento 2 format?

texts:
In ResourceModel model I need to execute update query.

  $sql = "UPDATE 2067_ci_sessions SET data='$cisess_data' WHERE id= $id";

instead of writing direct mysql query how can i write update query in magento 2 format?. Thanks in advance for your valuable answer

public function clearMlmSession($cisess_data, $cisess_cookie)
{

    $table = "2067_ci_sessions";
    $bind = ['id' => $cisess_cookie];

    //For user information
    //select query
    $connection = $this->getConnection();
    $select = $connection->select()->from(
        $table,
        ['data']
    )->where(
        'id = :id'
    )->limit(
        1
    );
    $cisess_data = $connection->fetchRow($select, $bind);
    //$cisess_data = decode_session_data($cisess_data);
    if (empty($cisess_data)) {
        return false;
    }
    //select query

    //Update Data into table
    $sql = "Update " . $table . " Set data = '$cisess_data' where id = '$cisess_cookie'";
    $result = $connection->exec($sql);
    //$result = $connection->exec($sql);

    print_r($result); die("debug");
}

In this function select working correctly like that i need write update, i wrote my update query directly. how to write this update query in magento 2 format?


texts: Problem : Attribute int type vs varchar for product sorting showing no diffrence

texts:
I have created Custom attribute for product sorting in magento 2.1.1. by Setup>installData.php `namespace Vendor\Module\Setup;
use Magento\Catalog\Model\Product;
use Magento\Catalog\Model\Product\Type;
use Magento\Catalog\Model\Resource\Eav\Attribute;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * EAV setup factory
     *
     * @var EavSetupFactory
     */
    private $eavSetupFactory;
    /**
     * Init
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        /* assign object to class global variable for use in other class methods */
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
         $setup->startSetup();
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        /**
         * Add attributes to the eav/attribute
       */
       $eavSetup->addAttribute(
         \Magento\Catalog\Model\Product::ENTITY,
       'sorting_attribute',
       [
       'type' => 'int',
        'backend' => '',
        'frontend' => '',
        'label' => 'Sorting Attribute',
        'input' => 'text',
        'class' => '',
        'source' => '',
        'global' => 1,
        'visible' => true,
        'required' => false,
        'user_defined' => true,
        'default' => 0,
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => true,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => 'simple,configurable,virtual,bundle,downloadable,grouped',
        'group'=> 'General'
       ]
      );

       $setup->endSetup();
    }
}`

Expected sorting for product
    Product a: custom_attribute = 12,
    Product b: custom_attribute = 42,
    Product c: custom_attribute = 55,
    Product d: custom_attribute = 135,
    Product e: custom_attribute = 325,
    Product f: custom_attribute = 443,
    Product g: custom_attribute = 1134,
    Product h: custom_attribute = 2231

but actually it is sorting as :
  Product a: custom_attribute = 443,
    Product b: custom_attribute = 135,
    Product c: custom_attribute = 325,
    Product d: custom_attribute = 55,
    Product e: custom_attribute = 42,
    Product f: custom_attribute = 1134,
    Product g: custom_attribute = 12,
    Product h: custom_attribute = 2231

After switching with other option and refreshing the page the sorting order gets changed , How it works ??
I tried with varchar type attribute created through admin it was also behaving very similar to the same.


texts: Set limit in add compare product in Magento 2.3.3

texts:
I want to set limits to add compare products in  Magento 2.3.3.
Any user only adds 3 products in the compare list.
Please help me.


texts: magento 2: how to make validation on same name array input

texts:
I want a validation on same name array dynamic input textbox.Because Magento data-validate="{required:true}" is not work on same name so how to validate same name array input validation.I have following html data.How to validate same name in magento 2 ?

<input type="text" name="qty[]" class="input-text" />
<input type="text" name="qty[]" class="input-text" />
<input type="text" name="qty[]" class="input-text" />


texts: Moving layered navigation below product toolbar in layout.xml

texts:
I'm having some issues re-ordering elements within following file:

[MyTheme]/Magento_Catalog/layout/catalog_category_view.xml

I'm trying to move the layered navigation below the product toolbar, above the products grid.

I've tried, the following:

<move element="sidebar.main" destination="category.products.list" after="product_list_toolbar"/>

   <move element="catalog.navigation.renderer" destination="category.products.list" after="product_list_toolbar"/>
    <move element="catalog.leftnav" destination="category.products.list" after="product_list_toolbar"/>
    move element="catalog.navigation.state" destination="category.products.list" after="product_list_toolbar" />

This removes the filter entirely, instead of moving it.

Am I correct to try and move this element within the theme catalog_category_view.xml? Or should this be moved with a custom Layered Navigation module ?

An update on this, i was able to move the layered nav to the top of the page via

 <move element="catalog.leftnav" destination="content" before="category.products"/>

if i set the destination to any more deeply nested blocks the nav just disappears.

I've also tried to move the product toolbar around the layered nav, like so

    <move element="product_list_toolbar" destination="content" before="-"/>

The nav is still appearing above the toolbar though.


texts: My module not displaying header and footer

texts:
This is my module.xml

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

This is my registration.php

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Rk_Wallet',
    __DIR__
);

This is my routes.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="standard">
        <route id="wallet" frontName="rk">
            <module name="Rk_Wallet" />
        </route>
    </router>
</config>

This is my controller file

<?php
namespace Rk\Wallet\Controller\Wallet;

class Wallet extends \Magento\Framework\App\Action\Action
{
  public function __construct(
\Magento\Framework\App\Action\Context $context)
  {
    return parent::__construct($context);
  }

  public function execute()
  {
    $this->_view->loadLayout();
    $this->_view->getLayout()->initMessages();
    $this->_view->renderLayout();
  }
}


texts: Observer not firing if order status changes to complete

texts:
I want to do some action when the order status changes to complete. Here is my code

app/etc/modules/changeorderstatus.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Changeorderstatus_status>
            <active>true</active>
            <codePool>local</codePool>
        </Changeorderstatus_status>
    </modules>
</config>

app/code/local/Changeorderstatus/status/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Changeorderstatus_status>
            <version>1.0</version>
        </Changeorderstatus_status>
    </modules>
    <global>
        <events>
            <sales_order_status_change>
                <observers>
                    <Changeorderstatus_observer>
                        <type>singleton</type>
                        <class>Changeorderstatus_status_Model_Observer</class>
                        <method>implementOrderStatus</method>
                    </Changeorderstatus_observer>
                </observers>
            </sales_order_status_change>
        </events>

    </global>
</config>

app/code/local/Changeorderstatus/status/Model/Observer.php

<?php
class Changeorderstatus_status_Model_Observer
{
    public function implementOrderStatus(Varien_Event_Observer $observer)
    {
        $status = $observer->getEvent()->getOrder()->getStatus();
        $originalData = $observer->getEvent()->getOrder()->getOrigData();
        $previousStatus = $originalData['status'];

        if (($status !== $previousStatus) && ($status == Mage_Sales_Model_Order::STATE_COMPLETE)) {
            exit();
        }
    }
}

If the state of any order changes to complete it should fire automatically.
I changed the order from canceled to completed manually but it is not firing


texts: Magento 2.4.2 : Move existing core block to child block

texts:
I am trying to move page.main.title to child block of my custom block on custom page. I have defined one block in my layout file with template assigned to it. I want to show page title in between the html of this block's template.
So I've added another block inside it and rendered it in the template using <?= $block->getChildHtml('custom.child.block') ?>.

custom_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <block class="Magento\Framework\View\Element\Template" name="custom.block" template="My_Module::parent_template.phtml">
            <block class="Magento\Framework\View\Element\Template" name="custom.child.block" as="custom.child.block"/>
        </block>
        <move element="page.main.title" destination="custom.child.block" before="-"/>
    </body>
</page>

parent_template.phtml

<div class="demo-content">
    <?= $block->getChildHtml('custom.child.block') ?>
</div>

Unfortunately the page title is not getting moved to child block of custom block. However it is being moved to custom block without any issue.
Can you please help me to understand the thing I am trying to do is possible or not. Thanks in advance.


texts: Magento shipping cost equal products weight

texts:
I am looking for solution to create shipping method (or some of them) which will count shipping as (cart weight in lb) * const.
Have such solutions exists already, and if not, then what will the best way to developing it?
It should work on Magento 1.6-1.9


texts: Create multicolored shoe product for customers to design

texts:
We have a webshop with predefined sets of multicolored shoes for customers to order. Recently we obtained the ability to produce these shoes faster. Because we do not want to add every possible color combination our selfs we want to give customers the option to design there own. We already have taken photos from every color shoe and isolated the different colored pieces.
What would be the best way to implement this in magento?
Do we have to write our own code or are there any plugins with this function?


texts: How to display products images on page sales/order/view?

texts:
I'm very new in Magento.
I want to display products images on page sales/order/view. How can I do that?
Anyone can help? Thank you!


texts: Magento 2 disable checkout for certain customers

texts:
I want to disable ability to go from cart to checkout & payment process for certain users having certain attribute, e.g. I want to display them message like You cannot buy any products until you verify your account, how can I achieve it? I want them to be able to add products to cart normally, but add something like grayed out checkout buttons & prevent them from buying anything until their flag is true.

I already tried overwriting block in checkout, and I can gray out and disable frontend possibility for certain customers but I'm looking for way to disable it properly, so they cannot bypass this and checkout via link or something.


texts: Magento 2 Custom Module - Load Subscriber Email in PHTML file after newsletter subscription

texts:
I am working on a custom module where we need to load the email address of a newsletter subscriber in a phtml file after they subscribe.

Our Observer file is triggered on a subscription event and collections the following data:

public function execute(\Magento\Framework\Event\Observer $observer){
    $event = $observer->getEvent();
    $subscriber = $event->getSubscriber();
    $email = $subscriber->getEmail();
    $promoCode = $subscriber->getNpDiscountCode();
    $data = [];
    $inputEmail = $email;
}

Now we need to load $inputEmail in a phtml file and we have yet to file a solution.

Any help would be greatly appreciated!


texts: Rewrite not working CSS not loaded, module enabled

texts:
CSS, scripts not loading, via pub/static/version1496086766/frontend/Magento/, but loading without version: pub/static/frontend/Magento/..
There is .htaccess file with rewrite rule, and  sudo a2enmod rewrite -
Module rewrite already enabled, and I have set AllowOverride:

SSLOptions +StdEnvVars
AllowOverride All

I have set up apache virtual host with webmin.
This problem is coming after migration, I have copied the backup and db to another server. Website is working, but CSS is not loaded.


texts:
Getting error on my dashboard after rollback SQL

Fatal error: Call to a member function getBlockName() on boolean in /home/pataak/public_html/app/code/core/Mage/Captcha/Block/Captcha.php on line 43


texts: how to change programmatically role of user

texts: I need to change the role of user in case the user fills up all the required details from limited to administrator. However I need this to be done programmatically so please guide me the way I can make this possible.


texts: Magento order confirmation emails are not working

texts:
The order confirmation email doesn't work. All other e-mails are sent. The cronjob is working properly, I checked in my database.

Screenshot:

Magento version 1.9.2.0


texts:
Like in magento1 is is there any method to retrive region name by id.

$regionModel = Mage::getModel('directory/region')->load('region_id');
$region = $regionModel->getName();

I checked respective class(Magento\Directory\Model\Region) but didn't find any method there.


texts: How to disable default website in Magento 2.2 multi-store?

texts:
How can I disable the default website in a Magento 2.2 multi-store setup? I have 3 websites with their own store and store views. The main website needs to be taken down. The URL for that main website is also used for the backend admin pages. When I go into the Stores > All Stores > Store View page, the status selection box is grayed out. I understand that maybe the default store view cannot be disabled, but how can I take the website down then, but still have the other websites work?

Thanks


texts: How do I show sub-categories as images for a specified category?

texts:
I'd like to be able to show sub-categories as images for specific categories (cms pages / cms blocks). I do not want categories to appear that do not have images.

I have figured out how to put the root categories on my home page with the following code I dug up and modified. It will only show root categories that have images, those that do not have images will not appear:

file: categorylisting.phtml

<?php $_helper = Mage::helper('catalog/category') ?>
<?php $_categories = $_helper->getStoreCategories() ?>
<?php $currentCategory = Mage::registry('current_category') ?>
<?php if (count($_categories) > 0): ?>

<?php foreach ($_categories as $_category): ?>
<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>

                <a href="<?php echo $this->getCategoryUrl($_category)?>">
                <img src="<?php echo $immagine ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" width="135" height="135" />

                <a href="<?php echo $this->getCategoryUrl($_category)?>"><?php echo $_category->getName()?>

Then on a CMS page I use:

{{block type="catalog/navigation" name="catalog.categories" template="catalog/navigation/categorylisting.phtml"}}

This works great for root categories.

I'd like to show the sub-categories by specifying category X. I'm not sure if there is a variable I could use with the snipped used for the CMS page or CMS block?

What is the best way to display sub-categories of a specified category in a CMS page or CMS block using the above code?


texts: Magento2: How to show product id in checkout order summay

texts:
I tried to include the productId in the checkout summary section but I can't figure how to do that.

if i override the magento/module-checkout/view/frontend/web/template/summary/item/details.html and i add this line:

I receive a strange number, but for sure is not the product id.

Does anyone know how to do that?


texts: Js variable not updating in checkout page in Magento 2

texts:
I have implemented the custom Payment Method which is Payment Terms and it's working fine. Here I'm showing the text under Payment Terms payment method which is populated from the controller, and it's returning the value also.

When I'm debugging the page it's showing values at the same time returning text also showing in payment method, If not debugging it's showing undefined text.

See my screenshots.

If not debugging undefined text showing here.

If debugging values are returning and showing value also see below.

For the above stuff, I have written below code.

ABCSolutions/PaymentTerms/view/frontend/web/js/view/payment/method-renderer/paymentterms-method.js

/*browser:true*/
/*global define*/
define(
    [
        'Magento_Checkout/js/view/payment/default',
        'Magento_Customer/js/customer-data',
        'Magento_Checkout/js/model/quote',
        'jquery',
        'ko'
    ],
    function (Component, customer, quote, $, ko) {
        'use strict';

        var Payment;
        var isLoggedIn = ko.observable(window.isCustomerLoggedIn),
            customerData = {};

        if (isLoggedIn()) {
            customerData = window.customerData;
            //console.log(customerData);
        } else {
            customerData = {};
        }

        return Component.extend({
            customerData: customerData,
            customerDetails: {

            },
            defaults: {
                template: 'ABCSolutions_PaymentTerms/payment/paymentterms'
            },

            /** Returns send check to info */
            getMailingAddress: function() {
                return window.checkoutConfig.payment.checkmo.mailingAddress;
            },

            isDisplayed:function () {

                //console.log(customerData.id);
                var customAttributes = customerData.custom_attributes;
                //console.log(customAttributes);
                var payment_terms_Attribute = customAttributes.payment_terms;
                //console.log(payment_terms_Attribute);
                var paymentTerms = payment_terms_Attribute.value;
                Payment = this.getPaymentTermsCode(customerData.id);

                var availableLimit = "An invoice will be sent to your registered address [ " + Payment + " ]";

                if(paymentTerms != "" && paymentTerms != null){
                    $('#custom_payment_content').text(availableLimit);
                    return true;
                }else{
                    $('#custom_payment_content').text('');
                    return false;
                }
            },

            getPaymentTermsCode:function(parentCustomerId){
                jQuery.post('http://192.168.10.144/abccompany/paymentterms/index/payment', {'parentCustomerId': parentCustomerId}, function(data) {
                    Payment = data;
                });
                return Payment;
            }

        });
    }
);

Controller

<?php
namespace ABCSolutions\PaymentTerms\Controller\Index;

class Payment extends \Magento\Framework\App\Action\Action
{
    /**
     * @var \Magento\Framework\View\Result\PageFactory
     */
    protected $resultPageFactory;

    /**
     * @param \Magento\Framework\App\Action\Context $context
     * @param \Magento\Framework\View\Result\PageFactory resultPageFactory
     */
    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Framework\View\Result\PageFactory $resultPageFactory
    )
    {
        $this->resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    /**
     * Default customer account page
     *
     * @return void
     */
    public function execute()
    {
        $res = "Payment Terms ";
        $res .= $this->getRequest()->getParam('parentCustomerId');
        echo $res;
    }
}

Please suggest me why it is not updating, without debugging?

Anything I went wrong?


texts: Uncaught Error: Mismatched anonymous define() magento 2.2.4

texts:
Below is the console erros is getting in frontend.
Checked .htaccess in pub, pub/static and root all .htaccess are identical to Magento 2.2.4 version.

js bundling/minification is enabled and  ran full deployment command.

Please let me knwo if some faced this issue earlier or have any solution to this.

  require.min.js:16 Uncaught Error: Mismatched anonymous define() module: function($){'use strict';(function(r,G,f,v){var J=f("html"),n=f(r),p=f(G),b=f.fancybox=function(){b.open.apply(this,arguments)},I=navigator.userAgent.match(/msie/i),B=null,s=G.createTouch!==v,t=function(a){return a&&a.hasOwnProperty&&a instanceof f},q=function(a){return a&&"string"===f.type(a)},E=function(a){return q(a)&&0',image:'',iframe:'",error:'The requested content cannot be loaded.Please try again later.',closeBtn:'',next:'',prev:''},openEffect:"fade",openSpeed:250,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:250,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:250,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic",prevSpeed:250,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:!0,title:!0},onCancel:f.noop,beforeLoad:f.noop,afterLoad:f.noop,beforeShow:f.noop,afterShow:f.noop,beforeChange:f.noop,beforeClose:f.noop,afterClose:f.noop},group:{},opts:{},previous:null,coming:null,current:null,isActive:!1,isOpen:!1,isOpened:!1,wrap:null,skin:null,outer:null,inner:null,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(a,d){if(a&&(f.isPlainObject(d)||(d={}),!1!==b.close(!0)))return f.isArray(a)||(a=t(a)?f(a).get():[a]),f.each(a,function(e,c){var k={},g,h,j,m,l;"object"===f.type(c)&&(c.nodeType&&(c=f(c)),t(c)?(k={href:c.data("fancybox-href")||c.attr("href"),title:c.data("fancybox-title")||c.attr("title"),isDom:!0,element:c},f.metadata&&f.extend(!0,k,c.metadata())):k=c);g=d.href||k.href||(q(c)?c:null);h=d.title!==v?d.title:k.title||"";m=(j=d.content||k.content)?"html":d.type||k.type;!m&&k.isDom&&(m=c.data("fancybox-type"),m||(m=(m=c.prop("class").match(/fancybox.(\w+)/))?m[1]:null));q(g)&&(m||(b.isImage(g)?m="image":b.isSWF(g)?m="swf":"#"===g.charAt(0)?m="inline":q(c)&&(m="html",j=c)),"ajax"===m&&(l=g.split(/\s+/,2),g=l.shift(),l=l.shift()));j||("inline"===m?g?j=f(q(g)?g.replace(/.*(?=#[^\s]+$)/,""):g):k.isDom&&(j=c):"html"===m?j=g:!m&&(!g&&k.isDom)&&(m="inline",j=c));f.extend(k,{href:g,type:m,content:j,title:h,selector:l});a[e]=k}),b.opts=f.extend(!0,{},b.defaults,d),d.keys!==v&&(b.opts.keys=d.keys?f.extend({},b.defaults.keys,d.keys):!1),b.group=a,b._start(b.opts.index)},cancel:function(){var a=b.coming;a&&!1!==b.trigger("onCancel")&&(b.hideLoading(),b.ajaxLoad&&b.ajaxLoad.abort(),b.ajaxLoad=null,b.imgPreload&&(b.imgPreload.onload=b.imgPreload.onerror=null),a.wrap&&a.wrap.stop(!0,!0).trigger("onReset").remove(),b.coming=null,b.current||b._afterZoomOut(a))},close:function(a){b.cancel();!1!==b.trigger("beforeClose")&&(b.unbindEvents(),b.isActive&&(!b.isOpen||!0===a?(f(".fancybox-wrap").stop(!0).trigger("onReset").remove(),b._afterZoomOut()):(b.isOpen=b.isOpened=!1,b.isClosing=!0,f(".fancybox-item, .fancybox-nav").remove(),b.wrap.stop(!0,!0).removeClass("fancybox-opened"),b.transitionsb.current.closeMethod)))},play:function(a){var d=function(){clearTimeout(b.player.timer)},e=function(){d();b.current&&b.player.isActive&&(b.player.timer=setTimeout(b.next,b.current.playSpeed))},c=function(){d();p.unbind(".player");b.player.isActive=!1;b.trigger("onPlayEnd")};if(!0===a||!b.player.isActive&&!1!==a){if(b.current&&(b.current.loop||b.current.index


texts: Apply custom function to magento Admin edit form

texts:
I have made custom module in admin for add/edit and delete.

For a particular field (example email ) in the edit form, I want to show HTML instead of an edit input field.

For example, I am saving values in the database for column email as a@a.com,b@b.com.

When a user edits that form I want to show custom HTML like below

    EMail

    a@ac.om

    b@b.com

for applying the custom function to edit field where should I do changes, below is code of Main.php

Vendor/Magento/Block/Adminhtml/Trulookadmin/Edit/Tab/Main.php

protected function _prepareForm()
{
    /* @var $model \Obl\Trulookadmin\Model\BlogPosts */
    $model = $this->_coreRegistry->registry('formadmin');

    $isElementDisabled = false;

    /** @var \Magento\Framework\Data\Form $form */
    $form = $this->_formFactory->create();

    $form->setHtmlIdPrefix('page_');

    $fieldset = $form->addFieldset('base_fieldset', ['legend' => __('Item Information')]);

    if ($model->getId()) {
        $fieldset->addField('id', 'hidden', ['name' => 'id']);
    }

    $fieldset->addField(
        'email',
        'text',
        [
            'name' => 'email',
            'label' => __('EMail'),
            'title' => __('EMail'),

            'disabled' => true
        ]
    );


texts: configurable product don't show the discount

texts:
Simple products with configurable products linked to it, only show the special price as the price and not as discount compared the old price

Somehow an idea?


texts: Problem with condition types in the Magento 2 REST API

texts:
I'm trying to use the REST API in Magento 2 to get orders created after a certain date. But it seems as though everytime I try to use any condition other than "eq", it fails with the following error message:

{
    "message": "Notice: Array to string conversion in /var/www/html/magento/vendor/magento/framework/Reflection/TypeCaster.php on line 34",
    "trace": "#0 /var/www/html/magento/vendor/magento/framework/Reflection/TypeCaster.php(34): Magento\\Framework\\App\\ErrorHandler->handler(8, 'Array to string...', '/var/www/html/m...', 34, Array)\n#1 /var/www/html/magento/vendor/magento/framework/Reflection/DataObjectProcessor.php(115): Magento\\Framework\\Reflection\\TypeCaster->castValueToType(Array, 'string')\n#2 /var/www/html/magento/vendor/magento/framework/Reflection/DataObjectProcessor.php(107): Magento\\Framework\\Reflection\\DataObjectProcessor->buildOutputDataArray(Object(Magento\\Sales\\Model\\Order\\Payment), '\\Magento\\Sales\\...')\n#3 /var/www/html/magento/vendor/magento/framework/Reflection/DataObjectProcessor.php(113): Magento\\Framework\\Reflection\\DataObjectProcessor->buildOutputDataArray(Object(Magento\\Sales\\Model\\Order), '\\Magento\\Sales\\...')\n#4 /var/www/html/magento/vendor/magento/framework/Webapi/ServiceOutputProcessor.php(107): Magento\\Framework\\Reflection\\DataObjectProcessor->buildOutputDataArray(Object(Magento\\Sales\\Model\\ResourceModel\\Order\\Collection), '\\Magento\\Sales\\...')\n#5 /var/www/html/magento/vendor/magento/framework/Webapi/ServiceOutputProcessor.php(59): Magento\\Framework\\Webapi\\ServiceOutputProcessor->convertValue(Object(Magento\\Sales\\Model\\ResourceModel\\Order\\Collection), '\\Magento\\Sales\\...')\n#6 /var/www/html/magento/vendor/magento/module-webapi/Controller/Rest.php(270): Magento\\Framework\\Webapi\\ServiceOutputProcessor->process(Object(Magento\\Sales\\Model\\ResourceModel\\Order\\Collection), 'Magento\\Sales\\A...', 'getList')\n#7 /var/www/html/magento/vendor/magento/module-webapi/Controller/Rest.php(160): Magento\\Webapi\\Controller\\Rest->processApiRequest()\n#8 /var/www/html/magento/var/generation/Magento/Webapi/Controller/Rest/Interceptor.php(24): Magento\\Webapi\\Controller\\Rest->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#9 /var/www/html/magento/vendor/magento/framework/App/Http.php(115): Magento\\Webapi\\Controller\\Rest\\Interceptor->dispatch(Object(Magento\\Framework\\App\\Request\\Http))\n#10 /var/www/html/magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\\Framework\\App\\Http->launch()\n#11 /var/www/html/magento/index.php(39): Magento\\Framework\\App\\Bootstrap->run(Object(Magento\\Framework\\App\\Http))\n#12 {main}"
}

And I've tried to do other conditions and fields, like getting every order with a grand_total greater than 100 (i.e. "gt" and "100") but that fails with the same error message. If I do a regular "eq" condition type, then it works.

Can anyone help me understand what I'm doing wrong? Let me know if I need to clarify my question with more examples or something.

Edit: It seems whenever the order API returns more than one item, this error occurs.

Edit 2: This is the request I'm trying to make: /rest/V1/orders?searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bfield%5D=grand_total&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bvalue%5D=80&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B0%5D%5Bcondition_type%5D=gt&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bfield%5D=grand_total&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bvalue%5D=90&searchCriteria%5Bfilter_groups%5D%5B0%5D%5Bfilters%5D%5B1%5D%5Bcondition_type%5D=lt. It's the built in REST interface, so nothing custom built. To add some context, if I do the exact same request against the invoices endpoint instead, I get the correct results (though invoices instead of orders, naturally).


texts: Magento2.3 - How to add grouped product in cart using REST API?

texts: Currently i am using Magento2.3.5. I checked documentation 2.3, there is no statement like grouped product in it.. So any one tell me how can we add grouped product in cart using magento rest api?


texts:
Overriding Magento\Catalog\Model\Layer class not working in Magento 2.

I'm trying to create a custom module for showing custom product collection with layered navigation.

here i added di.xml file to overwrite model using preference.

But its not working, i tried to create log also, no log generated.

\app\code\Mage\Search\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">
   <preference for="Magento\Catalog\Model\Layer" type="Mage\Search\Model\Layer" />
</config>

Layer.php

namespace Mage\Search\Model;

class Layer extends \Magento\Catalog\Model\Layer
{

   public function getProductCollection()
    {
        /*added log here*/
        var_dump('test'); // nothing showed.
        die(); // this also not helped
        if (isset($this->_productCollections[$this->getCurrentCategory()->getId()])) {
            $collection = $this->_productCollections[$this->getCurrentCategory()->getId()];
        } else {
            $collection = $this->collectionProvider->getCollection($this->getCurrentCategory());
            $this->prepareProductCollection($collection);
            $this->_productCollections[$this->getCurrentCategory()->getId()] = $collection;
        }

        return $collection;
    }

}

Please suggest any solution for this.

Thank you!


texts: manual migration of magento 2 products, done incorrectly

texts: I'm on a project that made the migration from magento 1 to magento 2, and a manual migration of products from magento 1 to magento 2 was made, but after registering many products we realized that they were registered in the opposite in cms , that is, the html code of the products is appearing on the front end in the store, would there be any way to convert in bulk?