texts: Removing totals block from mini cart in Magento2

texts:
I've read this post already, however I'm failing to apply it properly.

I want to remove the totals section from the mini-cart. To track down the block I've enabled path hints.

So it seems the block of interest is Magento\Checkout\Block\Cart\Totals and the template of interest is vendor/magento/module-checkout/view/frontend/templates/cart/totals.phtml. Searching the code I found this line

<block class="Magento\Checkout\Block\Cart\Totals" name="checkout.cart.totals" template="cart/totals.phtml">

in vendor/magento/module-checkout/view/frontend/layout/checkout_cart_index.xml. So in my custom module trying to remove it, I've created this file vendor/my-module/view/frontend/layout/checkout_cart_index.xml which looks like this

<?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>
        <referenceBlock name="checkout.cart.totals" remove="true" />
    </body>
</page>

That doesn't remove the totals section, however I feel like I'm on the right track because two exercises succeed in my attempt

Editing vendor/magento/module-checkout/view/frontend/layout/checkout_cart_index.xml and removing the declaration for the Magento\Checkout\Block\Cart\Totals block
Editing vendor/magento/module-checkout/view/frontend/templates/cart/totals.phtml and removing cart-totals div.

So I seem to be working with the correct block and template, but my layout update doesn't work; any idea why? Note, caching is disabled.


texts: Magento Catalog Search - option to change like "OR" to like "AND"

texts:
I´m currently working on a search extension for Magento.
I´m fairly new to the Magento framework, but I have found a serious feature lack in regards to the Catalog Search.

In Magento admin you can choose what type of search you need, e.g. "LIKE", "FULLTEXT" or "COMBINE".

When it comes to "LIKE" and "COMBINE" in both cases the search query LIKE operator is set as "OR", which in many cases give very inaccurate search results when performing multi-word searching.

As an example if you search for "windows 10" in a software shop you will get alot of unwanted results.

In my view the default operator for "LIKE" search should be "AND" instead of "OR" because in most cases, as in the example above, we want to find products containing both "windows" and "10" when searching "windows 10", and if the shop holds thousands of products it becomes a critical flaw.

I could overwrite the search model in my module, or simply create my own search query from scratch, but that is hardly optimal, if I want my module to adhere to the core Magento framework.

The optimal solution would be if the Magento developer staff would modify the search model function:

prepareResult($object, $queryText, $query)

Located at line 334 in file (Magento ver. 1.9.2.1):

/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php

And implement a select option in Magento admin config so that shop owner can choose "OR" or "AND" for LIKE and COMBINE search types, and have "AND" be default setting.

I strongly urge anyone in the Magento developer community to take this into consideration.

As it is right now I am forced to supply a guide to my customers on how to manually change the search model via FTP, if they want their "LIKE"/"COMBINE" search with "AND" operator.


texts: Magento 2 Mageplaza LayeredNavigation filter condition AND instead of OR for multiselect

texts:
I am working on a site that uses Mageplaza Layered Navigation in Porto Theme.

I need to change the behavior of multiselect from OR to AND.

As an example, I create attribute color. When I search for blue and red, it should only show products that are blue AND red.

Multiselect is correctly set, the only problem is to change the code - I cannot find where should I change.


texts: How to assess if a Magento Developer has the skill to find his way around Magento?

texts:
What kind of questions would be relevant and appropriate when hiring a Magento Developer?

The basics aspects should be covered first: clear idea about how internet works (browser, web servers, web arhitecture in general), programming and analytical thinking.

Regarding Magento I believe it's more important to understand how to find your way around Magento, then knowing by heart how you should do things.
Have a clear idea about how Magento is architected and have this skill (I believe it can be called a skill) to find the things you need.

What are your thoughts on this? How would you test that a developer knows his way around Magento?
I was mislead a few times by asking specific questions and getting the expected answers.


texts: ERROR: PHP Extensions "0" must be loaded.


texts: Magento 2 - Estimate shipping costs block on homepage

texts:
I am trying to include the Estimate shipping costs block on my homepage.

In my layout file (cms_index_index.xml) I have the following:

<?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">
    <body>
        <referenceContainer name="page.bottom.container">
            <block class="Magento\Checkout\Block\Cart\Shipping" name="checkout.cart.shipping" as="shipping" template="Magento_Checkout::cart/shipping.phtml"/>
        </referenceContainer>
    </body>
</page>

But this only includes the first line of text then nothing else. There are no errors in the console.

Any ideas? Thanks.


texts: Magento2: Stop user registration email notification to customer programmatically

texts:
I want stop email notification for user registration(createuser) programmatically.

We can use plugin, observer, extend createpost controller.
Can anyone please suggest which way is standard to do this programmatically.

I have my custom controller and one is default createpost.
I have to set condition if user comes here from my custom controller then stop email and if customer comes from default controller named createpost then email work as it is.

Here I created plugin for this.

  app\code\My\Module\etc\frontend\di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="\Magento\Customer\Model\EmailNotification">
    <plugin name="disable-email-notification" type="My\Module\Model\Plugin\EmailNotification" sortOrder="1"/>
</type>
</config>

  app\code\My\Module\Model\Plugin\EmailNotification.php

<?php
namespace My\Module\Model\Plugin;

class EmailNotification
{
    public function aroundNewAccount(
    \Magento\Customer\Model\EmailNotification $subject,
    \Closure $proceed
    )
    {
        return $subject
    }
}
?>


texts: Magento 2 how to show background shadow while open menu?

texts:
**
like this reference website https://www.colorland.com/uk/ when we click on menu its showing shadow background black on body. i have tried with custom JavaScript i have applied custom JavaScript for call class with body but its not working if someone have related to my requirement please share.**

** please check code of my navigation **

        <?php if($Homelink){ ?>

<a href="<?php echo $this->getUrl('') ?>" class="level-top ui-corner-all">Home

        <?php } ?>

        <?php /* @escapeNotVerified */ echo $_menu; ?>

        <?php

        if($customMenuStatus){

            $customMenuName = $_menuhelper->getCustomBlockName();

            $customMenuId = $_menuhelper->getCustomBlockId();

            $customMenuUrl = $_menuhelper->getCustomBlockUrl();

        ?>

<a href="<?php echo $customMenuUrl; ?>" class="level-top ui-corner-all"><?php echo $customMenuName; ?>

            <?php   if($customMenuId) { ?>

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

            <?php } ?>

        <?php } ?>

<?php  } else {  ?>

        <?php /* @escapeNotVerified */ echo $_menu; ?>

<?php } ?>

        <?php /* @escapeNotVerified */ echo $_menu; ?>

```


texts: How can I get full path URL for configuration image field?

texts:
Check below code which I have used for upload image in configuration.

<field id="icon" translate="label comment" type="image" sortOrder="150" showInDefault="1" showInWebsite="1" showInStore="1">
    <label>Icon</label>
    <backend_model>Magento\Config\Model\Config\Backend\Image</backend_model>
    <upload_dir config="system/filesystem/media" scope_info="1">{vender_name}/{module_name}/icon</upload_dir>
    <base_url type="media" scope_info="1">{vender_name>/{module_name}/icon</base_url>
</field>

But when I try to retrieve image URL based on below code, It's getting only default/image_name.ext

$this->scopeConfig->getValue("<section>/<group>/icon", \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

How can I get full path of image URL?


texts: How to add custom less file for particular page (product listing page)

texts:
I am building a custom theme in Magento and Luma theme is my parent theme. I am trying to customize the product listing page with my own style.

Here is what I did

I copied list.phtml from module catalog and place it under my theme Magento_Catalog/templates/product/list.phtml
Add _module.less file under Magento_Catalog/web/css/source/ to extend the luma product listing page
When I try to run the static deploy commanded, I get below error

  [Magento\Framework\Exception\FileSystemException]

  Cannot read contents from file
  "/Users/georgemm/Sites/magento2/pub/static/f
  rontend/George/ultimate/en_US/css/styles-m.css"
  Warning!file_get_contents(/
  Users/georgemm/Sites/magento2/pub/static/frontend/George/ultimate/en_US/css

  /styles-m.css): failed to open stream: No such file or directory

Can you please help how to extend less file for particular page


texts:
I want to create a table with one default row.

i.e. I have two attributes. How to create table with (1,1) entry by default using Install Schema?


texts: Add image to prgrammatically added product

texts:
Client requires that I create an external page to add product. Got the below code online and it's working, only that the product image is not showing after adding product successfully.

Images have been uploaded to pub/media/catalog/product/ directory

use \Magento\Framework\App\Bootstrap;
    include('app/bootstrap.php');

// add bootstrap
$bootstraps = Bootstrap::create(BP, $_SERVER);
$object_Manager = $bootstraps->getObjectManager();

$app_state = $object_Manager->get('\Magento\Framework\App\State');
$app_state->setAreaCode('frontend');

// get date
$today_date = date("m/d/Y");
$added_date = date('m/d/Y',strtotime("+17 day"));

$set_product = $object_Manager->create('\Magento\Catalog\Model\Product');

try{
    $set_product->setWebsiteIds(array(1));
    $set_product->setAttributeSetId(4);
    $set_product->setTypeId('simple');
    $set_product->setCreatedAt(strtotime('now'));
    // time of product creation
    $set_product->setName($product_name);
    // add Name of Product
    $set_product->setSku($product_sku);
    // add sku hear
//    $set_product->setWeight(3.6700);
    // add weight of product
    $set_product->setStatus(1);
    $category_id= array(1,2);
    // add your catagory id
    $set_product->setCategoryIds($category_id);
    // Product Category
    $set_product->setTaxClassId(0);
    // type of tax class
    // (0 - none, 1 - default, 2 - taxable, 4 - shipping)
    $set_product->setVisibility(4);
    // catalog and search visibility
    $set_product->setNewsFromDate($today_date);
    // product set as new from
    $set_product->setNewsToDate($added_date);
    // add image path hear
    $set_product->setPrice($product_price) ;
    // price in form 100.99
//    $set_product->setCost(33116.33);
    // price in form 88.33
//    $set_product->setSpecialPrice(33004.85);
    // special price in form 99.85
//    $set_product->setSpecialFromDate('06/1/2017');
    // special price from (MM-DD-YYYY)
//    $set_product->setSpecialToDate('07/30/2017');
    // special price to (MM-DD-YYYY)
//    $set_product->setMsrpEnabled(1);
    // enable MAP
    $set_product->setMsrpDisplayActualPriceType(1);
    // display actual price
    // (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)
    $set_product->setMetaTitle($product_name);
    $set_product->setMetaKeyword($product_keywords);
    $set_product->setMetaDescription($product_short_desc);
    $set_product->setDescription($product_long_desc);
    $set_product->setShortDescription($product_short_desc);

    $set_product->setStockData(
        array(
        'use_config_manage_stock' => 0,
        // checkbox for 'Use config settings'
        'manage_stock' => 1, // manage stock
        'min_sale_qty' => 1, // Shopping Cart Minimum Qty Allowed
        'max_sale_qty' => 2, // Shopping Cart Maximum Qty Allowed
        'is_in_stock' => 0, // Stock Availability of product
        'qty' => $product_quantity // qty of product
        )
    );
     //add image to product
    $set_product ->setImage("'/test.jpg");
    $set_product ->setSmallImage("/".$product_photo);
    $set_product ->setThumbnail("/".$product_photo);

  $set_product->save();

   $get_product_id = $set_product->getId();

                echo '

                    Done! Product Upload successful

';
}
catch(Exception $exception)
{
    echo 'Product upload failed!';
}

What am i doing wrong please? Running Magento 2.1.x


texts:
I'm running a Magento 1.9 store and have just installed the IWD One Page Checkout extension. Everything works fine except one little kink...

The payment method names show up double
example:

  payment with Visa => VisaVisa

Does anyone have an idea where I can find this little bug?

If I've forgot to add important info let me know and I'll elaborate...

Update:

We have reduced the conflict between IWD and MSP plugin (Multisafepay payments (plugin free for download)) however a solution has not been found.
Does someone that uses MSP have the same issue or a solution for this problem?


texts: How to add visited pages to magento session?

texts:
I want to add an array of visited pages by a user to magento session, when the user first time visits the page. i have tried this

 $current_page[]= Mage::getSingleton('core/session')->getMyval();
     Mage::getSingleton('core/session')->unsMyval();
      $Current= $this->getPopupBlock();//get current page identifier

       if (in_array($Current, $current_page))
        {
          //do something
        }else
        {
          array_push($current_page, $Current);
        }
       echo "<pre>"; print_r($current_page); echo "</pre>"; //just for debuging
    php Mage::getSingleton('core/session')->setMyval($current_page);

but on every page refresh, i am getting this output

 Array
(
    [0] => Array
        (
            [0] => Array
                (
                    [0] =>
                    [1] => home
                )

            [1] => category
        )

    [1] => category
)

Thanks in advance for you help


texts: Magento 2 get Store Id of a coupon code programmatically

texts:
I am using multiple stores, I wanted to get all the coupon code of a particular store.

In Magento 2 database, salesrule_website table have stores related information, but their is no model/collection to get the data from this table.

Please guide me how to get store information of a coupon code, or I need to create my own model for salesrule_website table.


texts:
I am getting Request Header Or Cookie Too Large error on firefox on login and checkout pages but on chrome its working fine. I know that it can be fixed by removing cookies for that particular website but i want to know whats causing that issue, so it doesn't come up again.
thanks


texts: How to Remove excluding and including TaxMessage from Checkout Cart Summary Section in Magento 2.3.2

texts:
For Reference Check the Screenshot :-

I have tried to override checkout_cart_index.xml inside /app/design/frontend/TemplateMonster/theme007/Magento_Tax/layout/checkout_cart_index.xml

<item name="subtotal" xsi:type="array">
    <item name="component" xsi:type="string">Magento_Tax/js/view/checkout/summary/subtotal</item>
    <item name="config" xsi:type="array">
        <item name="title" xsi:type="string" translate="true">Subtotal</item>
        <item name="template" xsi:type="string">Magento_Tax/checkout/summary/subtotal</item>
        <item name="excludingTaxMessage" xsi:type="string" translate="true"></item>
        <item name="includingTaxMessage" xsi:type="string" translate="true"></item>
    </item>
</item>

and Removed excludingTaxMessage and includingTaxMessage text but it fetchs the text from Core module layout file after removing.

Please Help me...


texts: Can I Copy the whole admin panel to my custom panel or page

texts:
I am new to Magento and I am using the Magento 2, my question is:
Is there any way to copy the whole admin panel or functionalities to my custom panel or page?
suggest me a solution.I want to create a user with admin capabilities but not all features.


texts: Magento 2 - Exception: File can't be read in Magento static content deploy

texts:
Please tell me where is the problem.

I used bin/magento setup:upgrade and bin/magento setup:static-content:deploy en_GB en_US -f


texts:
I want to add custom module's block on the checkout page in the sidebar below all the elements.
How can I do so?
It will be helpful if anyone can guide or provide correct steps or any sample code.


texts: Can't get order object in sales_order_place_after observer method

texts:
I'm trying to hook into the sales_order_place_after method in my observer and save information about the just placed order into a new database table. I'm able to hook into the event successfully, but when I try to access the order object, I keep getting the error User Error: Some transactions have not been committed or rolled back.

This is my config.xml:

  <sales_order_place_after>
    <observers>
      <myaction_save_order>
        <type>singleton</type>
        <class>mymodule/observer</class>
        <method>saveOrderIdToAttendees</method>
      </myaction_save_order>
    </observers>
  </sales_order_place_after>

This works fine. The problem I'm getting is in my observer:

public function saveOrderIdToAttendees($observer) {
    $this->getHelper()->log('Helloooo');

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

    $this->getHelper()->log($order);
}

For some reason I don't even have access to the getEvent() method. I've tried logging just the $observer->getEvent() object and that gives me the same error.


texts: Few records are created on my database table unconsciously

texts:
Yeah our website has so many problems because we customized our website excessively. So a few of records on table were created/removed while I don't aware of it.

I tried to add Time Stamp column on some tables under this issue. But some fatal errors came out after adding Time Stamp. Because I just create column without setting on either foreign key or primary key.

This is one of the error messages I faced.

  An error occurred while saving this profile.SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (kbethos_wh.jet_profile_products, CONSTRAINT FK_JET_PROFILE_PRDS_PRD_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY (product_id) REFERENCES catalog_product_entity (entity_id) ON DELETE CASCADE), query was: INSERT INTO jet_profile_products (profile_id, product_id) VALUES (?, ?) File:/home/kbethos/public_html/wh/lib/Zend/Db/Statement/Pdo.php Line: 235

My question is without any problem, I want to add time stamp column because I would like to know when they are created by whom or some codes I haven't noticed.

I used this code to add time stamp column before

  ALTER TABLE catalog_eav_attribute ADD lastUpdated TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ;


texts: How to keep the mobile menu open when loaded for the first time Magento 2?

texts: I want to keep the mobile menu open when the website is loaded for the first time magento2. After that, it should work as the default on open close by click. Can anyone suggest to me?


texts:
I have some code that I'm using to show Categories and Sub-Categories in my Magento webstore. Currently, each category is listed with the amount of products within that category displayed. Eg:

Shop (parent category)

Category 1 (12)
Category 2 (3)
Category 3 (0)
Category 4 (50)

The issue I'm having is that the product amounts when in the 'Shop' category are all correct. However, when I visit a child category (EG. Category 2), the product amounts now show all the disabled products as well. EG:

Shop (parent category)

Category 1 (16)
Category 2 (5)
Category 3 (1)
Category 4 (52)

The code I am using for the sidebar category list is as follows:

    Categories

<?php echo $this->__('Shop') ?>

            <?php foreach ($_categories as $_category): ?>
                <?php if($_category->getIsActive()): ?>

                    <a href="<?php echo $this->getCategoryUrl($_category) ?>"<?php if ($this->isCategoryActive($_category)): ?> class="current"<?php endif; ?>><?php echo $this->escapeHtml($_category->getName()) ?> (<?php echo $_category->getProductCount() ?>)

                <?php endif; ?>
            <?php endforeach ?>

Any help on this issue would be greatly appreciated!


texts: Adding an optional cost after choosing a shipping method

texts:
I'm trying to add an optional cost after the customer choose the GLS shipping method: he can choose to be notified by SMS about the status of his order paying a fixed cost. There's an existing plugin or Have you got suggestions on how to do so?

Thank you in advance!


texts: How to redirect to controller action from phtml?

texts:
I have one phtml.

In there i m check one variable if that variable is null than it should be redirect to Controller action

I m trying this code:

Mage::app()->getResponse()->setRedirect(Mage::getBaseUrl().'marketplace/vendor/selectcategory');

but using this code if variable is not null than also redirect but i don't want this. I need to redirect when variable is null


texts: Add a field in `admin > system > configuration Sales`

texts: How can I add a field in admin panel > system > configuration > Sales ?


texts: Combine Magento TAF with EcomDev_PHPUnit fixtures

texts:
I want to use the Magento Test Automation Framework to create a Smoke Test Suite, i.e. a test suite that quickly tests a cross section of the store to check for serious errors, not to test the correct behaviour of all features.

The included test suite does not serve this purpose well, it tests the shop very thoroughly and creates test data for each test by foot in the backend (which takes way too much time).

Writing custom tests for my test suite is not a problem, but I also would like to optimize the creation of test data.

My tests will run on the same machine as the SUT, so it seems natural to create a test fixture directly in the database instead of using Selenium. Now my question is: Is there a clean way to integrate the fixture system of EcomDev_PHPUnit into TAF?

The problem is that the fixture is coupled to EcomDev_PHPUnit_Test_Case and the TAF tests have to extend Mage_Selenium_TestCase. I would like to use EcomDev_PHPUnit_Model_Fixture as a standalone component, is that possible? Or are there better ways to create database fixtures for a TAF test suite?


texts: Nexcess Turpentine: Applying VCL on Configuration Save

texts:
The Nexcess Turpentine extension for Magento offers a number of features for implementing a varnish configuration on your Magento system.  One of those features is the ability to, automatically, apply a new VCL configuration file to a running varnish instance when the System -> Configuration values change.

Question: When the Nexcess_Turpentine extension does this -- does it save the generated VCL out to disk anywhere?

I know you can save the varnish configuration on the Cache Management page -- I'm specifically interested if the automatic config application also saves out the file.


texts: Magento foreign key constrain... do I need to commit transaction first?

texts:
Please have a look at my function which deletes certain products and attributes.

If I recreate the same attributes in the same function, I get this foreign key constrain error.

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a
child row: a foreign key constraint fails (`nova-
computers`.`catalog_product_entity_int`

I think I need to commit the delete transaction, but i'm not sure what code
im missing.

public function reset_attr_products($productcode, $icecat_category)
{
    umask(0);
    Mage::app();
    Mage::register('isSecureArea', 1);

    #####################################################
    #############  PRODUCTS #############################
    #####################################################
    $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
    try {
        $connection->beginTransaction();

        $product = Mage::getModel('catalog/product')->loadByAttribute('sku', $productcode);
        if ($product) {
            $product->delete();
        }
        Mage::getModel('catalog/product')->save();

        $connection->commit();
    } catch (Exception $e) {
        $connection->rollback();
    }

    #####################################################
    #############  Attributes ###########################
    #####################################################
    $attributecode_starting = $icecat_category."_";

    $attributes = Mage::getResourceModel('catalog/product_attribute_collection')
        ->getItems();

    foreach ($attributes as $attribute) {
        $attributecode = $attribute->getAttributecode();

        if (strpos($attributecode, $attributecode_starting) === 0) {
            $connection = Mage::getSingleton('core/resource')->getConnection('core_write');
            try {
                $connection->beginTransaction();

                $model = Mage::getResourceModel('catalog/setup', 'catalog_setup');
                $model->startSetup();
                // Make saves and other actions that affect the database
                $model->removeAttribute('catalog_product', $attributecode);
                $model->endSetup();

                $connection->commit();
            } catch (Exception $e) {
                $connection->rollback();
            }
        }
    }

    Mage::unregister('isSecureArea');
}


texts: How to Delete All Products Within a Category

texts:
Main Question

How can I delete all products within a specific category?

Detailed Version: My goal is to remove the products and product images completely from my store inventory. I plan to use the products' category as a way to target the products for removal.

Secondary Questions

Built Into Magento? Does Magento offer this feature within the control panel?

Third-Party GUI? Does a third-party GUI for this feature exist?

Third-Party Script? Does a third-party script for this feature exist?

What I've Found

I found a third-party PHP script, that could be a solution. But the blog post was published in 2011, so I don't know if the PHP script will work with the current 1.9 series, of the Magento Community Edition.

This is the third-party PHP script I found:
https://oldwildissue.wordpress.com/2011/11/21/delete-all-the-products-in-a-given-category-via-php/


texts: how can I implement the back button in magento?

texts:
I want to implement a "back button" which will takes the user to the previous page on clicking.
Then the page before that, then the page before that and so on.
So far I have done something like this..

<?php
      $url = Mage::app()->getRequest()->getServer('HTTP_REFERER');
      if ((strpos($url, Mage::app()->getStore()->getBaseUrl()) !== 0) && (strpos($url, Mage::app()->getStore()->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK, true)) !== 0)) {
      $url = Mage::app()->getStore()->getBaseUrl();
}
?>

<a href="<?php echo $url; ?>">Back to ...

but it just going back to the one recent previous page only.
What are the other possible methods for this problem ?


texts:
I have several thousands of items that are currently disabled. I'm now trying to delete them via the Catalog > Products page but I get an error message for some of the products.
I cannot make any changes to these products. Even just saving the part I get a 'No Such Entity' message.
I have manually whittled the list of parts from over 10000 to about 1300 and I get an error if I try to do anything with them.
I am on Magento version 2.2.6.
I'm a newbie on here and with Magento 2 so any help would be greatly appreciated.

Error message when using the catalog page to try and delete the part.
1 exception(s):
Exception #0 (Magento\Framework\Exception\StateException): Unable to remove product EVBCONCEWHC3

Exception #0 (Magento\Framework\Exception\StateException): Unable to remove product EVBCONCEWHC3
#0 /var/www/vhosts/toolstoyou.com/httpdocs/generated/code/Magento/Catalog/Model/ProductRepository/Interceptor.php(63):


texts: How to add filter to a already working custom sales order grid column module?

texts:
I have the following from another post, and now I'm looking for a way to make these 4 extra columns filterable.
Thank you,
\app\code\Vendor\SalesOrderGrid\Ui\Component\Listing\Column\Address.php
    <?php

    namespace Vendor\SalesOrderGrid\Ui\Component\Listing\Column;

    use Magento\Sales\Api\OrderRepositoryInterface;
    use Magento\Ui\Component\Listing\Columns\Column;
    use Magento\Framework\View\Element\UiComponent\ContextInterface;
    use Magento\Framework\View\Element\UiComponentFactory;

    /**
     * Class Address
     */
    class Address extends Column
    {
    /**
    * @var OrderRepositoryInterface
    */
private $orderRepository;

/**
 * Address constructor.
 * @param ContextInterface $context
 * @param UiComponentFactory $uiComponentFactory
 * @param OrderRepositoryInterface $orderRepository
 * @param array $components
 * @param array $data
 */
public function __construct(
    ContextInterface $context,
    UiComponentFactory $uiComponentFactory,
    OrderRepositoryInterface $orderRepository,
    array $components = [],
    array $data = []
) {
    $this->orderRepository = $orderRepository;
    parent::__construct($context, $uiComponentFactory, $components, $data);
}

/**
 * Prepare Data Source
 *
 * @param array $dataSource
 * @return array
 */
public function prepareDataSource(array $dataSource)
{
    if (isset($dataSource['data']['items'])) {
        foreach ($dataSource['data']['items'] as & $item) {
            $column = $this->getData('name');
            $orderId = $item['entity_id'];
            $order = $this->orderRepository->get($orderId);

            if ($column == 'street') {
                $streetArr = $order->getShippingAddress()->getStreet();
                $data = implode(',', $streetArr);
            } elseif ($column == 'zip') {
                $data = $order->getShippingAddress()->getPostcode();
            } elseif ($column == 'city') {
                $data = $order->getShippingAddress()->getCity();
            } elseif ($column == 'phone') {
                $data = $order->getShippingAddress()->getTelephone();
            }

            $item[$this->getData('name')] = $data;
        }
    }

    return $dataSource;
    }
    }

\app\code\Vendor\SalesOrderGrid\view\adminhtml\ui_component\sales_order_grid.xml
    <column name="street" class="Vendor\SalesOrderGrid\Ui\Component\Listing\Column\Address">
        <settings>
            <filter>text</filter>
            Street
            <bodyTmpl>ui/grid/cells/html</bodyTmpl>
            <visible>true</visible>
        </settings>
    </column>

    <column name="zip" class="Vendor\SalesOrderGrid\Ui\Component\Listing\Column\Address">
        <settings>
            <filter>text</filter>
            Zip
            <bodyTmpl>ui/grid/cells/html</bodyTmpl>
            <visible>true</visible>
        </settings>
    </column>

    <column name="city" class="Vendor\SalesOrderGrid\Ui\Component\Listing\Column\Address">
        <settings>
            <filter>text</filter>
            City
            <bodyTmpl>ui/grid/cells/html</bodyTmpl>
            <visible>true</visible>
        </settings>
    </column>

    <column name="phone" class="Vendor\SalesOrderGrid\Ui\Component\Listing\Column\Address">
        <settings>
            <filter>text</filter>
            Phone
            <bodyTmpl>ui/grid/cells/html</bodyTmpl>
            <visible>true</visible>
        </settings>
    </column>


texts: The "--remote-storage-driver" option does not exist Magento 2.4.1

texts:
I'm trying to set AWS S3 to storage magento media, but when I follow the tutorial in official Magento Page here the bin/magento  setup:install --remote-storage-driver=aws-s3 an error shows in terminal:
The --remote-storage-driver option does not exist
Some help?
Tks!


texts: 2 Themes in 1 Magento install - How to work on non live theme and view changes

texts:
I have a Magento store and i want to change the template. I want to install a 2nd template and be able to work on this 2nd template and be able to view my changes on the front end without customers seeing it. Is there any way of doing this?

Magento 1.9.x


texts: Magento 2 Gateway timeout how to resolve

texts:
I have a website on Magento 2 and when I try to access the website, it's really slow and it can take up to 2 minutes to charge a page. When I try to access the admin, either it's really slow like on the website or I get the error
504 Gateway Time-out

I don't know how to fix it. It seems to be related with varnish but I didn't find anything on the net, I couldn't find the files they talked about.
Thanks for your help
Edit: When I try to access my website, I immediately get the home page with every element on it, but it keeps loading for 30 seconds.


texts:
I have Magento (CE1.9.2.4) store with 30K products. I use Magmi to import products from a csv datafeed everyday. The product images are provided in more than one sizes (200x200 to 2500x2500) by my suppliers. Some of the products have multiple images/photos taken from different angles. I have been using the images with the best quality. But this causes a disk space problem.

I tried to find an image compressor / optimiser. I tested jpegtran but the compression has been less than 1% over 50K image files.

I have 2 questions:

90% of my disk is full right now. I need to take a quick action. I'd like to import the images with less quality in order to free up some space on my servers disk. Those images have different URLs. What if I change the product image URLs (image, small_image, thumbnail) in my magmi import table?

is it going to overwrite the existing image files
or is it going to create new ones on the disk? What will happen to the previous product images? Do I need to delete them manually?

Do you have a different suggestion to compress those images?


texts: I am new to using Magento other than basic data entry but I cannot figure out how to change the header logo on my current magento skin.  I even tried to do it on the cpanel with no success...how do I change it?


texts: Magento 2 customer grid inline edit how to disable specifc column

texts: Can you please help me on that.Any solution for the above query?


texts: Change placeholder text color in Magento 2.1.2 search box

texts:
How to change the css of a placeholder? I want to change the color of the text "Search entire store here..."

Can you please help me with this?


texts: Magento\Sales resource could not access by customer token

texts:
Return order details in REST API Magento-2.2 get below error when tried to access using customer token, But it is working with admin token in salesOrderRepositoryV1

vendor_name/module_name/model/EmcOrderRepository.php

public function get($id)
{
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $order = $objectManager->create('Magento\Sales\Api\Data\OrderInterface')->load($id);
    $data = $order->getData();
    return $data;
}

And also I tried in many ways, But the result is same as Authorization error,

{
   "message": "No such entity with %fieldName = %fieldValue",
   "parameters": {
   "fieldName": "orderId",
   "fieldValue": "2"
},
"trace": "#0 /var/www/html/projectname/vendor/magento/module-sales/Model/ResourceModel/Order/Plugin/Authorization.php(45): Magento\Framework\Exception\NoSuchEntityException::singleField('orderId', '2')\n#1 .............


texts: Magento2 adminhtml product page table view

texts:
how can I edit the view of the product page?

I'd like to create a table view. Quantity fields on the first column, price fields in the 2nd column.

Thanks for the help


texts: Magento Enterprise Slow Product Save (/w and /wo Solr Integration)

texts:
Issue:

Product save has become incrementally slower over the past 12 months

Background:

Magento Enterprise 1.14.1 (Issue also present in 1.13.0.2)
~15,000 Products, ~700 Categories, 2 Stores
Solr 3.6

Investigation:

After the slower product save became an issue we investigate the slow query log an found the same query popping up: "UPDATE `catalogsearch_query` SET `is_processed`=0" coming in at around 2-3 seconds, running the same on local this was upping to 7-10 seconds.

The reason for this slow query is the site is search heavy and they're over 400,000 rows in in the catalogsearch_query table that are all being updated with a 0 which isn't a huge amount of data to store in a MySQL table but is a huge amount to update on such a frequent event.

To make matters worse after xdebugging the process Magento is hitting the Mage_CatalogSearch_Model_Resource_Fulltext::resetSearchResults() method 5 times during each product save off the back of catalog_product_save_commit_after event calling Enterprise_CatalogSearch_Model_Observer::processProductSaveDeleteEvent()

So 5 times * 3 seconds results in 15 seconds being added to each product save. 5 times seems overkill and it seems an oversight that the resetSearchResults() is called so many times at the end of the process triggered by this observer.

Investigating further there seems to be very little use for this is_processed field in the database when the Solr integration is in place.

Has anyone ran into this issue?
What actions did you take?
Any suggestions for approaching?

My initial thoughts is to restructure the process to remove the query on the catalogsearch_query after fully investigating its impact.


texts: Overriding Magento 2 static adminhtml backend isn't working

texts:
I've got file :

  "vendor/magento/module-ui/view/base/web/templates/grid/listing.html"

after deploy this file create:

  "pub/static/adminhtml/Magento/backend/en_US/Magento_Ui/templates/grid/listing.html"

I want edit this file but there is problem when i create:

  "app/design/adminhtml/{..}/{..}/Magento_Ui/web/templates/grid/listing.html"

after deploy file in static/adminhtml not change (still this file is same to vendor file).

Is there any other way to override this file or maybe i creating wrong path?


texts: New & Sale product list from specific categories

texts:
I would like to make 2 links with containing all new (link 1) and sale (link 2) products from a specific category and it's sub categories.

For example:
I want to show all new products from the baby category (Id=3)
The category is already an anchor.

And the same with sale items (items have sale prices generated by the catalog sale rules)

How can i do that? Because magento hasn't have a category filter for this ...

I have magento 1.8.1 CE


texts:
Error filtering template: Notice: getimagesize(): Read error! in /Applications/MAMP/htdocs/local.devsite.com/web/vendor/magento/module-catalog/Model/Product/Image.php on line 949

I get this on my Homepage and any page with Products.

I see that this issue was said to be resolved in 2.0
https://github.com/magento/magento2/issues/2276

How am I still getting this error?


texts: After adding custom price to product currency is not converting on cart page

texts:
To add custom price while adding to cart I have used catalog_product_load_after observer and used the function to add price.

public function checkoutCartProductAddAfter(Varien_Event_Observer $observer)
{
    $newPrice = 200;
    $item = $observer->getQuoteItem();
    $item->setCustomPrice($newPrice);
    $item->setOriginalCustomPrice($newPrice);
    $item->getProduct()->setIsSuperMode(true);

}

this is working fine for changing the price. But if I change currency on cart page currency is not changing properly. Any solutions??


texts:
When I run CLI commands in magento 2.2 php bin/magento setup:upgrade I'm getting following error.

[Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [2002] Connection timed out

  [PDOException]
  SQLSTATE[HY000] [2002] Connection timed out

setup:upgrade [--keep-generated] [--magento-init-params="..."]

Also I get the same thing when I try to run: php bin/magento setup:static-content:deploy

Requested languages: en_US
Requested areas: frontend, adminhtml
Requested themes: Magento/blank, Magento/luma, BA/mypres, Magento/backend

  [Zend_Db_Adapter_Exception]
  SQLSTATE[HY000] [2002] Connection timed out

  [PDOException]
  SQLSTATE[HY000] [2002] Connection timed out

setup:static-content:deploy [-d|--dry-run] [--no-javascript] [--no-css] [--no-less] [--no-images] [--no-fonts] [--no-html] [--no-misc] [--no-html-minify] [-t|--theme[="..."]] [--exclude-theme[="..."]] [-l|--language[="..."]] [--exclude-language[="..."]] [-a|--area[="..."]] [--exclude-area[="..."]] [-j|--jobs[="..."]] [--symlink-locale] [languages1] ... [languagesN]

Hardly anything works with CLI..

I tried to run the upgrade with -vvv. This was the output.

php bin/magento setup:upgrade -vvv

[InvalidArgumentException]
  There are no commands defined in the "setup" namespace.

Exception trace:
 () at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:501
 Symfony\Component\Console\Application->findNamespace() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:535
 Symfony\Component\Console\Application->find() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:192
 Symfony\Component\Console\Application->doRun() at /home/timothy/Public/www/vendor/magento/framework/Console/Cli.php:96
 Magento\Framework\Console\Cli->doRun() at /home/timothy/Public/www/vendor/symfony/console/Symfony/Component/Console/Application.php:126
 Symfony\Component\Console\Application->run() at /home/timothy/Public/www/bin/magento:23


texts: 2.3 how create guest order on backoffice

texts:
Is it possible to create a guest order from the admin panel? It always ask for a customer or creates a new one, some customer just want to order without an account and that's possible on store front, why not possible on admin? or am I missing some config?

Why when orders are created on admin panel magento don't send a new order email? I know email sendig is working fine because in storefront it sends the email

Thanks :D


texts: Override CSS file from composer installed module

texts:
I've one composer module which has CSS stored in view/base/web/css/style.css
How can I override this file so that I can modify it.
I tried copying that file to my custom theme as below,
app/design/frontend/Vendor/Theme/ChildTheme/Vendor_Module/web/css/style.css

But this doesn't work for me. Any ideas ?
UPDATE
Actually thing is CSS is responsible for styling order PDF so I think it will not work by putting it at frontend theme. I'm not sure but I've to make admintheme and then override into it


texts: Is it necessary to addIndex() on Setup Script?

texts:
I'm writing a setup script for my new module. I found that there are many setup scripts in InstallSchema.php contains addIndex(). But after I found some info on W3School, seems it's just a performance issue. So my questions are:

Is it a must to add index on my table?
What's the difference in terms on performance between with index or without index inside Magento?


texts: How get a field dynamically in xml file in magento 2?

texts:
$xml=' <?xml version="1.0" encoding="UTF-8"?>
          <cardNumber>4444333322221111</cardNumber>' // here how to pass a
                        value dynamically fro sale order payment table

what is the format of get a value dynamically in xml field in controller file


texts:
In RWD I have a 3 column layout for category pages - I want the category 'banner image' and title to show above the columns below - sitting below the breadcrumbs. How can I go about this? Here's an illustration of the current set up...

Breadcrumbs here...

Nav sidebar here   |    Banner and cat title Here & Products Below

Any advice please on how to get to the following....

Breadcrumbs here...

Banner and cat title here...

Nav sidebar here | Products here


texts: Allowed Currencies only show DKK in backoffice

texts:
I need to know why is my Magento 2 installation only showing DKK as the currencies? And I also need to know how to add another currency in allowed currencies list such as USD and Euro

any help would be greatly appreciated.
thanks


texts:
I want to be able to change the 'TV Stands' tag on the site back to Products (See Below) due to the additions of other products. I have search high and low and can not see where to change this!

Does anybody know how I can do this?


texts: Integrating Ebizmarts Sage Pay Suite and Aheadworks Advanced Newsletter

texts:
I'm trying to integrate Ebizmarts Sage Pay Suite CE and Aheadworks Advanced Newsletter (not the built in Magento newsletter).

We have both of these plugins on our Magento store. Users can subscribe to the newsletter either on registration or through their account page but when ticking the sign up box on the checkout page the user doesn't get added to the mailing list. After much trial and error and discussion with Aheadworks I think the error lies in the Ebzmarts section as disabling this extension allows customers to register for the newsletter at checkout.

Does any one have any experience integrating these plugins or any ideas about how to go about debugging this?


texts: How to add product image url value to mysql query

texts:
Brief

Add the product image URL to an existing query. Unless there is a better solution, I would like to:

Grab the 'value' from catalog_product_entity_media_gallery
Prefix 'www.domain.co.uk/media/catalog' to the 'value'
Add that to the below query

Current Query

SELECT
    increment_id AS 'Order Number',
    items.created_at AS 'Order Date',
    items.sku AS 'SKU',
    customer_email AS 'Email',
    items.name AS 'Product'
FROM sales_flat_order AS orders
    JOIN sales_flat_order_item AS items
    ON items.order_id = orders.entity_id
WHERE
    orders.created_at BETWEEN '2016-01-1 00:00:00' AND '2016-12-31 00:00:00'

Current Output

Order Number   Order Date           Email    SKU     Product
00001          2016-01-01 00:00:00  a@b.com  123456  Thing
00002          2016-02-01 00:00:00  b@b.com  789456  Thing 2

Required Output

Order Number   Order Date           Email    SKU     Product   Image URL
00001          2016-01-01 00:00:00  a@b.com  123456  Thing     www.domain.co.uk/media/catalog/image0001.jpg
00002          2016-02-01 00:00:00  b@b.com  789456  Thing 2   www.domain.co.uk/media/catalog/image0002.jpg

Any help appreciated, thanks


texts:
I want to filter products on product listing page and show only configurable products type.

In catalog/product/list.phtml file after

$_productCollection=$this->getLoadedProductCollection(); I'm adding

 // First make a copy, otherwise the rest of the page might be affected!
$_productCollection = clone $this->getLoadedProductCollection();

// Unset the current products and filter before loading the next.

$_productCollection->clear()
                   ->addAttributeToFilter('type_id', 'configurable')
                   ->load();

On product listing page I'm getting an error Column not found: 1054 Unknown column 'e.type_id' in 'where clause'.

  Note: I'm using Amasty product filter extension.


texts: How to sort products by bestsellers (e.g. by sales) in Magento 2

texts:
these days I've faced a problem: I needed to to sort products by sales. So, first of all I decided to add this field to collection of products and the order it using method $collection->setOrder().

So, here is my solution:

$collection = $this->_productCollection->create()
    ->joinField(
        'qty_ordered',
        'sales_bestsellers_aggregated_yearly',
        'qty_ordered',
        'product_id=entity_id',
        array('store_id' => $this->_storeManager->getStore()->getId()),
        'left'
    )
    ->addAttributeToSelect('*')
    ->setOrder('qty_ordered');

I've posted it cause I think it would be helpful for you. And also I am not sure that it is the best solution.

Maybe someone know better solutions?


texts: Magento 2.3 favicon and logo upload does not take hold

texts:
Tired in 2 separate installs of vanilla 2.3 magento commerce.

When trying to update favicon and logo and transnational email logo, the upload spinner will appear but are not saved.


texts: I need to create a page which lists all special products (with active special price). How can I do this?


texts: Magento 2 need to Display the popup in checkout when product is orderedqty is greate than product qty or outofstock?

texts:
In magento 2 need to display the popup in checkout page when is orderedqty is greate than product qty or outofstock ?

You can see in below image popup example.in this we have the two buttons and when we are click any one we need to save the information

any one please help me?


texts: Update Banner Text dynamically in Magento 2

texts:
I have a FreeShipping banner in every pate after Top of the Page after mega menu.
FreeShipping banner text will change based on customer cart specific items amount and customer group.
For this, I have written some logic, but it's not working for me.

For this, I have written the below code.

$customerGroupId = $block->getCustomerGroup();

$cartCount = count($block->getCustomerQuoteItems());

 if($cartCount > 0){

 $totalShipperAmount = $block->getTotalAmountOfShipperHQ($block->getCustomerQuoteItems());
  if($customerGroupId == 0){

                $notLoggedAmount = $block->getSSNotLoggedAmount();
                $totalAmount  = $notLoggedAmount - $totalShipperAmount;
                if($totalAmount  >= $notLoggedAmount){
                    $isSuperSaverValid = true;
                    $superSaverText = $block->getSSNotLoggedText();
                }else{
                    echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('Guest_Free_Shipping_Banner')->toHtml(); //static free shipping banner
                }

            }elseif ($customerGroupId == 1){

                $notLoggedAmount = $block->getSSRetailAmount();
                $totalAmount  = $notLoggedAmount - $totalShipperAmount;
                if($totalAmount  >= $notLoggedAmount){
                    $isSuperSaverValid = true;
                    $superSaverText = $block->getSSRetailText();
                }else{
                    echo $block->getLayout()->createBlock('Magento\Cms\Block\Block')->setBlockId('Retail_Free_Shipping_Banner')->toHtml();//static free shipping banner
                }

            }
}

//Banner Design

if($isSuperSaverValid || $isSuperSaverValid == true && $isSuperSaver){ ?>

<?php echo $superSaverText ?>

                        <a href="<?php echo $block->getBaseUrl() . 'freeshipping' ?>" style="text-decoration: underline;font-size:.75em;color:gray; float:right;margin-right:10px;">details

<?php } ?>

Created a Static block for this module and added this to Widget with the condition After Page Header Top.

It's working when static block, After updated with the condition it's not working. When I debug the module cart items are not getting when the page loading.

Could you please suggest us how to update the banner text dynamically when any page loading.


texts: Magento 2 - checkout_submit_all_after event is not working

texts:
In Magento, I have to get order items in the observer.

I am trying two method sales_order_place_after and checkout_submit_all_after.

Both events is not working.

events.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="checkout_cart_product_add_after">
        <observer name="cart_product" instance="Example\Details\Observer\CartProduct" />
    </event>
    <event name="checkout_submit_all_after">
        <observer name="oreder_item" instance="Example\Details\Observer\OrderItem" />
    </event>
</config>

OrderItem.php

<?php

namespace Example\Details\Observer;

use Magento\Framework\Event\ObserverInterface;

class OrderItem implements ObserverInterface
{
    public function __construct(
        \Magento\Framework\App\Request\Http $request,
        \Magento\Framework\ObjectManagerInterface $objectManager
    ) {
        $this->_request = $request;
        $this->_objectManager = $objectManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $orderItems = $observer->getOrder();
        $orderItems->getEntityId();
    }
}

I use both conditions one by one but it's not working.


texts: The question is about Meta Description and General Description

texts:
Is there any reason why the General description and the Meta Description need different text? We are asking this especially with a view as to whether Google penalises if duplicated.

We are struggling to think of different things to say in both sections.

Thank you

Lisa


texts: Get Custom Option Values of a product magento 2

texts:
I have two custom options for a product. Color and Size and both are drop-downs. In product detail pages, I have to display all available colors of that product.

I tried the following code and it works:

$_product = $block->getProduct();
foreach ($_product->getOptions() as $o) {
    foreach ($o->getValues() as $value) {
        print_r($value->getData());
    }
}

But it returns all the values of Color and Size. But I only need the color values. That is I want to select the custom options by color.


texts: Manage Categories section in admin is missing expand plus signs beside parent categories in Magento 1.9

texts:
I have been working on developing a Magento site and today the little plus signs beside the categories on the Manage Categories section of the admin side disappeared.

I can still use Expand All to expand the category tree, but it is more difficult to navigate the categories this way.

Any insight into why the plus signs would disappear?

When the categories are expanded I still have the little minus sign to collapse them, but no plus signs.

Any help would be appreciated.

Thanks!

Troy


texts: How to set position sorting to be default

texts:
I can see how to set the position of products in a category however what I can't see is how to set the default sorting order

The only options I have is "Best Value", "Name" & "Price:. The sort by of position is not avaiable

Please could someone advise how I set the sort by to be "Position" by default


texts:
I set all the permissions and recommended by the documentation.

However, anyone can still see the log files from the browser since the var/log folder has read permission.

How is that handled ?  by .htaccess?
I have that file in place
Maybe is not being recognized by the server ?

How can I fix this?

Thanks


texts: An order made a few days ago is stuck on "processing". They payment has been captured and shows up on our merchant account. I've searched for questions previously asked and the answers always seem very complex as I am not familiar with code. Is there an easy fix for this or will I be paying our website support for help in fixing it?


texts: Magento 1 URL rewrite Reindex takes forever and no data on core_url_rwrite table

texts:
We have a Magento 1.9.1 site with around 800k products. The core_url_rewrite table was truncated in order to get new url_rewrites after indexing.

The problem is the url_rewrite reindex is taking for 2 days already but there are no data found on the core_url_rewrite table. Also, when I open the rewrite table it shows 0-0 of 1,456,361 records found. This makes things even more complicated.

We updated the latest security patches before doing the reindex, is there any possibility that it affected the reindexing module?

Note: The server, 8 cores CPU, 30G RAM

Need help.


texts: Payment Javascript Class - Override nextStep method

texts:
I'm working on an extension for Magento and need to wrap a method (nextStep) in the Payment class of opcheckout.js

In my JS file, loading after the original checkout.js file, I have tried many variations of the following code, but none seem to work. The object definitely exists however.

Payment.prototype.nextStep
   = Payment.prototype.nextStep.wrap(function(parentMethod){
                 alert("hello world");
});

I've also tried Payment.addMethod and replaced the method completely with my own, but this did not work.

Essentially in this method, I need to add a check to see if the JSON response 'error' comes back with a specific value that I define in my observer event. For the sake of the example, it returns like this:

"error" => "popup1"

Here is the nextStep function and a little idea of what I need. My code is added between the comments

nextStep: function(transport){
    if (transport && transport.responseText){
        try{
            response = eval('(' + transport.responseText + ')');
        }
        catch (e) {
            response = {};
        }
    }

    /* START MY CODE - Need code added here  as shown below */

    if (response.error) {
        if(response.error == 'popup1'){
            // my code
        }
    }

    /* END MY CODE */

    /*
     * if there is an error in payment, need to show error message
     */
    if (response.error) {

        if (response.fields) {
            var fields = response.fields.split(',');
            for (var i=0;i<fields.length;i++) {
                var field = null;
                if (field = $(fields[i])) {
                    Validation.ajaxError(field, response.error);
                }
            }
            return;
        }
        alert(response.error);
        return;
    }

    checkout.setStepResponse(response);

    //checkout.setPayment();
},

This is the last issue in making my extension installable and the developer prior to me simply commented out the base opcheckout.js file and loaded a modified version which is not acceptable.

Any pointers? Suggestions?

Thanks


texts: How to add custom option price when product is adding add to cart using controller

texts: I have to add the custom option price when product is adding add to cart using controller


texts: How to add a filter for a new shipping method by customer group?

texts:
I want to add a new shipping method available only for some customer groups. I use the documentation to create a new shipping method, but there is no filtering method for customer groups in the tutorial. Tell me how to add select to filter by customer group or how to add a filter by customer group by hardcode in the module?
https://devdocs.magento.com/guides/v2.3/howdoi/checkout/checkout-add-custom-carrier.html


texts: Magento2 need to throw 500 internal server error in webapi response

texts:
Can anyone let me know how to throw 500 internal error in api response with REST API? i have used below right now:

throw new NoSuchEntityException(
__(
    'Field : '.$fields.' required.'
));

but it throws error code 400, i need 500 error code exactly default magento throws error if key is wrong in parameter.

I have used below code:
if (!isset($postData[$fields])) {
                throw new \Magento\Framework\Webapi\Exception(
                 __(
                   'Field : '.$fields.' has wrong value.'
                 ), 0, \Magento\Framework\Webapi\Exception::HTTP_INTERNAL_ERROR);
            }

Please find attached screenshot of 400 error:


texts: How to update my global prices and delete website prices?

texts:
In Magento I configured global prices - 1 price for all websites/stores/languages.
Unfortunately, Magmi imported prices in the website tables (in case there is anything like a website table).
So now I've got global prices if I manually enter a product and I if use Magmi to import a product into two different languages, I've got website scope prices.

Is it somehow possible to delete the website prices and tell Magento (or does it do it by itself) to use the global prices?

Thanks,
Chris


texts:
I have used website url input in my registration page for Magento 1.
All things are working fine but its validation is not working for all counties.

Ex:

www.example.com (no error)

www.example.in (validation error)

You can see here: http://www.nutraplex.com/index.php/customerActivation/index/wholesale/

I want it should accept all two and three digits.

Thanks


texts: Magento 2.1 custom product form use ui component

texts:
I working for custom product form in backend on magento 2.1.1. Follow this tutorial: https://gielberkers.com/adding-custom-category-attributes-magento-2-1/.

But, have a problem, when I submit form, in controller, I can't get postValue for this field. Because attribute "name" of this input is blank.

I want use this way to add an ui component file for this field to run some js code. This js code will run dependence for some other fields, and I can't fix this problem.

If you have solution please help me.
Thank you so much.


texts: How to send response to another controller in M2?

texts:
Edited

In Magento 2 I have created a form. it submit data form my controller. So I Want sent data form product save controller after that return my controller. How to I make it? Many thanks!


texts: Default Facebook sharer URL in Magento 1.9 (RWD)

texts:
The following code is for the built in Facebook sharer URL construction in Magento's 1.9 RWD theme.

    <?php $_u = 'p[url]=' . $_productUrl . '&p[images][0]=' . $_productImageUrl . '&p[title]=' . $_productName . '&p[summary]=' . urlencode(trim($_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description'))); ?>
    <a href="<?php echo 'http://www.facebook.com/sharer.php?s=100&' . $_u; ?>" target="_blank" title="<?php echo $this->__('Share on Facebook') ?>" class="link-facebook">
        <?php echo $this->__('Share Facebook') ?>

When sharing a URL though with this Facebook button, the description for the page is including HTML tags. Not only have I tried to strip_tags for the short description, it is actually using the long description even if I replace short description with another attribute. I can't find anything in Mage_Core for this...

It is changing the URL correctly for the &p[summary]= parameter but when you preview the shared URL, it just shows the description along with HTML tags.

Any ideas on how to fix this?


texts:
I'd like to enable the Dark Mode in Magento 2.
Using plain CSS I know it easily achieved by doing:
@media (prefers-color-scheme: dark) {
  .day.dark-scheme   { background:  #333; color: white; }
  .night.dark-scheme { background: black; color:  #ddd; }
}

How can I implement it in my Magento .less file instead?
I tried something like:
& when (@media = 'prefers-color-scheme: dark') {
  .day.dark-scheme   { background:  #333; color: white; }
  .night.dark-scheme { background: black; color:  #ddd; }
}

but it didn't work.


texts:
After a while of developing (with a colleague) I get this JS error on every page: "SyntaxError: JSON.parse: unexpected character at line 5 column 50 of the JSON data" in file main.js.

This is nice to know but I have no idea what JSON data is causing the problem. main.js is a core file that was not changed. The firefox console does not tell me what data is the issue and where it comes from.

So my question is: how do I debug such errors?


texts:
I am trying to create new custom SOAP API but it returns following error "SoapClient::SoapClient(): $wsdl must be string or null"

etc/webapi.xml :

<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
<route method="GET" url="/V1/mageplaza-helloworld/posts">
    <service class="Mageplaza\HelloWorld\Api\PostManagementInterface" method="getPost"/>
    <resources>
        <resource ref="anonymous"/>
    </resources>
</route>

Mageplaza/HelloWorld/Api/PostManagementInterface:

<?php
  namespace Mageplaza\HelloWorld\Api;

  interface PostManagementInterface {

    public function getPost();
 }
?>

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="Mageplaza\HelloWorld\Api\PostManagementInterface" type="Mageplaza\HelloWorld\Model\PostManagement"/>
 </config>

Model/PostManagement.php

<?php
 namespace Mageplaza\HelloWorld\Model;

 class PostManagement {

/**
 * {@inheritdoc}
 */
public function getPost()
{
    $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/custom-api.log');
    $logger = new \Zend\Log\Logger();
    $logger->addWriter($writer);
    $logger->info("Did't generated the session id");

    return 'api GET return the';
    }
 }

Api request:

    $name = array("param"=>"Jim");

    $wsdlUrl = new SoapClient("http://127.0.0.1/magento201/soap/default?wsdl&services=mageplazaHelloWorldPostManagementV1");
    $context = stream_context_create($opts);
    try{
        $soapClient = new \Zend\Soap\Client($wsdlUrl);
        $soapClient->setSoapVersion(SOAP_1_2);
        $soapClient->setStreamContext($context);
        $soapResponse = $soapClient->mageplazaHelloWorldPostManagementV1GetPost($name);
        echo "<pre>"; var_dump($soapResponse);
    }catch(Exception $e){
        echo "Exception Error:------".$e->getMessage();
    }


texts:
I am creating copy of xml file and try to change local.xml file database name dynamically but CData is not getting proper.

my code is below,

 $xml = new DOMDocument('1.0', 'utf-8');
 $xml->formatOutput = true;
 $xml->preserveWhiteSpace = false;
 $xml->load('local.xml');
 $xpath = new DOMXpath($xml);
 $element = $xml->getElementsByTagName('dbname')[0];
 $element->nodeValue = '<![CDATA['test']]>';
 $xml->save($new_file);

But output is <dbname>&lt;![CDATA[test instance]]&gt;</dbname>.

I need output with <dbname><![CDATA[test instance]]></dbname>.

Can any one have solution how i can achieve this.


texts: How to retrieve custom fileld values from magento 2

texts:
I have added some custom fields to the admin->configurations->sales->payment section using the following method.

created config.xml inside etc folder of my module dir.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Store:etc/config.xsd">
<default>
    <payment>
        <ProductSpecificPayments>
            <model>Vendor\Module\Model\Carrier\ProductSpecificPayments</model>
            <name>Product Specific Payment</name>
        </ProductSpecificPayments>
    </payment>
</default>

Then created system.xml in adminhtml folder.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>

        <group id="productspecific" translate="label" type="text" sortOrder="500" showInDefault="1" showInWebsite="1" showInStore="1">
            Productspecific Payment Configuration
            <field id="active" translate="label" type="select" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="0">
                Enabled
                <source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
            </field>
            <field id="title" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
                Title
            </field>
            <field id="name" translate="label" type="text" sortOrder="30" showInDefault="1" showInWebsite="1" showInStore="1">
                Name
            </field>
            <field id="allowed_shippings" translate="label" type="multiselect" sortOrder="40" showInDefault="1" showInWebsite="1" showInStore="0">
                Allowed Payment Methods
                <source_model>Vendor\Module\Model\AllPayements</source_model>
            </field>
            <field id="highes_amount" translate="label" type="select" sortOrder="50" showInDefault="1" showInWebsite="1" showInStore="0">
                Fallback Payment
                <source_model>Vendor\Module\Model\AllPayements</source_model>
            </field>
        </group>

</system>

now it is working fine. but How I can retrieve these saved values in product adding a page or any other files?

especialy inside a Model.


texts:
when trying to run setup:upgrade i'm getting the error below.
I dont remember having any issues on my store.
I've tried to enable verbose on the upgrade using setup:upgrade -vv but wiithout success

Below is the error

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 't_scope1_tmp WHERE
Non_unique = 1' at line 2, query was: SHOW INDEXES FROM catalogsearch_fulltext_scope1_tmp WHERE Non_unique = 1

Can anyone help me please.

Regards


texts:
I need to override

protected function _productLimitationPrice($joinLeft = false)
in magento 2 which is located at
public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Collection.php  How can i override method in product collection.

class Collection extends
           \Magento\Catalog\Model\ResourceModel\Product\Collection

       {
      protected function _productLimitationPrice($joinLeft = false)
   {
      $filters = $this->_productLimitationFilters;
    if (!$filters->isUsingPriceIndex() ||
        !isset($filters['website_id']) ||
        (string)$filters['website_id'] === '' ||
        !isset($filters['customer_group_id']) ||
        (string)$filters['customer_group_id'] === ''
    ) {
        return $this;
    }

    // Preventing overriding price loaded from EAV because we want to use the one from index
    $this->removeAttributeToSelect('price');

    $connection = $this->getConnection();
    $select = $this->getSelect();
    $joinCond = join(
        ' AND ',
        [
            'price_index.entity_id = e.entity_id',
            $connection->quoteInto('price_index.website_id = ?', $filters['website_id']),
            $connection->quoteInto('price_index.customer_group_id = ?', $filters['customer_group_id'])
        ]
    );

    $fromPart = $select->getPart(\Magento\Framework\DB\Select::FROM);
    if (!isset($fromPart['price_index'])) {
        $least = $connection->getLeastSql(['price_index.min_price', 'price_index.tier_price']);
        $minimalExpr = $connection->getCheckSql(
            'price_index.tier_price IS NOT NULL',
            $least,
            'price_index.min_price'
        );
        $colls = [
            'price',
            'tax_class_id',
            'final_price',
            'minimal_price' => $minimalExpr,
            'min_price',
            'max_price',
            'tier_price',
        ];

        $tableName = [
            'price_index' => $this->priceTableResolver->resolve(
                'catalog_product_index_price',
                [
                    $this->dimensionFactory->create(
                        CustomerGroupDimensionProvider::DIMENSION_NAME,
                        (string)$filters['customer_group_id']
                    ),
                    $this->dimensionFactory->create(
                        WebsiteDimensionProvider::DIMENSION_NAME,
                        (string)$filters['website_id']
                    )
                ]
            )
        ];

        if ($joinLeft) {
            $select->joinLeft($tableName, $joinCond, $colls);
        } else {
            $select->joinLeft($tableName, $joinCond, $colls);
        }
        // Set additional field filters
        foreach ($this->_priceDataFieldFilters as $filterData) {
            $select->where(call_user_func_array('sprintf', $filterData));
        }
    } else {
        $fromPart['price_index']['joinCondition'] = $joinCond;
        $select->setPart(\Magento\Framework\DB\Select::FROM, $fromPart);
    }
    //Clean duplicated fields
    $this->_resourceHelper->prepareColumnsList($select);

    return $this;

  }


texts:
I've got a problem with Magento 2.0.6.

layout.js:64 Uncaught TypeError: Constr is not a constructor (layout.js line 64)

The cart is not loading anymore, the minicart-wrapper stays empty. Problem firstly only existed on Safari and iOS, meanwhile (and without any changes - thats where its getting weird) it also stopped working on all other browsers, Firefox, Mac, you name it.

Does anyone else is having this problem?


texts: SOAP API Checkout Error: Credit card number mismatch with credit card type

texts:
Please note that this is not a duplicate question - the existing questions do not address the issue with the same level of specificity.

I am receiving the following error when attempting to process credit cards via PayPal PayFlow:

Fatal error: Uncaught SoapFault exception: [1008] Credit card number mismatch with credit card type.

I have fully configured PayFlow within Magento with test mode active using identical PayPal credentials to those used in another (fully functional, non-Magento) application.

I have a shopping cart active with a user and products successfully attached - I have tested this portion by submitting the test payment as a check order and it works fine.

Once the cart is ready, I attach payment details as follows:

$paymentMethod = array(
    'po_number' => null,
    'method' => 'verisign',
    'cc_cid' => '123',
    'cc_owner' => $customer['firstname'].' '.$customer['lastname'],
    'cc_number' => '4111111111111111',
    'cc_type' => 'VI',
    'cc_exp_year' => '2022',
    'cc_exp_month' => '12'
);
$proxy->shoppingCartPaymentMethod($sessionId, $cartId, $paymentMethod);

At this point, no errors have been thrown.  The error occurs after the following code:

$proxy->shoppingCartOrder($sessionId, $cartId, null, null);

What could be causing this error?  Are there any known starting points for fixing it?  Thanks in advance!


texts: Magento 2.3 Cloud Enterprise - Not able to upload any picture/image at all (error messages)

texts:
I'm very new to Magento and I have a functional background. I have read and followed all Magento commerce functional manuals on how to configure the Backend (creating products, customers, adding content, etc ..).

Although the functional manuals are quite easy to understand and to follow, I'm getting errors when trying to upload any image (for the product, category, content, etc ...). see screenshots of error messages encountered below.

I have read on some forums that this could be linked to the permissions of directories & files (770 & 660) or could also be linked to storage capacity (I haven't been able to create/store any product or image so doubting this could be the reason ..)

Could someone explain me what are the possible root causes, how I can check them (from a functional perspective) and how I can fix them (I have very limited technical knowledge but I can, of course, follow a step by step explanation)?

Thank you very much!

Not able to upload a category image via the “Upload button”, I’m getting the following error message:

It is also not possible to add a category image with the “select from the gallery” see below:
Not able to add an image via “select file” in the media gallery, I’m getting the following error message:

Not able to create a new sub-folder in the media gallery, I’m getting the following error message:


texts: Create Downloadable Audio product (Album) and sell tracks individually

texts:
We want so sell audio files as a Downloadable product. Magento already have a feature that we can achieve this, but it is not yet what we want. We want to achieve something like this.

So, i want to be able to sell the full Album with 12 tracks by $9.99, but i also want to be able to sell each product individually, by $0.99, and list those tracks in the Album product, with samples.

I found this answer , but he uses Simple products instead of Downloadable products. I need it to be Downloadable, because i want to use the Magento download system.

Any advice?


texts: Magento 2 product share in instagram and twitter and get the response after share

texts:
I would like to get the response after the product share in instagram and twitter in magento2 product page.

I am getting the response for Facebook like below code:

require([
"jquery"
], function($){
    $(document).ready(function() {
var product_url = $('#product_url').val();
var product_id = $('#product_id').val();
var product_name = $('#product_name').val();
 window.fbAsyncInit = function() {
      // init the FB JS SDK
      FB.init({

            appId      : '',                        // App ID from the app dashboard
            channelUrl : product_url, // Channel file for x-domain comms
            status     : true,                                 // Check Facebook Login status
            xfbml      : true                                  // Look for social plugins on the page
          });

          // Additional initialization code such as adding Event Listeners goes here
        };

        // Load the SDK asynchronously
        (function(d, s, id){
           var js, fjs = d.getElementsByTagName(s)[0];
           if (d.getElementById(id)) {return;}
           js = d.createElement(s); js.id = id;
           js.src = "//connect.facebook.net/en_US/all.js";
           fjs.parentNode.insertBefore(js, fjs);
         }(document, 'script', 'facebook-jssdk'));

    function fb_share() {
        FB.ui( {
            method: 'feed',
            name: "Facebook API: Tracking Shares using the JavaScript SDK",
            link: product_url,
            picture: "https://stackexchange.com/users/flair/557969.png",
            caption: "Tracking Facebook Shares on your website or application is a useful way of seeing how popular your articles are with your readers. In order to tracking Shares, you must used the Facebook JavaScript SDK."
        }, function( response ) {
            if (jQuery.type(response) != 'undefined') {
               $.ajax({
                showLoader: true,
                //url: '',
                data: { product_id: product_id, product_name: product_name},
                type: "POST",
                dataType: 'json'
              }).done(function (data) {
              });
                //$("#fb_successresult").append(" Appended text");
            }else{
                //$("#fb_failresult").append("Not Appended text");
            }
        } );

    }

    $(document).ready(function(){
      $('button.share-btn').on( 'click', fb_share );
    });
        });
    });

Thank you.


texts: Magento 2 REST API get categories names by list of ids

texts:
If you use Magento's REST APIs to get product, you use this endpoint:

GET /V1/products/{sku}

This endpoint returns response with category_ids in it.
What I want to do is to get the product with category names instead of ids.
I tried using GET /V1/categories/list with some search criteria and it worked but this endpoint needs admin privileges which can't be provided to show categories of a product inside the application for guest or registered customer without admin authorization.

The question is, can I do such a thing without building a custom endpoint that gets me either category names by list of ids or a product with categories names instead of ids?


texts: Magento 2 - redirect to final checkout page (checkout success/failed)

texts:
I have a custom payment module. When the user select this payment method at checkout, he is redirected to custom module controller, which redirects him to payment gateway. Then he fills his credit card info and is redirected back to custom module controller. Here I process the gateway reply to see if payment was success or not and update the order status. But currently, the user stays on this page.

How do I redirect him to Checkout Success page (where the order ID tracking and create account buttons are displayed)? It works if I simply redirect him to /checkout/onepage/success, but is this a correct way how to do it?

And how do I redirect him to Checkout failed page? In Magento 1, I restored the cart and redirected him to cart view with error message like this:

//restore cart
$session = Mage::getSingleton('checkout/session');
$lastQuoteId = $session->getLastQuoteId();
$quote = Mage::getModel('sales/quote')->load($lastQuoteId);
$quote->setIsActive(true)->save();

//redirect to cart with error message
$failMsg = $this->__('Payment failed. Please try again.') . " " . $orderReplyStatus->resultText;
Mage::getSingleton('core/session')->addError($failMsg);
$this->_redirect('checkout/cart');

Do I have to do the same in Magento 2 or does Magento 2 have a checkout failed page?


texts:
Right now I'm running Magento ver. 1.9.2.4 which is quite old.

If I would download and update/patch my Magento from here do I still need to patch 1.9.3 first or can I just update directly to the latest version?

EDIT:
It was the wrong link! Check the link again, sorry for the inconvenience.


texts: Magento2: How to custom module filter with "product type"?

texts:
What the solution for this? please help.
Thank you so much


texts: How to redirect to previous page magento 2?

texts: How to redirect to previous page from my custom action in magento 2


texts: Suddenly Magento sessions stopped working

texts:
Suddenly the session on our live site stopped working. Do not know why this is happening.

Our site is hosted on AWS EC2 Linux

var and var/session folder exists and have permission 777

nothing there in exception.log or system.log

cache folder is cleared and have permission 777

Cannot login as customer, admin and add to cart not working


texts: cross sell, up sell page? any way to do it better than default to increase sales?

texts:
Ideally - I would love to add an extra step in the check-out (I don't have a one-page checkout) just as they have it working on proflowers.com but I hear that's rather complicated. So - any solution which will make my cross sell items more visible than the default would be appreciated. I did a search for extensions on Magento Connect but didn't really find anything interesting. Just to explain it correctly - I want something come up for the customer to clearly see that would say something like:

Make it extra special! Add options to include with your gift:

and then add Teddy Bears, Chocolates, Cookies, Balloons, etc.

Any suggestions would be greatly appreciated!

I don't want any automatic cross-up-selling suggestions - I want to be able to select what I want to show/sell...


texts: Get quote items from admin quote session

texts:
I want to set shipping price for orders created in magento admin, how to get the quote items?
I am using below code to get all the Quote

$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();

I put log for above line and I am getting "1" in log.


texts: Please help. After I upload the products file,I got the error: Image file was not found

texts: The image is in the folder /media/import/ ., please see the below 3 pictures.


texts: Display custom column in Invoice grid using join

texts:
I have custom moudule with custom table and tried to join it with invoice grid table to show it in invoice grid.But it is not working as it should.Here is what i have tried.
adminhtml/di.xml
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="sales_order_invoice_grid_data_source" xsi:type="string">Vendor\Module\Model\ResourceModel\Order\Grid\Collection</item>
        </argument>
    </arguments>
</type>

collection.php
    <?php

namespace Vendor\Module\Model\ResourceModel\Order\Grid;

use Magento\Sales\Model\ResourceModel\Order\Grid\Collection as OriginalCollection;

/**
 * Order grid extended collection
 */
class Collection extends OriginalCollection
{
    protected function _renderFiltersBefore()
    {
        $myInvoiceTable = $this->getTable('mytable');
        $this->getSelect()->joinLeft(
            ["myinv" => $myInvoiceTable],
            'main_table.entity_id = my.invoice_id',
            ['increment_id_with_prefix']
        )
           ;

        parent::_renderFiltersBefore();
    }

}

sales_order_invoice_grid.xml
    <?xml version="1.0" encoding="UTF-8"?>
<listing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <columns name="sales_order_invoice_columns">
        <column name="increment_id_with_prefix">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Invoice Increment</item>
                </item>
            </argument>
        </column>
    </columns>
</listing>

Mytable Structure

Output invoice grid It show some column missing data also not showing mytable column data.Also there is many invoice but it show only these 4 row only.


texts: How changing Product Price Alert email template (it is hard coded)

texts: It seems product_price_alert.html is the only hard coded template. I would like to change this template but there is only one variable inside var alertGrid. I tried to find in what file is formed this variable, the html code which is pasted by Magento inside that template but without success. If anyone knows how to solve this I appreciate for the help.


texts:
The code I am using is:

    $this->addColumn('grand_total', array(
        'header' => Mage::helper('sales')->__('Total'),
        'index' => 'grand_total',
        'filter_index' => 'sfo.grand_total',
        'type' => 'currency',
        'currency' => 'order_currency_code'
    ));

This should render the price as [£/$][00.00] and not as 000.0000 as it is now. How do I make it to two decimal places?

Thanks


texts: Magento2 How can I display color visual swatches in slider on product details page

texts:
Magento2 I need to display color visual swatches on product details page as a slider
Something like

How can I achieve this? Can someone suggest some way?


texts: How to get shipping amount when it is not set in shipping address

texts:
I recently added an extension to show the shipping charges in cart page. It calls an observer upon the event sales_quote_collect_totals_before and sets the shipping address to default. I have a shopping bag popup to show the cart details and I don't want to show the shipping charges there. I checked the sales_flat_quote_address table and saw that the shipping address wasn't added when a product was first added to cart by a guest user; only the billing address was added with NULL values. The shipping address was set in the table after adding another item to cart or after calling the indexAction in CartController. However, the grandtotal was being set to the value which was inclusive of the shipping charge. Can someone please explain how the shipping charge is getting added to grand total in sales_flat_quote table without the shipping address being set in sales_flat_quote_address?

Here's the observer's code for the extension I have used.

public function handleCollect($observer) {
    if (!Mage::getStoreConfig('shipping/origin/applydefaultstoemptyquote'))
        return $this;

    $quote = $observer->getEvent()->getQuote();
    $shippingAddress = $quote->getShippingAddress();
    $billingAddress = $quote->getBillingAddress();
    $saveQuote = false;
    if (!$shippingAddress->getCountryId()) {
        $country = Mage::getStoreConfig('shipping/origin/country_id');
        $state = Mage::getStoreConfig('shipping/origin/region_id');
        $postcode = Mage::getStoreConfig('shipping/origin/postcode');
        $method = Mage::getStoreConfig('shipping/origin/shippingmethod');
        Mage::log($method);
        $shippingAddress
            ->setCountryId($country)
            ->setRegionId($state)
            ->setPostcode($postcode)
            ->setShippingMethod($method)
            ->setCollectShippingRates(true);
        $shippingAddress->save();

        $saveQuote = true;
    }
    if (Mage::getStoreConfig('shipping/origin/applydefaultstobillingaddress') && !$billingAddress->getCountryId()) {
        $country = Mage::getStoreConfig('shipping/origin/country_id');
        $state = Mage::getStoreConfig('shipping/origin/region_id');
        $postcode = Mage::getStoreConfig('shipping/origin/postcode');

        $billingAddress
            ->setCountryId($country)
            ->setRegionId($state)
            ->setPostcode($postcode);

        $saveQuote = true;

        $quote->save();
    }
    if ($saveQuote)
        $quote->save();
    return $this;
}


texts: Magento 2 handle WEBAPI error and success Response for multiple data input

texts:
I have an input data like this for my custom web api:

"data":[{"sku":"BM0011","warehouse":"kklm","qty":"5"},{"sku":"YU9982","warehouse":"cvxs","qty":"2"}]

I need to validate the data and run the update inventory function and catch an error if there's any. Since this has multiple data that I need to process, If one data has validation error it will process the next data without canceling all the process. Currently i do it like this:

/**
 * {@inheritdoc}
 */
public function updateProductsInventory($data)
{
  $errors = array();
  $success = array();
  $results = array();

  foreach ($data as $productData) {
    $errValdation = $this->validateUpdateInventory($productData);
    if (!empty($errValdation)) {
      $errors['validation'][$productData['sku']] = $errValdation;
      continue;
    }
    try {
      $result = $this->updateInventory($data);
      $success['update'][] = $productData['Item No_'];
    } catch (\Exception $e) {
      $errors['insert'][$productData['sku']] = __("There's something wrong, please try again!");
    }
  }
  if (!empty($errors)) {
    $results['errors'] = $errors;
    if (empty($success)) {
      throw new \Magento\Framework\Webapi\Exception($results);
    }
  }
  if (!empty($success)) $results['success'] = $errors;
  return $results;
}

public function validateProductInventory($data){
    $errors = array();
    $mandatories = array('sku','qty','warehouse');
    foreach ($mandatories as $mandatory) {
      if (!array_key_exists($mandatory,$data)) {
        $errors[] =   $mandatory . ' ' . __("is Empty");
        continue;
      }elseif(empty($data[$mandatory])) {
        $errors[] =   $mandatory . ' ' . __("is Empty");
        continue;
      }
      if ($mandatory == 'qty') {
        if ($data[$mandatory] < 0) {
          $errors[] = __("Inventory must be Greater or equal to 0");
        }
      }elseif($mandatory == 'sku'){
        $productId = $this->productFactory->create()->getIdBySku($data[$mandatory]);
        if (empty($productId)) {
          $errors[] = __("The Product with the %1 SKU doesn't exist.",$data[$mandatory]);
        }
      }
    }
  }

error results:

[
    {
        "validation": {
            "BM0011": [
                "The Product with the AKWLHK0001 SKU doesn't exist."
            ]
        }
    }
]

success results:

[
    {
        "update": [
            "W1K147353BA5XX"
        ]
    }
]

I don't know if this is the correct way to return an API result, and I don't think this is very neat, is there a recommendation to improve the result of my web API?


texts:
so I after I created my custom theme and applied it, the emails are coming but there is no CSS styling on them. I don't want to make any changes to them, I am happy to keep the default ones.
any ideas what's happening?

Thanks in advance!

Update: so i ran bin/magento setup:static-content:deploy and i found this error:

    Compilation from source: /Applications/MAMP/htdocs/Magento219/vendor/magento/theme-frontend-blank/web/css/email-inline.less

Compilation from source:
frontend/mageroot/dbooks/en_US/css/email-inline.less
variable @media-common is undefined in file /Applications/MAMP/htdocs/Magento219/var/view_preprocessed/css/frontend/mageroot/dbooks/en_US/css/source/_theme.less in _theme.less on line 4, column 9
2| //  _____________________________________________
3|
4| & when (@media-common = true) {
5| .page-header {
6|     margin-top: 0px;
7|     margin-bottom: 0px;

....

Compilation from source: /Applications/MAMP/htdocs/Magento219/vendor/magento/theme-frontend-blank/web/css/print.less

Compilation from source:
frontend/mageroot/dbooks/en_US/css/print.less
variable @media-common is undefined in file /Applications/MAMP/htdocs/Magento219/var/view_preprocessed/css/frontend/mageroot/dbooks/en_US/css/source/_theme.less in _theme.less on line 4, column 9
2| //  _____________________________________________
3|
4| & when (@media-common = true) {
5| .page-header {
6|     margin-top: 0px;
7|     margin-bottom: 0px;

I am not sure is it the error that causes this and I am not sure how to sort it out anyway. any thoughts?


texts: CentOS search specific text in all files

texts:
I need to find the files (and path to the files) on my CentOS 7 DirectAdmin server, that contains the string "qunar". So it needs to search all files inside the server.

How can I achieve that?

I tried this, but then the server does not respond, is that because of the heaviness of the search?

grep -i -R "qunar" /


texts:
I have an issue with the compiled WSDL file not being standard compliant with 3rd party system, SAP.

A base magento install with WS-I compliance turned on in the admin is causing errors within SAP as the wsdl schema is returning nodes in the wrong order.

The message nodes should be grouped together, however as visible here:

  The following nodes separate message blocks, which invalid the strict schema.

<portType name="Mage_Api_Model_Server_V2_HandlerPortType">...</portType>
<binding name="Mage_Api_Model_Server_V2_HandlerBinding" type="typens:Mage_Api_Model_Server_V2_HandlerPortType">...</binding>
<service name="MagentoService">...</service>

Has anyone else encountered this problem? And also has anyone ever needed or know how to reoorder nodes within the combined wsdl file?


texts:
This is my layout:

<?xml version="1.0"?>
<layout>
    <adminhtml_customer_edit>
        <reference name="accordion">
            <block type="mynamespace_mymodule/adminhtml_customer_edit_tab_view_subscription" name="myname" />
        </reference>
    </adminhtml_customer_edit>
</layout>

This my Block:

class Mynamespace_Mymodule_Block_Adminhtml_Customer_Edit_Tab_View_Subscription extends Mage_Core_Block_Abstract
{
    protected function _prepareLayout()
    {
        echo 1; exit();
    }
}

this is my module xml from etc folder:

<global>
        <blocks>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Block</class>
            </mynamespace_mymodule>
        </blocks>
        <helpers>
            <mynamespace_mymodule>
                <class>Mynamespace_Mymodule_Helper</class>
            </mynamespace_mymodule>
        </helpers>
</global>

My question is: why do I not get the echo 1 ; exit () ; ?

update


texts: Magento 2 Filter admin grid collection by default

texts: In Magento 2.2.5, I want to filter the custom grid using custom attribute. I followed this link. But it is not working. Is any alternate solution there.


texts: Dependency injected class returns an array instead of an object

texts:
I've been trying to do basic dependency injection in Magento 2 and it injects an array instead of the class.
di.xml
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Reptilee\DependencyInjection\Core\Test">
        <arguments>
            <argument name="config" xsi:type="object">Reptilee\DependencyInjection\Core\Config</argument>
        </arguments>
    </type>
</config>

Test.php
<?php

namespace Reptilee\DependencyInjection\Core;

class Test
{
    private $config;

    /**
     * Test constructor.
     * @param $config
     */
    public function __construct($config)
    {
        $this->config = $config;
    }
}

Config.php
<?php

namespace Reptilee\DependencyInjection\Core;

class Config
{
    const FOO = 'bar';
}

Here is what I get ...
Reptilee\DependencyInjection\Core\Test {#8020 ▼
  -config: array:1 [▼
    "instance" => "Reptilee\DependencyInjection\Core\Config"
  ]
}

I get a weird array instead of the object... I can't access any properties and methods in this way. Why don't I get the class object instead of this weir array?


texts:
I am trying to figure out how to implement this feature, and I am looking for ideas. This is not specifically a programming question, though. Here are the specs:

The project is a T Shirt store for companies. Employees from various companies can come and order T-Shirts for their company.
We have just 4 designs. I am planning to set these up as 4 configurable SKUs, each with two attributes - gender (man, woman) and size (S,M,L, XL etc). When you choose a T Shirt for a particular company, we just emboss the logo on the T Shirt. We also offer an option of not having the logo embossed on the T Shirt.
I am planning to set a category for each company, and show the 4 configurable products on each of category(company) page.

If I follow the above scenario, my order details will have the purchased products with all the correct attributes, except for the category - so I end up without knowing which company the product was ordered for.

Another worry is that if we keep adding companies, the number of categories may get unwieldy...

Any ideas on how to tackle this will be welcome!
Thanks!