texts:
It is possible to change the catalog grid, of the Magento admin-backend.

That is what I have done. I have added custom attributes to the grid like this:

First I added a new Attribute to the collection in the _prepareColection function

    $collection->addAttributeToSelect('ssp_color');

Then I created a new column in the _prepareColumns function

    //prepare $colorValues
    $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'ssp_color');
    $colorValues = array();
    foreach( $attribute->getSource()->getAllOptions(true, true) as $option ) {
         $colorValues[$option['value']] = $option['label'];
    }

    $this->addColumn('product_color',
        array(
            'header'=> Mage::helper('catalog')->__('Color'),
            'renderer'  => 'Mage_Adminhtml_Block_Catalog_Product_Renderer_Colors',
            'index' => 'ssp_color',
            'width' => '100px',
            'type'  => 'options',
            'options' => $colorValues,
    ));

Now everything works fine. I have a dropdown where I can select the attribute-value and it then gets filtered as you can see here:

The only problem now is, that some products have multiple values of this attribute but the filter only will return when the value of this attribute is exactly the one I was filtering for.

E.g.: I am filtering for orange and want all products which are avaible in orange but can be avaiable in other colors as well. But the filter now is just returning products which are only avaiable in orange.

The question now is, did someone had this problem before and how did this one got solved. Is it a setting in the _prepareColums function? Or does anybody at least know where the standard filter function is, when there is no filter_condition_callback defined for the column?


texts: Help with overwriting .phtml file in Magento 2.2.7

texts:
I need some advice on how to overwrite category description 'block?' from file

  /app/design/frontend/Mgs/mgsblank/Magento_Catalog/templates/category/description.phtml

I want to use my own module which I've created. I've tried many tutorials but still doesn't work.

Basically, I need to load my custom description.phtml with my module.

Appreciate any help


texts:
We are discussing the idea of upgrading from 1.7 to Magento 2.1.

Our current system is
PHP Version
5.3.26
MySQL Version
5.5.31-30.3-log

My preferred method would be to create a sub folder with Magento 2.1 installed and take my time to move stuff over.  I like doing it this way because I may have others working on it as well.  Will there be an issue with upgraded PHP and MySQL for Magento 1.7?


texts: Customer group not changed from "NOT LOGGED IN" during checkout registration!

texts:
We have a reward points extension installed, with a rule to reward when a customer signs up and also points for their purcahse.  It doesn't work correctly when a customer registers during checkout.  The customer group is not changing from "NOT LOGGED IN" it seems.  Is this what happens as standard in Magento, as I need the customer group to change to the default group it is eventually given (after they have made their purchase)??  This issue has held us back from going live! :/

Thanks,

Manny


texts: How to get Product id from specific Product Catalog Rule?

texts:
I created a widget which is a display product section for a specific catalog price rule selected by admin.

Ex: Admin select 20% off on pants from backend & '10' will be limit of displaying product on the frontend, it will display 10 products which is affected by that specific catalog price rule.

I am using custom SQL query to fetch product id as per catalog price rule, everting is working perfectly except SQL query also count child product as a parent product, I need to filter that.

Here is my block where I am getting product ids:

use Magento\Catalog\Model\AbstractModel;
use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Catalog\Block\Product\Context;
use Magento\Widget\Block\BlockInterface;

class Posts extends AbstractModel implements BlockInterface {

  public function myFunction(){
    //Getting the value of catalog rule id & number of limitations for the product.

    $myvalue = $this->_scopeConfig->getValue('CustomSection/Customgroup/Customfield', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
    $myvalue2 = $this->_scopeConfig->getValue('CustomSection/Customgroup/CustomSecondfield', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of object manager
    $resource = $objectManager->get('Magento\Framework\App\ResourceConnection');
    $connection = $resource->getConnection();
    $tableName = $resource->getTableName('catalogrule_product'); //gives table name with prefix
    $sql = "SELECT DISTINCT `product_id` FROM ". $tableName." WHERE rule_id=".$myvalue." LIMIT ".$myvalue2;
    $results = $connection->fetchAll($sql);

    return $results;
  }
 protected $_template = "widget/posts.phtml";
}

currently, it's displaying 10 products which is similar like Parent Product and other 9 will be its child product which is different by color or size, etc

I appreciate if someone helps me to get product id collection by any other way.


texts: Magento 2.3.3 How to change Currency decimal symbol comma to dot in arabic store view

texts:
I want to change currency decimal symbol from comma to dot for Arabic store view.
Below is the solution that I tried but it's not working for all the pages like category, search page, minicart, checkout cart page its only working with product page.
namespace CustomModule\CustomPriceFormat\Model;
use Magento\Framework\Locale\Bundle\DataBundle;

class Format extends \Magento\Framework\Locale\Format
{
    private static $defaultNumberSet = 'latn';

    public function getPriceFormat($localeCode = null, $currencyCode = null)
    {
        $localeCode = $localeCode ?: $this->_localeResolver->getLocale();
        if ($currencyCode) {
            $currency = $this->currencyFactory->create()->load($currencyCode);
        } else {
            $currency = $this->_scopeResolver->getScope()->getCurrentCurrency();
        }

        $localeData = (new DataBundle())->get($localeCode);
        $defaultSet = $localeData['NumberElements']['default'] ?: self::$defaultNumberSet;

        $format = $localeData['NumberElements'][$defaultSet]['patterns']['currencyFormat']
            ?: ($localeData['NumberElements'][self::$defaultNumberSet]['patterns']['currencyFormat']
                ?: explode(';', $localeData['NumberPatterns'][1])[0]);

        //your main changes are gone here.....
        $decimalSymbol = '.';
        $groupSymbol = ',';

        $pos = strpos($format, ';');
        if ($pos !== false) {
            $format = substr($format, 0, $pos);
        }
        $format = preg_replace("/[^0\#\.,]/", "", $format);
        $totalPrecision = 0;
        $decimalPoint = strpos($format, '.');
        if ($decimalPoint !== false) {
            $totalPrecision = strlen($format) - (strrpos($format, '.') + 1);
        } else {
            $decimalPoint = strlen($format);
        }
        $requiredPrecision = $totalPrecision;
        $t = substr($format, $decimalPoint);
        $pos = strpos($t, '#');
        if ($pos !== false) {
            $requiredPrecision = strlen($t) - $pos - $totalPrecision;
        }

        if (strrpos($format, ',') !== false) {
            $group = $decimalPoint - strrpos($format, ',') - 1;
        } else {
            $group = strrpos($format, '.');
        }
        $integerRequired = strpos($format, '.') - strpos($format, '0');

        $result = [
            //TODO: change interface
            'pattern' => $currency->getOutputFormat(),
            'precision' => $totalPrecision,
            'requiredPrecision' => $requiredPrecision,
            'decimalSymbol' => $decimalSymbol,
            'groupSymbol' => $groupSymbol,
            'groupLength' => $group,
            'integerRequired' => $integerRequired,
        ];
        //print_r($result);
        //exit;
        return $result;
    }
}

Any solution available that will work for every page?
Thanks


texts: Custom renderer for custom customer address attribute

texts:
I was able to add 2 custom  address attributes successfully  but these attributes are dependent on each other .

now I am facing an issue with updating customer address from adminhtml , I need to add some ajax ability to these 2 attributes

I looked for an example out there that shows custom renderer and found only examples for catalog attributes and they didn't work for customer address attributes

do you have any example ? or the idea is not doable ?


texts: No css/js on admin panel on live version, works locally on my pc

texts:
On my live version of the website, On the Admin Login css/js is not loading, I don't have this problem anywhere else on my site. How can i solve this? on my local version on my pc it seems to work normally, I did

bin/magento setup:static-content:deploy

bin/magento, bin/magento setup:upgrade

cleared my cache multiple times but it's not working.


texts: URL links not changing for different products

texts:
I'm using Magento API with SOAP, and what I'm trying to achieve is to show the products from my page in an external webpage. I'm showing ID, name, description, image and a link to the page. Everything works fine, except for one thing: The links to the products page are all the same (they all redirect to the first product)

This is my code so far:

<?php
$proxy = new SoapClient('http://127.0.0.1/magento/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy->login('testUser', 'password'); // TODO : change login and pwd if necessary
$pageURL="categorytree.php/";
$result = $proxy->catalogProductList($sessionId);
//var_dump($result);

echo "

";

require_once('/magento/app/Mage.php'); //Path to Magento
umask(0);
Mage::app();

$productModel = Mage::getModel('catalog/product');
//var_dump($productModel->getProductUrl);

foreach($result as $product)
{
    echo "ID: $product->product_id
";
    $productID = $product->product_id;
    echo "Name: $product->name
";
    $p = $productModel->load($productID);
    $description = $p->getDescription();
    echo "Description: $description
";
    $imageUrl = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . 'catalog/product' . $p->getImage();
    $product_collection_url = $p->getProductUrl();
    $product_collection_url = str_replace($pageURL,"",$product_collection_url);
    echo "Image:
";
    echo "link to page
";
    echo "
";
}
echo "

";
?>

First I thought it had something to do with the for loop, but each product id, name, description is correct, $product_collection_url is the one causing trouble.

It looks like $p->getProductUrl only works the first time?


texts: I am looking for a little help setting up a 25% discount on selected products. I would like it so that if a collection of products are added to the basket a 25% discount is applied.


texts:
How can i remove category title (H1) from a specific page of catalog?
I deleted breadcrumbs using a code xml:

 <remove name="breadcrumbs"/>

Is it possible to replicate this with H1? Thanks!


texts: How to get Current Currency SIGN in UI component field

texts:
I have created a Custom Module using the UI Component on Admin Side. Now i Need to show a Current Currency Sign in this field.

SS:


texts: How to generate a pre-patched version of Magento 1 SUPEE patch?

texts:
Some people like Meetanshi has pre-patched version of Magento 1 SUPEEs. How they generate those files?

This is very useful for people (Like me) who are not able to apply patches via SSH from .sh files.


texts: display pop up working in addtocart.phtml but not in custom .phtml file

texts:
We are using below code in addtocart.phtml to display pop up box  once we click on "save design" buttton, its working fine.

Click Here

<div onclick="setproductlogin('<?php echo $_product->getEntityId()?>');setrequestlogin();">
    <button class="button btn-cart">Save design</button>

we are using same onclick code for another button present in below phtml file :

onclick="setproductlogin('<?php echo $_product->getEntityId()?>');setrequestlogin();"

app/design/frontend/rwd/Theme1/template/aitcg - js_styles1.phtml

<?php $_product = $this->getProduct(); ?>

Click Here

but after this Product view page will become blank , There is no errors in log files

Edit

console error after click on "save design" in link

Uncaught SyntaxError: Invalid or unexpected token


texts: Cart page update with AJAX using increment/decrements button

texts:
I am trying to update cart without refreshing when someone clicks on-increment or decrement button by creating custom module.

I override the cart/item/default.xml and add button, script to send formkey & qty of the updated cart to updateItemQty controller, I am trying to achieve the same functionality of update shopping cart button with my increment/decrement button

Here is File path which I override:

  Module-checkout/view/frontend/templates/cart/item/default.phtml

File: default.xml

<label for="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty">
                <?= $block->escapeHtml(__('Qty')) ?>
                <button type="button" id="increaseQty">+</button>
                <input id="cart-<?= $block->escapeHtmlAttr($_item->getId()) ?>-qty"
                       name="cart[<?= $block->escapeHtmlAttr($_item->getId()) ?>][qty]"
                       data-cart-item-id="<?= $block->escapeHtmlAttr($_item->getSku()) ?>"
                       value="<?= $block->escapeHtmlAttr($block->getQty()) ?>"
                       type="number"
                       size="4"
                       title="<?= $block->escapeHtmlAttr(__('Qty')) ?>"
                       class="input-text qty"
                       data-validate="{required:true,'validate-greater-than-zero':true}"
                       data-role="cart-item-qty"/>
                <button type="button" id="decreaseQty">-</button>
                <input name="form_key" id="form_key" type="hidden" value="<?php echo $block->getFormKey();?>">

and here is the script:

<?php
   //-- form key load
   echo $this->getBlockHtml('formkey');
?>
<?php echo $this->getBlockHtml('formkey'); ?>


texts: Magento 2 get Order Collection and product sku

texts:
I need a way to get latest 100 Orders including the ordered sku(s).

This is what I tried:

use Magento\Framework\View\Element\Template;

class Orders extends Template
{
protected $_orderCollectionFactory;

public function __construct(
        \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
        \Magento\Framework\View\Element\Template\Context $context,
        array $data = [])
    {
        $this->_orderCollectionFactory = $orderCollectionFactory;
        parent::__construct($context, $data);
    }
protected function _prepareLayout()
{

    // get last 100 orders
    $ordercollection =$this->_orderCollectionFactory->create()->addFieldToSelect(array('*'));
    $ordercollection->setOrder('entity_id','DESC');
    $ordercollection->setPageSize(100);
    $ordercollection->setCurPage(1);

    $this->setOrdersColl($ordercollection);
}
}

In my template file:

<?php
    $ordercollection1 = $this->getOrdersColl();

    foreach ($ordercollection1->getItems() as $order) {
        echo "<br>order: ".json_encode($order->getData());
    };
?>

Result:
The Orders are printed out individuallay as arrays, each containing order informations (as array elements).

BUT I am missing the ordered product sku or id in those order arrays.

I need to know which products were ordered.
Any help on how I can get sku of the ordered item ?

Thanks


texts:
Can somebody explain where does 'address' variable come from in i.e file

  app/code/Magento/Checkout/view/frontend/web/js/view/shipping-information

'address' is used many times as argument into functions i.e

  createRendererComponent: function (address)

But I cant see declaration of this variable. Why it is accessible from this context?


texts: Multilingual image names depending on store view

texts:
We would like to name the images associated to a product according to the product name. The product name, however, is different depending on the storeview (in our case, language).

Associating an image with a product for any store view also associates the image to all other store views which leaks the language of the storeview that the image was associated with into all other storeviews.

An example:

Product 10001217 is called "magnetic sticker" in one storeview and "Magnetetikett" in another storeview. The product image "10001217.jpg" needs to be associated to the product, however, naming the file "magnetic-sticker.jpg" and "magnetetikett.jpg" for the storeviews helps search engines associate the image contents with the product it represents.

Is this in any way possible?


texts: One or more of the Cache Types are invalidated: Layouts

texts: I already handled this error when any product is saved using magento event observer but saving any cms page from admin i still receiving this error. Any help would be appreciated.


texts: Magento 2 - Use search criteria to find configurable using attribute of their children

texts:
I have product X which is configurable. To product X I have assigned product Y and Z as simple ones.
Both simple has attribute "Color". Now product Y has color: 123, product Z has color: 456. Both have also visibility as "non visible individually".
I'd like to search product X using in search criteria value 123 or 456 and kind of field "color".
Is it possible? Do you know any tip how can I reach it?
I am using Magento 2.4 and want to get data by REST API.


texts: Override Newsletter Subscriber Controller - not working

texts:
I realise, there are several Questions that are basically the same - with solutions. Sadly, I still can't figure out what is wrong.

Problem:
I'd like to extend the Mage_Newsletter_SubscriberControllerto add some custom code.
The new Controller, which extends said controller, is never called.

We use Magento 1.9.2.1 with some manual security patches.

Here is what I've done, so far:

Registered a new Module in app/etc/modules/MM_Newsletter.xml

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

Set how it should override the controller in app/code/local/MM/Newsletter/etc/config.xml

<?xml version="1.0" encoding="utf-8"?>
<config>
    <modules>
        <MM_Newsletter>
            <version>0.1.0</version>
        </MM_Newsletter>
    </modules>

    <frontend>
        <routers>
            <newsletter>
                <!--<subscriber>-->
                    <!--<new>-->
                        <args>
                            <modules>
                                <MM_Newsletter before="Mage_Newsletter">MM_Newsletter</MM_Newsletter>
                            </modules>
                        </args>
                    <!--</new>-->
                <!--</subscriber>-->
            </newsletter>
        </routers>
    </frontend>
</config>

With the commented nodes I tried to reflect the actual route that is called from the frontend. Either way, it doesn't work.

Extended the Controller in app/code/local/MM/Newsletter/controllers/MM_Newsletter_SubscriberController.php

<?php

require_once Mage::getModuleDir('controllers', 'Mage_Newsletter').DS.'SubscriberController.php';

class MM_Newsletter_SubscriberController extends Mage_Newsletter_SubscriberController{

    public function newAction()
    {
       // some custom code ...

        parent::newAction();
    }
}

The custom code is never executed.
The caches are always emptied, when I push changes to the server. They are guaranteed to be empty, even though I checked manually, too.
XDebug is set up and breakpoints in the custom controller are never hit.
When i let it die(), to see if just the debugger doesn't register correctly, it also just calls the original controller and does not perform the custom code.

Is there something missing?
FYI: I also tried the older rewrite syntax in the xml config, which didn't work either.

Any help is greatly appreciated!


texts: When you duplicate a simple product what do you do with the url

texts: When you duplicate a simple product, what do you do with the url?


texts: Magento 2: Customizing the template files

texts:
When we customize the core template files in Magento 2, how should we name the folder in the custom theme?.

For example, I want to customize the template file in \vendor\magento\module-advanced-search, how would I name the folder in the Custom theme?


texts: Magento 2 - Customer Custom File Attribute unable to save

texts:
I have Created my own Customer Attribute, it was a File attribute.
While try to upload a file in that, it shows error like,

"<File Field Name>" is not a valid file.

While checking in Media folder,

There was sub-folders created under customer folder.

But there was no files there.

Example:

If I upload a file like this, abcd.pdf , then it creates folder like this,

/pub/media/customer/a/b/

Can any one help me to fix the issue.?

Here is my Attribute Creation code

    $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();

    /** @var $attributeSet AttributeSet */
    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

     $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]);

    $customerEntity = $customerSetup->getEavConfig()->getEntityType('customer');
    $attributeSetId = $customerEntity->getDefaultAttributeSetId();

    /** @var $attributeSet AttributeSet */
    $attributeSet = $this->attributeSetFactory->create();
    $attributeGroupId = $attributeSet->getDefaultGroupId($attributeSetId);

      $attributeList['my_file'] = [
            'type' => 'varchar',
            'label' => 'My File',
            'input' => 'file',
            'required' => false,
            'visible' => true,
            'user_defined' => true,
            'sort_order' => 150,
            'position' => 150,
            'system' => 0,
            'validate_rules' => serialize(['max_file_size' => 1048576, 'file_extensions' => 'pdf'])
        ];
   foreach ($attributeList as $key => $value) {
        $customerSetup->addAttribute(Customer::ENTITY, $key, $value);

        //add attribute to attribute set
        $attribute = $customerSetup->getEavConfig()->getAttribute(Customer::ENTITY, $key)
                        ->addData([
                            'attribute_set_id' => $attributeSetId,
                            'attribute_group_id' => $attributeGroupId,
                            'used_in_forms' => ['customer_account_edit', 'checkout_register', 'adminhtml_customer']
                        ]);

        $attribute->save();
    }


texts: cancel an order customer did not receive an email

texts:
I like to send an email to customer if admin cancel an order.

Please help to solve the solution.

Thank you.


texts: Show message on checkout page if customer is not in a EU

texts:
I want to display a specific content block whenever a customer is finishing his order and he is not located inside an EU-Country (like Swiss or Russia or America).

How can I achieve this?

I was thinking about creating a custom module that extends the checkout and checks for specific order details.


texts: How to show the highest Configurable Product price in magento 2

texts:
How to show the highest Configurable Product price in Magento 2.

At the basis, Magento shows the lowest price ( from the simple product ) for configurable products.

Is there a way to display the highest price for all configurable products?

Hope someone can help me out!

Thanks in advance.


texts: Can't get the current language in template file

texts:
I am trying to set language ico in the frontend.
I try to get the language name using Mage::getStoreConfig('general/country/default');   but I get an error:
This is my setting.phtml

<?php
$id = $block->getIdModifier() ? '-' . $block->getIdModifier() : '';
?>
<div class="custom-group setting-links dropdown" id="setting-links<?php echo $id?>">

         <?php echo  Mage::getStoreConfig('general/country/default'); ?>

            <?php echo $this->getChildHtml('currency_custom') ?>

            <?php echo $this->getChildHtml('store_language_custom') ?>

This generates an error :

  PHP Fatal error:  Uncaught Error: Class 'Mage' not found in
  /var/www/html/app/design/frontend/Venustheme/fasony/Magento_Theme/templates/html/setting.phtml:15


texts: Manual installation of a magento extension

texts:
I am trying to install a Magento extension manually by uploading the file directly and bypassing the "magento connect".
the problem is that I get an error when I'm on the backend as what tables and fields have not been created.

how do I create tables in the database?


texts: Get Product Price After Catalog Rules And Vouchers

texts:
This question has sort-of been asked over here: https://stackoverflow.com/questions/8254682/magento-getting-discounted-price

I need to get the price of a product AFTER Shopping Cart Price Rules have been applied. I need the price on the checkout confirmation (success) page.

For example, product A costs 9.90. I apply a discount code discount of 50%. The price is now 4.95. I pay and checkout. On the order confirmation page, I need to retrieve the price.

I've tried:

Mage::getModel('catalogrule/rule')->calcProductPriceRule($prod, $prod->getPrice());

And...

Mage::getModel('catalogrule/rule')->calcProductPriceRule($prod
    ->setStoreId($this->getCurrentStoreId())
    ->setCustomerGroupId($this->getCurrentCustomerGroupId()),
    $prod->getPrice()
);

But it always returns null. Can I achieve this without rewriting the whole logic of the rules?

I'm developing a local module for this and using Magento 1.7.0.2 CE. Thank you.

~ edit ~

The meat and potatoes of my code looks as follows:

public function getLatestOrder()
{
    $order = Mage::getModel('sales/order')->getCollection()
        ->addAttributeToSelect('*')
        ->setOrder('entity_id', Varien_Data_Collection::SORT_ORDER_DESC)
        ->getFirstItem();
    return $order;
}

// iterate as follows:

$items = $this->getLatestOrder()->getAllVisibleItems();
foreach ($items as $item) {
    echo $item->getPrice();
}

The value for $item->getPrice(); is the full price for each item, even though a 99.9% discount voucher was applied.


texts: media url not working for product description wysiwyg editor

texts:
I have added this  to product description. But this is not converting to URL.
I have configuration as bellow for Editor.
WYSIWYG Editor: TinyMCE 4
Use Static URLs for Media Content in WYSIWYG: tried with both Yes & No.


texts:
Can anyone help me to edit styles-i.css in magento2
It is showing the path in pub directory but no structure in design theme files

Thanks


texts: Magento under WordPress as subdirectory not working

texts:
I am using GoDaddy server.

I have WordPress as root directory and i have setup Magento from local to server inside root as subdirectory.

Magento home page is working fine,but when i try to open any subpage of Magento then it opens "About us" page without CSS of root WordPress.

Here is my Magento site link:

http://shreeyaitsolutions.com/sub-domains/magentostore/


texts: I'm using magento 2 and I would like to include a javascript file , '' just into a page , for example about us page.. which file should I edit to do that, so I can add that code ?


texts: Increase number of shown related products in the administration (Magento 2)

texts:
When you edit a product in the magento administration the number of items listed in the related products, up-sells and cross-sells list is limited to 20. Also there is no possibility to change this like in felt every other grid.

I tried to fix this programmatically by creating an observer which sets the default limit to 50. The observer is called correctly (when adminhtml_block_html_before is fired) but nothing changes.

Any thoughts on this?


texts: cron.php doesn't performs on the first run

texts:
When manually calling the cron.php like www.example.com/cron.php ,
it doesn't runs for the first time.

After that it runs.

Dont know why this happening.


texts: In magento 2, how to to make server call from knockout js to validate phone number in checkout page which already exist in my list?

texts:
How can i validate the telephone number already exist in my my database table(or suggest me, how to to make server call from knockout js to validate phone number which already exist in my list).My actual scenario is i need to verify otp only for the new telephone numbers.For already verified OTP number i will not want to verify OTP. Can you please suggest any idea or sample code to achieve this.

For reference:How to add custom button under the phone number field in one page checkout in Magento 2?


texts: Magento 2 .Error : Cannot use a scalar value as an array

texts:
I'm using Magento 2.2.1 CE.I got following error when I opened admin panel

   "0":"Warning: Cannot use a scalar value as an array in
\\vendor\\magento\\framework\\Session\\SessionManager.php on line 470"

How to solve this ?


texts: Magento 2 : Increase sold count after order status completes

texts:
I'm new to Magento 2.
I want to show the sold count of product only after the order was complete.

I have used this code to display count.

$_product = $block->getProduct();
$sku = $_product->getSku();
$objectModelManager = \Magento\Framework\App\ObjectManager::getInstance ();
$soldproduct = $objectModelManager->get('Magento\Reports\Model\ResourceModel\Product\Sold\Collection')->addOrderedQty()->addAttributeToFilter('sku', $sku)->setOrder('ordered_qty', 'desc')->getFirstItem();
$soldnumber = $soldproduct->getOrderedQty();
?> <div class="sold_count"><b>Sold Count: </b> <?php echo (int)$soldnumber;?> </div>

But for every order placement the count is increasing.But I want show the count of products whose status was completed.

Thanks in advance


texts:
Once started, is there any way to cancel the Media Synchronization?

I have a very large collection of files in the database and have again run out of disk space; Magento will happily continue creating 0kb files in the media folder until it has finished.


texts: Customise a custom product attribute input renderer in Magento 2 the right way

texts:
I'm facing to a very ridiculous trouble, I added a custom product attribute with source model, backend model as a select box. Everything works fine (my custom attribute will get the values from a custom table) except the input_renderer part.

Here is what I tried, (running on default mode)

  Setup\MySetup.php

public function getDefaultEntities()
{
    return [
        'catalog_product' => [
            'entity_model' => 'Magento\Catalog\Model\ResourceModel\Product',
            'attribute_model' => 'Magento\Catalog\Model\ResourceModel\Eav\Attribute',
            'table' => 'catalog_product_entity',
            'additional_attribute_table' => 'catalog_eav_attribute',
            'entity_attribute_collection' => 'Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection',
            'attributes' => [
                'custom_ids' => [
                    'type' => 'static',
                    'input' => 'select',
                    'label' => 'Custom Attribute',
                    'global' => ScopedAttributeInterface::SCOPE_GLOBAL,
                    'backend' => 'Vendor\Module\Model\Product\Attribute\Backend\CustomAttr',
                    'source' => 'Vendor\Module\Model\Product\Attribute\Source\CustomAttr',
                    'input_renderer' => 'Vendor\Module\Block\Adminhtml\Product\Helper\Form\CustomAttr',
                    'required' => false,
                    'sort_order' => 9,
                    'visible' => true,
                    'group' => 'General',
                    'is_used_in_grid' => false,
                    'is_visible_in_grid' => false,
                    'is_filterable_in_grid' => false,
                ],
    ];
}

  Block\Adminhtml\Product\Helper\Form\CustomAttr.php

class CustomAttr extends \Magento\Framework\Data\Form\Element\Select
{
    public function getAfterElementHtml()
    {
        if (!$this->isAllowed()) {
            return '';
        }

        $htmlId = $this->getHtmlId();
        $suggestPlaceholder = __('start typing to search custom attribute');
        $selectorOptions = $this->jsonEncoder->encode($this->getSelectorOptions());
        $backendUrl = $this->backendData->getUrl('vendor_module/customattr_index/index/suggestCustomAttr');

        $return
            = <<<HTML
   /** Some HTML and JavaScript here **/
HTML;

        return $return;
    }
}

I tried to die() inside getAfterElementHtml() method, but nothing happens. I even go to the database and change the value of column frontend_input_renderer in table catalog_eav_attribute to something doesn't exists.

But there is NO ERROR at all !!! Magento 2 just simply to denied to call my input renderer :)

Anyone here have any suggestions or a best pratices for this?

Thank you.


texts: Custom model date field did not save current time in table

texts:
I have create an model in magento at a custom module and  in that model i have create  table and that table have  a date field and i want save my current date in that date field but it becomes inserted  value null at that table

Table Sql:

CREATE TABLE IF NOT EXISTS `social` (
  `social_id` int(10) NOT NULL AUTO_INCREMENT,
  `image` text NOT NULL,
  `likes` int(10) DEFAULT NULL,
  `caption_text` text,
  `comments` int(10) DEFAULT NULL,
  `insert_time` date DEFAULT NULL,
  PRIMARY KEY (`instagram_id`),
  KEY `likes` (`likes`,`insert_time`),
  KEY `comments` (`comments`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;

Model insert  code:

$data=array(
'image'=>$url,
'likes'=>$item->likes->count,
'caption_text'=>$item->caption->text,
'comments' =>$item->comments->count,
'insert_time'=>date ('Y-M-d'),
);
$model=Mage::getModel('social/social')->addData($data);
$model->save();

Why in date filed insert_time save all value as Null instead of current date?


texts: Magento 2 - Loading an Order through API

texts:
We need to call API's in order to get order details. We are doing so in a dev environment. What happens is that we are not calling any order by the "order_id", instead we use the entity_id.

<web>/rest/V1/orders/8

We instead want to use:

<web>/rest/V1/orders/086190004

Is that possible? In the Magento docs it says:

We want to be able to load these orders by the order_id.


texts: How to call the special price and wish list in the product grid of the module from Adobe Sensei?

texts:
How to call the special price and wish list in the product grid of the Magento_ProductRecommendationsLayout module from Adobe Sensei?
I am putting together a carousel of recommended products and I need them to have the special price and the wish list too, the structure is made with Knockout, can someone help me please?


texts: Magento getData() vs getFieldName() in model

texts:
After load('id') function in model, we can get data by either model->getData('field_name') or model->getFieldName().

I know that both functions are provided by DataObject class but what I want to know is

Is there any different between them ?
What should I use ?


texts: Cannot add 2 blocks with phtml to one layout.xml file

texts:
I have a page served up by the controller landing_index_index that brings in a couple of blocks to serve phtml. Now, when I bring in just one block:

<referenceContainer name="content">
        <block class="Vendor\Module\Block\Landing" name="landing" template="landing_page.phtml" />
    </referenceContainer>

Everything is just fine. But when I bring in multiple, like this:

<referenceContainer name="content">
        <block class="Vendor\Module\Block\Landing" name="landing" template="landing_page.phtml" />
    </referenceContainer>

    <referenceContainer name="root">
        <block after="content" class="Vendor\Module\Block\Footer" name="landing" template="usfrienbr_footer.phtml" />
    </referenceContainer>

The first block no longer displays at all. If I do footer first and then the main page, only the main page will show. What am I doing that is causing this overwrite? Is it the name? If I change that I get a crash, because I think the name is supposed to correspond to the routes right?


texts: Make sure no products are in database before running integration tests

texts:
I am unit- and integration-testing an import/export extension using EcomDev_PHPUnit. For some of the tests I have to make sure that no products are in the database. The problem is that some 3rd party modules are creating products but don't clean up afterwards. What is the best way to work around?

In my opinion the cleanest approach would be to define a fixture telling EcomDev_PHPUnit that I don't want to have any products in the database. Something like that:

eav:
  catalog_product:

I'm afraid this isn't implemented in EcomDev_PHPUnit. (Is it?)

Another guess of mine would be I have to add some code to my setUp-method which deletes all products available via the product collection.

The most error-prone way would be to define all product-related tables in the fixture and to have EcomDev_PHPUnit empty them.

Mighty gods of automated testing, please send me a hint!

PS: I know that normally you would mock results and don't test the actual writing to the database. As the tests should verify that products are written to the database recognized by Magento as intended I guess I have to do it this way. I'm open to suggestions anyways.


texts:
I need to update a configurable product but when I go to product and "create configuration" I read  this

  When you remove or add an attribute, we automatically update all
  configurations and you will need to recreate current configurations
  manually.

Is there a way to add configurable product without deleting those already created?


texts: Hide a specific row in product specification

texts:
I use a data content provider, I get product pictures and all information pushed into my server but some of the information I don't want to show up on the front end. If you want to take a look at my site see link below:
http://www.terabytecomponents.co.uk/cooler-master-cm-590-iii-white-3404.html

Click on the "more information" tab and if you scroll to the bottom there are 2 sections at the bottom named "Sinch Search Cache" & "PDF Url".

How can I remove these?
It'll be across the whole catalog not just the link I have given.


texts:
I know its possible to set custom customer attributes using various extensions however I haven't yet found one which suits my needs.

I need to allow customers to add multiple sets of the same attributes within their profile / my account - ,uch like how customers add multiple addresses.

I could of course add the following fields custom customer fields

set_1_field_1
set_1_field_2
set_1_field_3

set_2_field_1
set_2_field_2
set_2_field_3

However the issue with this is that I am hard coding in a limit of the amount of sets the customer is allowed to add. I would like the customer to be able to update their profile with no upper limit.

Could anyone suggest an extension that will help me or the best way to tackle this


texts: Magento 2 how to interchange position of store view and Default welcome msg in luma theme

texts: How to interchange the position of store view and Default welcome msg in luma theme Magento 2.1.7


texts: In Magento 1.9, based on a condition, change checkout/onepage layout

texts:
I want to change a checkout/onepage layout based on a condition.

Example:

<?php
    $coupon = Mage::getSingleton('checkout/session')->getQuote()->getCouponCode();
    if(($coupon == "SE50") || ($coupon == "SE00")){
    }
?>

To showcheckout.xml

<action method="setTemplate"><template>page/2columns-right.phtml</template></action>

I mean this page:

if(empty($coupon))

<action method="setTemplate"><template>page/checkout-onepage.phtml</template></action>

A page like:

Note: checkout-onepage.phtml is a custom page.


texts: What problems should I anticipate if I prefix order IDs with alphanumeric characters?

texts:
My client would like to prefix order IDs with descriptive multi-store abbreviations such as WS00000000 (Wholesale), AFF0000000 (Affiliate), RE00000000 (Retail), LS00000000 (Living Social), etc. Its purpose is to make communicating orders through phone support and fulfillment more efficient. Certain shipping rules and order history can be deemed by knowing the origin of the order.

I read another case of a developer attempting it on older versions of Magento as seen here:

http://chilipepperdesign.com/2009/07/09/changing-magento-order-invoice-and-shipping-numbers/

As I assumed, you would need to update all fields storing the order ID from integer to text. I understand that this might complicate upgrades but if I can turn this process of conversion into a script then I can reproduce this on future installs. What other unforeseen problems should I anticipate? Thank you.


texts: How to create menu section title in adminhtml?

texts:
I want to add section (menu items group) into adminhtml menu in Magento 2. Something like this:

I've added file ./etc/adminhtml/menu.xml with:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Vendor_Module::section"
             title="Section"
             translate="title"
             module="Vendor_Module"
             sortOrder="50"
             resource="Vendor_Module::section"/>
    </menu>
</config>

but I cannot see new section in the adminhtml menu.


texts: How to get all product attribute of a attribute group of Default attribute set?

texts:
I want to get the collection of all product attributes of an attribute group in the Default attribute set in Magento 2.

Is there any filter available like group_id or group name or something else ?


texts: If have the frontend session ID, how can I load the quote associated with that?


texts: Auto trigger new shipment email in magento

texts:
I have an inventory system called BrightPearl that manages all of my orders for magento (1.9.1) that is connected to shipstation. When an order is processed (i.e a labels is printed) ship station will send the data to brightpearl and brightpearl will then send the data to magento.

The order is marked complete and the tracking number is entered into the order.

The problem is that the shipment notification email is not being sent out.

Is there something that I can do that will auto send out all of those emails every hour (or every half day) or is there a setting that I need to select that will send those emails out automatically when a tracking number is added to the order and a shipment "invoice" is created?

Thanks!


texts: How to redirect on checkout page, after add to cart click on bundle product?

texts:
I need to integrate small stuff.

When I will click add to cart ( bundle product )  then only product added successfully in cart page and then redirect into the checkout page.

So please let me help.
Please make sure only bundle product.


texts: Magento 1.9.1 display subcategory image beside in navigation dropdown

texts:
I want to show category(subcategory) image beside my main navigation dropdown.
I have tried with following script

I just copied the Observer.php and Navigation.php from app\code\core\Mage\Catalog\

to my local(app\code\local\Mage\Catalog)

and in observer.php i added the line in function(_addCategoriesToMenu)

$categoryData = array(
                'image_url' => $category->getThumbnail(),
                 'name' => $category->getName(),
                'id' => $nodeId,
                 'url' => Mage::helper('catalog/category')->getCategoryUrl($category),
                'is_active' => $this->_isActiveMenuCategory($category),                 'thumbnail' => Mage::getModel('catalog/category')->load($category->getId())->getThumbnail()
             );

and in navigation.php (_renderCategoryMenuItemHtml)

$html[] = 'getCategoryUrl($category) . '"' .
 $linkClass . '>'; $html[] = '' .
 $this->escapeHtml($category->getName()) . ''; $html[] = '';

I can not found the image url by this function $category->getThumbnail();

How do i fetch the image url to show in navigation dropdown


texts: How to get collection product filter by custom attribute in Magento 2

texts:
i want get all product has "daily = 1", i tryed this code but it get all data product. Please help me.

public function getProductCollection(){
      $productCollection = $this->_productCollectionFactory->create();
      $productCollection->addAttributeToSelect('*');
      $productCollection->addAttributeToFilter('daily_offers', '1');
      var_dump($productCollection->getData('daily_offers'));exit;
      return $productCollection;
 }


texts: magento 2 system configuration table feilds(file)

texts:
protected function _prepareToRender()
    {
        $fileInputRenderer = $this->getLayout()->createBlock(CustomShippingFile::class);
        $this->addColumn(
            'shippingLogo',
            [
                'label' => __('Shipping Logo'),
                'renderer' => $fileInputRenderer
            ]
        );
        $this->_addAfter       = false;
        $this->_addButtonLabel = __('Add');
    }

And CustomShippingFile.php is
protected function _toHtml()
    {
        $column = $this->getColumn();
        return '<input type="file"/>';
    }

In the database it save only shipping name and status. It not save file and also not upload file in media folder.
Can anyone help me here.
In database it save
{"_1593009455280_280":{"shipping_company_name":"TCS","shippingStatus":"1"}}


texts: what is translate=“label” in xml file what it does?

texts:
I am working with Magento XML files and I found

translate=" label"

 <tabs>
     <training translate="label" module="training">
         <label>training</label>
         <sort_order>50</sort_order>
     </training>
 </tabs>

I want to know how it works?


texts: How to find out which Magento module is customize/extended in Magento EE 2.3.x?

texts:
How to find out which Magento module is customize/extended in Magento EE 2.3.x ?

Is there any CLI? or any other way to get this done?

Please reply as soon as possible.


texts:
I want to apply a functionality that enables , dynamic billing address to be changed as per changing shipping address in checkout page magento 2.
How to get shipping address from quote object in custom js file magento 2 ?

Appreciate your help.


texts: How to give custom menu access/permissions to a role?

texts:
I created a new custom menu in backend. Now I want to select this new menu in order to give permissions (or not) to the roles that I have on my website. The problem is that this new custom menu doesn't appears in the resources of the role. You can see this menu only if you have all the access granted.

<?xml version="1.0"?>

<config>
    <menu>
        <sales>
            <children>
                <pump_orders translate="title" module="pump_orders">
                    <sort_order>10</sort_order>
                    <title>Orders - Pump</title>
                    <action>adminhtml/order/</action>
                </pump_orders>
            </children>
        </sales>
    </menu>
</config>

Anyone knows how to solve this ?


texts: Magento admin payment additional information show HTML tags

texts:
1.Magento 1 version : 1.9.4.0

2.Magento 2 version : 2.3.5

3.Fresh install of m2

4.Run migrate:settings

5.Run migrate:data All data is migrated

We migrated data successfully but getting issues of html tags on invoice pages. Admin->Sales->Invoices->Click on any invoice->Invoice page will open "Payment Information" under "Payment & Shipping Method" head here Data(content or description) showing in html tags

M1 (table name - sales_flat_order_payment,column name - additional_information)-

a:1:{s:12:"instructions";s:889:"
WU Instructions: Western Union is a common way for people to send any currency to the USA. For Western Union you can either use their website, or go to a nearby Western Union store. Once you do this, email us back the information.

To find your nearest location, go to:
locations.westernunion.com
Bring your invoice, and this information with you to the Western Union store. This is the "Receiver" information:

* Name: Sumeet bajaj
* Street: 123 N 123th ST
* City, State &amp; Zip: Seattle, Washington State, 98133
* Country: USA
* Phone: 123-456-4789

When the money is sent, email us back: WU Control number; Senders full name, Senders City, State, and Country. That is it.
";}

M2 (table name - sales_order_payment,column name - additional_information)-

{"instructions":"
WU Instructions: <\/strong>Western Union is a common way for people to send any currency to the USA. For Western Union you can either use their website, or go to a nearby Western Union store. Once you do this, email us back the information.<\/p>
To find your nearest location, go to:
locations.westernunion.com<\/a>
Bring your invoice, and this information with you to the Western Union store. This is the \"Receiver\" information: <\/p>
* Name: Sumeet bajaj<\/strong>
* Street: 123N 456th ST<\/strong>
* City, State &amp; Zip: Seattle, Washington State, 98133<\/strong>
* Country: USA <\/strong>
* Phone: 123-456-7890<\/strong><\/p>
When the money is sent, email us back: WU Control number; Senders full name, Senders City, State, and Country. That is it.<\/p>"}

M1 screenshot -

M2 screenshot -

M1 data might be serialized and M2 using json format

How to show content like M1(without HTML tags) ?


texts: unable to load image in pub/media/customer

texts:
I have images in pub/media/customer directory but when i tried to access the image by load it using browser, i got file not found response. I have commented this line in nginx.conf.sample
#location /media/customer/ {
#   deny all;
#}

in my magento root folder as it was suggested in this thread and restarted my nginx but the image still not found.


texts:
I want to add select field to adminhtml form to select month. I've found

  \Magento\Config\Model\Config\Source\Locale\Weekdays

provider for weekdays:

    <field name="month">
        <argument name="data" xsi:type="array">
            <item name="options" xsi:type="object">Magento\Config\Model\Config\Source\Locale\Weekdays</item>
            ...
        </argument>
    </field>

What provider should I use to get month selector?


texts: Display On Sale Product On Top Sorting Magento 2

texts:
I have added a custom sorting option in default sorting menu by overriding toolbar.php file

I want to display  products with the highest discount on top using sorting and product with no discount should also be displayed  after all discounted product

Following is my Toolbar.php  file

<?php
 namespace Vendor\ModuleName\Plugin\Product\ProductList;
class Toolbar
{

/**
 * Plugin
 *
 * @param \Magento\Catalog\Block\Product\ProductList\Toolbar $subject
 * @param \Closure $proceed
 * @param \Magento\Framework\Data\Collection $collection
 * @return \Magento\Catalog\Block\Product\ProductList\Toolbar
 */

public function aroundSetCollection(
    \Magento\Catalog\Block\Product\ProductList\Toolbar $subject,
    \Closure $proceed,
    $collection
) {
    // die(print_r($subject));
    $currentOrder = $subject->getCurrentOrder();
    $result = $proceed($collection);
    if ($currentOrder) {
        // if ($currentOrder == 'price_desc') {
        //     $subject->getCollection()->setOrder('price', 'desc');
        // } elseif ($currentOrder == 'price_asc') {
        //     $subject->getCollection()->setOrder('price', 'asc');
        // }
        if ($currentOrder == 'created_at_new') {
            $subject->getCollection()->setOrder('created_at', 'desc');
        }
        elseif ($currentOrder == 'created_at_old') {
            $subject->getCollection()->setOrder('created_at', 'asc');
        }
        elseif ($currentOrder == 'bestseller') {
            $subject->getCollection()->getSelect()->joinLeft(
            'sales_order_item',
            'e.entity_id = sales_order_item.product_id',
            array('qty_ordered'=>'SUM(sales_order_item.qty_ordered)'))
            ->group('e.entity_id')
            ->order('qty_ordered desc');
        }
        elseif ($currentOrder == 'onsale') {

        }
    }

    return $result;
}
}

Following Image Is Output of Sorting Menu


texts:
I am using Magento 2.2 REST API. I could not find the URL to get Products using store id. Using Store Code in URL is not working. The URL I tried is:

  http://{{serverIP}}/index.php/rest/store_code/V1/products?searchCriteria[pageSize]=20&searchCriteria[currentPage]=1


texts: Magento 2: New Order Status is not displaying in Listing

texts:
In Admin on Order Status :- Complete state I added new order status "Collect", "Deliver".

I have changed order status with script so it changes in sales_order table state & status.

With script it's changing state & status in Database.

I already done indexing.

When I go to Admin -> Sales -> Order list it always show Complete in listing. When i go to that order detail page then it displays my new Collect/Deliver status.

Why it's not displaying in Listing?


texts:
what is the correct event which should fire when a customer ordered something and is being redirected to the success page. After the redirect to the success page the event should fire.

Thanks in advance!


texts: AOE scheduler Multiple tasks with the same job code were piling up. Skipping execution of duplicates

texts:
Since yesterday I have a problem with one cronjob that is not running anymore. This cronjob was working fine for several months and yesterday we had to stop it and then re enabled it 6 hours later. I'm using AOE scheduler and in the Schedule task list view I see that the cronjob was missed and the message says:

  Multiple tasks with the same job code were piling up. Skipping execution of duplicates

This is strange because looking at the schedule there are no multiple tasks with the same job code at that given time.

This message seems to be coming from here:

  app/code/community/Aoe/Scheduler/Model/ScheduleManager.php

foreach ($schedules as $key => $schedule) {
    /* @var Aoe_Scheduler_Model_Schedule $schedule */
    if (isset($seenJobs[$schedule->getJobCode()])) {
        $schedule
            ->setMessages('Multiple tasks with the same job code were piling up. Skipping execution of duplicates.')
                ->setStatus(Aoe_Scheduler_Model_Schedule::STATUS_SKIP_PILINGUP)
            ->save();
    } else {
        $seenJobs[$schedule->getJobCode()] = 1;
    }
}

I tried several things, like running the cron manually using magerun (this works well) stoping and starting again the cron, re generating the schedule but I get the same problem. Any ideas why this is happening? Is just strange since it was working fine for so long.


texts: Programmatically run Catalog product flat index

texts:
I have system,in there system i want to run  catalog product flat index process pragmatically. I have code is

Mage::getModel('index/indexer')->getProcessByCode('catalog_product_flat');
Can any one tell me that is the right code...???or have any other code.

But i want to run the index process by indexer code "catalog_product_flat"


texts:
Hi Guys , I changed the  media folder permission 777 ,
drwxrwxrwx  4 geetha geetha   4096 Jun 25 15:16 media.
I updated browser not help.
I installed Flash player not help.
I flushed the magento cash not help.
In the System.log  not showing any error.
One more thing i have to mention is that , we have three systems running Uubuntu 12.04 , its happening in only one system. in other two we dont have any problem.
please tell me What could be the problem?


texts: through image name display image in custom tab in admin grid

texts:
hello everyone i want to display the uploaded image my code is below
info.php

$fieldset->addField(
        'image',
        'text',
        [
            'name'        => 'image',
            'label'    => __('image'),
            'renderer'  => 'Magneto\BookFreeLayout\Block\Adminhtml\Extension\Grid\Renderer\LogoImage',
            'required'     => true,

        ]
    );

logoimage.php

<?php

     namespace
    Magneto\BookFreeLayout\Block\Adminhtml\Extension\Grid\Renderer;

  class LogoImage extends
  \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer {

protected $_storeManager;

protected $_fileSystem;

protected $_modelData;

public function __construct(
    \Magento\Backend\Block\Context $context,
    \Magento\Store\Model\StoreManagerInterface $storeManager,
    \Magento\Framework\Filesystem $fileSystem,
    \Magneto\BookFreeLayout\Model\AlllayoutFactory $modelData,
    array $data = []) {
    parent::__construct($context, $data);
    $this->_storeManager = $storeManager;
    $this->_fileSystem = $fileSystem;
    $this->_modelData = $modelData;
    $this->_authorization = $context->getAuthorization();
}
public function render(\Magento\Framework\DataObject $row) {
    $id = $this->_getValue($row);
    $filepath = $this->_fileSystem->getDirectoryRead(\Magento\Framework\App\Filesystem\DirectoryList::MEDIA)->getAbsolutePath('images');
    $data = $this->_modelData->load($id);
    foreach($data as $file)
    {
        echo "<img src='".$filepath."pub/media/images".$file['image']."' height='30' width='30' />";
    }
}

 }


texts:
Developing android native application using scribe library, and uses Rest based web services from existing Magento based eCommerce platform.

I have got prerequisite requirement like 'Key' and 'Secret' from the Magento based Oauth Consumer.

Since,there are three user in existing scenario like, registered customer, admin and guest user.

For registered customer and admin Iam able to get the outh token and secret token after fulfilling the authorization url link and allowing the app to access my account.

But initially I wanted to access the rest services and display product list as a guest user(not registered with application) but each time It ask for authorization url.

I'am sharing part of code snippet please go through it.

OAuthService service = new ServiceBuilder()
                    .provider(MagentoThreeLeggedOAuth.class)
                    .apiKey(MAGENTO_API_KEY)
                    .apiSecret(MAGENTO_API_SECRET)
                    .debug()
                    .build();

Token requestToken = service.getRequestToken();

String authorizationUrl = service.getAuthorizationUrl(requestToken);

/*popup window which displays authorization from the user*/

startActivity(new Intent("android.intent.action.VIEW", Uri.parse(authorizationUrl)));

How to get the secret token for guest user?

Thanks in advance.


texts: How to deal with order statues when payment method COD and credit/debit card configured?

texts:
I have setup payment gateway and cash on delivery as payment methods on my magento site. Here there are two cases for product workflow.

Case 1: When payment is done by credit/debit card.
Order status will change as Order confirmed-> payment received->pending->Invoiced->shipped->completed.

Case 2:
When payment is done using COD method, order status will change as Order confirmed->pending->Invoiced->shipped->Payment pending->payment received->completed.

Can somebody help to setup this workflow in magento.?


texts: Overriding ProductController action doesn't work

texts:
I have declare my module on app/ etc/ module

<ML_CanonicalRedirect>
          <active>true</active>
          <codePool>local</codePool>
    </ML_CanonicalRedirect>

Then add on app\code\local\ML\CanonicalRedirect my etc and controllers folder

in etc i've got my config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <ML_CanonicalRedirect>
            <version>0.1.0</version>
        </ML_CanonicalRedirect>
    </modules>
 <frontend>
        <routers>
          <catalog>
             <args>
             <modules>
                <ML_CanonicalRedirect before="Mage_Catalog">ML_CanonicalRedirect</ML_CanonicalRedirect>
             </modules>
             </args>
         </catalog>
       </routers>
   </frontend>
</config>

in controllers i've got ProductControllers.php

<?php
require_once 'Mage/Catalog/controllers/ProductController.php';
class ML_CanonicalRedirect_ProductController extends Mage_Catalog_ProductController {
    public function viewAction()
    {  header("Location: {$_SERVER['HTTP_REFERER']}");
    exit;
}
}

But magento load anyway the core class.
Any suggestion?


texts: Magento Redirects to Old Website regardless of what changes are made!

texts:
We are having the strangest Redirection problem on a Magento site.  We copied the sites contents from another Magento site to a new URL.  We have done this in the past with no problems but for some reason this one redirects to the old website as soon as you try to load the page, any page.

Below are all the steps I have done so far in my quest to Debug this pain...

www.Old-Domain.com = The Old site URL that we moved away from

www.NEW-Domain.com = The new site that we have copied Magento over to.

Steps done so far to try an resolve redirection issue:

Searched whole MySQL database (All tables) for the string www.Old-Domain.com and made sure there was none that could be causing the Redirection to happen.
Updated Database Table core_config_data columns web/unsecure/base_url and web/secure/base_url to the new sites URL www.NEW-Domain.com
cleared any Cache files from /var/cache/ in the Magento Root
Checked Server's cache folders to make sure files weren't being cached there due to permission or other error.
Inspected .htaccess file to make sure it wasn't happening there
Inspected index.php file as well and printed out some content followed by an exit() call and progressively moved it down the page until the point that the Redirection occurs.  It is the very last line where this is called Mage::run($mageRunCode, $mageRunType); once the page loads and gets to this line, I am immediately Redirected to our old website URL!

Any ideas?


texts: Category product list block cache improvement

texts:
I rewrite catalog product list block for caching issue. Please review code and give your advices to improve caching and cache-validating issues for huge product listing category pages. Who has better configuration for caching blocks like this?

class Ssd_Fix_Block_Catalog_Product_List extends Mage_Catalog_Block_Product_List
{
    const CACHE_TAG = 'CATEGORY_PRODUCTS';

    public function getCacheKey()
    {
        $url = md5(Mage::app()->getRequest()->getOriginalRequest()->getRequestUri());
        if (!$this->_cache_key) {
            $key              = "CATEGORY_PRODUCTS_" . $url;
            $this->_cache_key = $key;
        }
        return $this->_cache_key;
    }

    public function getCacheTags()
    {
        $data = array(self::CACHE_TAG);
        if ($category = Mage::registry('current_category')) {
            $data[] = Mage_Catalog_Model_Category::CACHE_TAG . "_" . $category->getId();
        }
        if (count($products = $this->getProductList())) {
            foreach ($products as $p) {
                $data[] = Mage_Catalog_Model_Product::CACHE_TAG . "_" . $p->getId();
            }
        }
        return $data;
    }

    public function getCacheLifetime()
    {
        return 60 * 60 * 24;
    }

    //other methods here
}


texts:
Array :-

 foreach ($relatedProducts as $relatedProduct) {
        $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($relatedProduct->getId());
        $skus = $_product->getSku(); //get name
        $array[] = $skus;
    }
$str = serialize($array);
$strenc = urlencode($str);

URL :-

<script>
    function onTryonClick(argument) {
var url = "https://modakatech.com/camweara_vaibhav/index.php?skus=<?php echo $strenc; ?>&lengths=<?php echo $lengths;?>&cat=<?php echo $catlast;?>";
alert(url);
</script>


texts:
I restrict magento default redirection after login by this method

System > Config > Customer
> Custumer Redirect Customer to Account Dashboard after Logging in > NO

It works fine but my problem is it redirect to previous page but top link still showing login only.

Once i reload my browser it change into logout


texts: Magento 2: Disable and enable payment method programmatically

texts: I want to place order programmatically. I do not have COD enable when I placed the order programmatically so can it be possible that I can enable the COD before order place and disable COD after Order place.


texts: Unable to override model execute function

texts:
I'm trying to override SourceDeductionService model's execute function Magento\InventorySourceDeductionApi\Model\SourceDeductionService
My di.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <preference for="Magento\InventorySourceDeductionApi\Model\SourceDeductionService" type="Arunendra\Shipment\Model\SourceDeductionService" />
</config>

Code:SourceDeductionService.php
<?php

namespace Arunendra\Shipment\Model;

class SourceDeductionService extends \Magento\InventorySourceDeductionApi\Model\SourceDeductionService
{
    /**
     * @inheritdoc
     */
    public function execute(SourceDeductionRequestInterface $sourceDeductionRequest)
    {
        $sourceItems = [];
        $sourceCode = $sourceDeductionRequest->getSourceCode();
        $salesChannel = $sourceDeductionRequest->getSalesChannel();

        $stockId = $this->getStockBySalesChannel->execute($salesChannel)->getStockId();
        foreach ($sourceDeductionRequest->getItems() as $item) {
            $itemSku = $item->getSku();
            $qty = $item->getQty();
            $stockItemConfiguration = $this->getStockItemConfiguration->execute(
                $itemSku,
                $stockId
            );

            if (!$stockItemConfiguration->isManageStock()) {
                //We don't need to Manage Stock
                continue;
            }

            $sourceItem = $this->getSourceItemBySourceCodeAndSku->execute($sourceCode, $itemSku);
            if (($sourceItem->getQuantity() - $qty) >= 0) {
                $sourceItem->setQuantity($sourceItem->getQuantity() - $qty);
                $stockStatus = $this->getSourceStockStatus(
                    $stockItemConfiguration,
                    $sourceItem
                );
                $sourceItem->setStatus($stockStatus);
                $sourceItems[] = $sourceItem;
            } else {
                # Bypass this error
               /*  throw new LocalizedException(
                    __('Not all of your products are available in the requested quantity.')
                );*/
            }
        }

        if (!empty($sourceItems)) {
            $this->sourceItemsSave->execute($sourceItems);
        }
    }
}

Getting the following error:
Fatal error: Declaration of Arunendra\Shipment\Model\SourceDeductionService::execute(Arunendra\Shipment\Model\SourceDeductionRequestInterface $sourceDeductionRequest) must be compatible with Magento\InventorySourceDeductionApi\Model\SourceDeductionService::execute(Magento\InventorySourceDeductionApi\Model\SourceDeductionRequestInterface $sourceDeductionRequest): void in /home/arun/raisahab/www/magentoProjects/magesm/app/code/Arunendra/Shipment/Model/SourceDeductionService.php on line 51


texts: How To Get Simple Product Name From Configurable Product From Ordered Product

texts:
foreach ($order->getAllItems() as $item
{

   $orderItemId = $item->getOrderItemId();

   $orderItem = Mage::getModel('sales/order_item')->load($orderItemId);

   $product = Mage::getModel('catalog/product')->load($item->getProductId());

   $html.='

     '.$item->getSku().'

     '.$product->getName().'

     '.(int)$orderItem->getQtyBackordered().'

     '.(int)$item['qty_ordered'].'

';
}

With this code i am getting both simple and configurable product name but when i replace getAllItems by getAllVisibleItems then only show configurable product name but i want to show simple product name which was order


texts: Adding Tabs and static block content on product page

texts:
I've to add a new tab on product page and show some content from static block. Inside catalog.xml, I'm adding following code

<block type="catalog/product_view_attributes" name="product.info.details.shipping" as="product.info.details.shipping" template="catalog/product/view/tabs/additional.phtml">
<action method="addToParentGroup"><group>detailed_info</group></action>
<action method="setTitle" translate="value"><value>Shipping</value></action>
</block>

Which is working fine to show the tab aand content from additional.phtml.
 When I change block type to cms/block, it doesn't work. What is the proper way to add a new tab and show some content from static block there?

If I've to show content from static block, in that case also I need to create templates and write code there to print static blocks content?


texts: How To Remove Product Title from Breadcrumbs

texts:
As the majority of people visit my Magento 1 site on a smartphone, I feel the breadcrumb is taking up to much screen real estate. As my product titles are quite long, the breadcrumb is often displayed on 2-3 lines on mobile.

On magento 1, the standard breadcrumb layout is like this:

  Home - category 1 - category 2 - product title

I would like to change it to only:

  Home - category 1 - category 2

Is there an efficient way to do this? I've tried it by tweaking CSS (display: none), but it's not possible to only hide the product title part of the breadcrumbs.

Thanks for the help in advance!


texts: how to call a controller in phpunit test?

texts:
I'm using phpunit and need to test the method in a controller but when I try to call it like this:

Vendor_Module_Adminhtml_SomecontrollerController::someMethod();

phpunit fails with this error:

PHP Fatal Error: Class Vendor_Module_Adminhtml_SomecontrollerController not found in ...

Anyone knows how to call to a method in a controller?

Thanks.!


texts: soap-error: Parsing Wsql: couldn't load from "xyz.wsdl" faild to load external

texts:
In magento2 i created a module in which i used soap api for request, response, everything working fine in my local but when i running on server.
I am getting below error

'Fatal Error: 'SOAP-ERROR: Parsing WSDL: Couldn't load from "xyz.wsdl" faild to load external.

i read some answer in stackoverflow and applied solution. i added

IP XXX.XXX.XXX.XXX www.example.com in our etc/hosts file on server.

but problem is remain same.


texts: Where is dependency for SchemaSetupInteface being declared? (if it's needed)

texts:
In Magento 2, to my understanding, dependency for each interface should be declared somewhere in the di.xml files, either in app/etc/ or < module_dir >/etc/ or some deeper directories to override.

But when I was tracing the schema setup code, I couldn't seem to find the dependency relation anywhere.

For example:

    namespace Vendor\Mod\Setup;

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

    class InstallSchema implements InstallSchemaInterface
    {
        /**
         * Installs DB schema for a module
         *
         * @param SchemaSetupInterface $setup
         * @param ModuleContextInterface $context
         * @return void
         */
        public function install(
             SchemaSetupInterface $setup,
             ModuleContextInterface $context)
        {
            ...
        }
    }

Though in the book it said:

  "... Magento\Setup\Module\Setup is the one extending
  \Magento\Framework\Module\Setup and implementing
  SchemaSetupInterface."

it didn't help much to sort out my problem.

Also, I've noticed that components under Magento\Framework\ are not regular magento2-modules.(not sure if it makes any difference here.)

So, why is the DI declaration not needed in this case? How did magento know which implementation to use?

Thanks for the help.


texts: Get Product listing page filtered only by manufacture attribute with layered navigation

texts:
I m trying to list all the products of a same manufacture on a page from different categories on click of manufacture name with layered navigation,help me out with solution i have tried with advance search but couldn't get layered navigation on that page

i can get collection by

  $products = Mage::getModel('catalog/product')
          ->getCollection()
          ->addAttributeToFilter('manufacturer',$manufacturer_id);

how do i pass this in list.php or should i make new custom module so that i can get layered navigation on that page


texts: Magento2.2 language switching not working on catalog pages

texts:
I have magento2.2 fresh installation. I enabled two languages I can switch the language/store view on the homepage. also on default pages like create an account, forgot password etc.

But when I am on catalog pages (product,category etc) when I click on the language switcher the page is refreshed but neither the URL changes nor the site language.


texts: Magento 2 pop-up authentication not showing

texts:
I'm using Magento 2.1.8, and I disable Magento guest checkout like this:

after saving the configuration, I cleared Magento cache. The problem occur when I tried to click the checkout button at minicart, it didn't redirect me to any page or show pop-up authentication. The button just does nothing when clicked


texts: Category Icon Image not being shown in Magento 2, Porto theme

texts:
I am new on magento2, working to develop multiple stores. Just got stuck with following problem since last many hours. Any positive response is much appreciated
I have created 2 websites, each with one store, and each store with one store view.

Now, in the PortoStoreView, I am trying to modify the nav menu, by adding category icon. So, from the admin panel, under Category section, I have created new category and set its icon. But it is not displaying the image

So, I inspect it and found that, it is due to invalid URL of the image. By default image is being stored in following folder: store\pub\media\catalog\category
But it is accessing following path(as can be seen in inspect) to display image.

At other places for example product page it is working fine, it is displaying the images. But just on the navbar, it is functioning strange.
Additional Info: In my root folder, I have created a folder PortoStore and added index.html and .htaccess files in it. If you need any other information, please ask.


texts: Display the brand and products first when user revisits the site which is browse by user in last time

texts:
For my Magento 1.9.1, I want to save the products and brands which is visited by the user and show those Products first when he revisits the site. I have tried with recently view block but it's not working for me.

Can anyone please let me know how it is possible?


texts: Email templates: using store email address and logo in the admin back-end

texts:
In the email templates we use the email address of the shop (info@shopname.com), as plain text, and a custom logo with the name of the shop in it (shopname_email.png). Now, for each store, we have to create new templates, and replace logo name and email address. I would like to use one standard template that doesn't have to be changed for each shop.

I would like to use something like {{store.email}} and {{store.code}} in the templates. The store name is not good, as some stores will have names with spaces and special characters, and these names are not fixed, can change in the future. Defining a variable in the admin might be a solution, if that can be used in the templates, but looking at it variable values are fixed for all stores so I think this cannot be used. Something that can produce "shopname" (depending on the store) would do.

Below you see my accepted answer. It's great because that way you can create any value using PHP, like the domain name. I just found out that for me, there is a simpler solution that can be handled in the admin entirely.

Create a custom variable in System > Custom variables
Save this variable, go to the list of custom variables, and open the new variable again.
Now you see that you can change the value of the variable per shop.
Insert the variable in your email template

Et voilà!


texts:
I'm trying to upload images to my magento website, but not sure why it disappears after uploading and does not show up on the product uploaded images. This is happening after I updated magento to 1.9.3.7

Here is the clip of whats happening: http://take.ms/2M9IR

Also, the selections I made for the small, thumbnail and base image are also gone.

I have tried disabling all of the external modules and check, but it still doesn't work.

Any solution?


texts:
I tried

 <IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"

 and tried for js cross orign from htaccess

<FilesMatch "\.(js)$">
 Header set Access-Control-Allow-Origin "*"
</FilesMatch> in the .htaccess. but I still have the Cors error. Does anyone know how to fix it?


texts:
I want to override the body{} tag of style-m.css in my theme.

The code of .themename.less in vendor\theme\web\css\source is

body {
      .lib-background-gradient(
        #004b6e,
        @main-theme-color,
        vertical,
        true
    );
    word-wrap:break-word !important;
}

but I cant see the changes.On inspect element the word-wrap property in not applied on body.

How to do that?


texts: Where can i find [ BIlling address form] into panel admin?

texts:
im looking for , billing adress form to edit order of inputs and lables but i dont know where is it?

i need modify order and add diferent label!
Could u help me to find the file to modify! plz!!!

this is the code of link edit!!1

<?php echo Mage::helper('sales')->__('Billing Address') ?>

<?php echo $this->getAddressEditLink($_order->getBillingAddress())?>

        <fieldset>
            <address><?php echo $_order->getBillingAddress()->getFormated(true) ?></address>
        </fieldset>


texts: Configurable Swatches not working after 1.9.3 Upgrade

texts:
After upgrading Magento from 1.9.2.4 to 1.9.3, configurable swatches appears to be broken on the product page for all themes. When you click on color swatches (other than the default) the product image no longer switches. The grid and list product view still work but I receive the following js error on all product pages:

Uncaught TypeError: Cannot read property 'productId' of undefined

Has anyone else experienced this issue and been able to resolve it?


texts: How do I schedule hourly backups of the Magento database?

texts:
I see that the built in backup scheduler can do daily and longer, but how about hourly?  If there's not a way to set it in the GUI, can I make a call (from cron) to a Magento utility that will do the database backup for me?

I'm trying to avoid scripting my own MySQL database backups.  I'd like to leverage as much built in Magento functionality as possible to avoid reinventing the wheel.


texts: Add similar product to product view page

texts:
I want to show related products in product view page after product details.
I added the below code in

  app/design/frontend/default/your_theme/layout/catalog_product_view.xml

page

<move element="catalog.product.related" destination="product.info.details" after="-" />

then cache is cleared.its move successfully sill not show product


texts: Redirection from observer not working (Fullpage Cache + APC turned on)

texts:
I am trying to redirect to custom url if certain url is matched using event: controller_action_predispatch

a> Registering event: controller_action_predispatch

<frontend>
    <events>
        <controller_action_predispatch>
            <observers>
                <redirect_controller_action_predispatch>
                    <class>redirect/observer</class>
                    <method>controllerActionPredispatch</method>
                </redirect_controller_action_predispatch>
            </observers>
        </controller_action_predispatch>
    </events>
</frontend>

b> Implementing the observer model

<?php
class MagePsycho_Redirect_Model_Observer
{
    public function controllerActionPredispatch(Varien_Event_Observer $observer)
    {
        $action         = $observer->getControllerAction();
        $request        = $action->getRequest();
        $requestUrl     = isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : $request->getRequestUri();

        if (stripos($requestUrl, '/' . 'old-404-url-key') !== false) {
            $redirectUrl = Mage::getUrl('new-url-key');
            Mage::log('redirect-matched::' . $redirectUrl);
            $action->getResponse()->setRedirect($redirectUrl, 301);
            $action->getRequest()->setDispatched(true);
            return;
        }
    }
}

Above code works fine in localhost but not on live server where Full Page Cache + APC caching is turned on (Magento EE 1.13).

What am I missing, anything needs to be checked in case of Full Page Cache + APC turned on?

Any help is appreciated.

[EDIT]
The redirection issue is only for 404 error. If i try to redirect some non existing page (i.e. 404 page) to some valid page, the redirection doesn't work.


texts: I have problem in send mail from contact form. In my localhost all good working but in server I have error Failed to submit queries. Please try again later. I checked all solutions http://inchoo.net/magento/problems-with-contact-form/ but all time I have error. Do you have any ideas?


texts: Magento 2 Object of class could not be converted to string

texts:
Error: Object of class Magento\Sales\Model\Order\Creditmemo\Interceptor could not be converted to string in Magento2/vendor/magento/framework/Escaper.php:78

What does this error means ?
if ($amount) {
    $amount = $this->priceCurrency->roundPrice($amount);
    $creditmemo->setBsCustomerBalTotalRefunded($amount);
    $creditmemo->setCustomerBalTotalRefunded($amount);
    **$creditmemo->setCustomerBalanceRefundFlag(true);** // line 79
    if (!empty($tracking_info)) {
        $tracking_info_comment = implode("\n", $tracking_info);
        $creditmemo->addComment($tracking_info_comment);
    }
    $creditmemo = $this->creditmemoRepository->save($creditmemo);
    $this->registry->unregister('current_creditmemo');
    $this->creditmemoSender->send($creditmemo);
    $result[0] = true;
    return $result;
}


texts:
I'm using Magento Version 19.2.4 and a custom theme from TemplateMonster,

The shop is online since a few years and all patches are installed. For some reason, today when clicking Checkout, this error message comes up:

  Fatal error: Call to a member function getQuote() on boolean in /var/customers/webs/rossi/shop/app/code/core/Mage/Checkout/controllers/OnepageController.php on line 195

This is the code on line 195:

$quote = $this->getOnepage()->getQuote();

This is the report created today:

a:5:{i:0;s:53:"Cannot send headers; headers already sent in , line 0";i:1;s:1053:"#0 /var/customers/webs/rossi/shop/lib/Zend/Controller/Response/Abstract.php(115): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 /var/customers/webs/rossi/shop/app/code/core/Mage/Core/Model/App.php(1265): Zend_Controller_Response_Abstract->setHeader('Content-Type', 'text/html; char...')
#2 /var/customers/webs/rossi/shop/app/code/core/Mage/Core/Controller/Varien/Front.php(80): Mage_Core_Model_App->getResponse()
#3 /var/customers/webs/rossi/shop/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(202): Mage_Core_Controller_Varien_Front->getResponse()
#4 /var/customers/webs/rossi/shop/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#5 /var/customers/webs/rossi/shop/app/code/core/Mage/Core/Model/App.php(365): Mage_Core_Controller_Varien_Front->dispatch()
#6 /var/customers/webs/rossi/shop/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#7 /var/customers/webs/rossi/shop/index.php(77): Mage::run('', 'store')
#8 {main}";s:3:"url";s:11:"/api/xmlrpc";s:11:"script_name";s:10:"/index.php";s:4:"skin";s:7:"english";}

Does anyone have an idea how this can happen? I have also cleared the cache.

Any advice would be really helpful.


texts: wholesale and retail site same inventory

texts:
I have magento 1.9, I am new to Magento but can get around in the backend, if possible please provide some step by step

We have 2 domains i.e. retail.com & wholesale.com one for wholesale and one for retail.

We want the inventory to be shared between the two stores

I want the home page and the theme to be different between the sites.

the wholesale site should not have purchase possibility it should function like a catalog

is this possible? is it in the manage store area? Again  I am new to Magento but can get around in the backend, if possible please provide some step by step thanks


texts: How to add required validation on a particular filed in customer add form using JS?

texts:
I have created a custom field in customer add form using ui component. I want to add required validation to that filed using JS.

Please help. Thanks in advance.


texts: Google Search Console and Magento Multistore

texts:
I have a multistore set up with an english domain.com/en_ca and french store domain.com/fr_ca, fr_ca and en_ca are added by Magento, by enabling the configuration Add Store Code to Urls to Yes.

My problem is to configure google sitemap for each domain.

I cannot use domain.com/en_ca/sitemap_en.xml, sitemap_en.xml is on the root directory, and google force me to use domain.com/en_ca, domain.com/en_ca/sitemap_en.xml return a 404 page error.

I created a real directory en_ca on the root and put the sitemap on it, but this cause the website to stop working.

Any one have a solution?


texts: How to override third party module \view\frontend\templates\ from my custom theme using prefrence?

texts:
I am using a third-party module, I am added one extra feature to it, after upgrade the extension all my changes removed right, how to handle this situation, i mean how to override third-party module from my theme,
eg. I am updated one feature in model app\code\Magefan\Blog\Model\Post.php How to add this update from my custom theme.


texts:
I'm facing problem while trying new installation of magento on server. When I extract the zip file and access by browser then that bellow error comes:

  Fatal error: Allowed memory size of 536870912 bytes exhausted (tried
  to allocate 64314 bytes) in
  C:\HostingSpaces\mygarden\mygarden.pk\wwwroot\app\Mage.php on line 907

I changed memory limit to 256 in .htaccess
and also changed memory limit in php.ini file.

but issue never resolved, please reply me with good solution

thanks


texts: Replace Add to cart with pop up Contact form

texts: I wanted to change all add to cart button to open a Popup contact form which will be pre-filled with product details and send the email to the admin.


texts: Magento2 Tax/VAT field not showing properly in customer registration based on admin configuration

texts:
I have Two Website in my magento2.2 webA & webB
I want "Tax/VAT number" field in different scenarios on my website

webA enabled and required
webB enabled and optional

I did the configuration on Store >> Configuration >> Customer Configuration >> Show Tax/VAT Number

webA >> required
webB >> optional

When in look to the front-end of my store under create customer I see both the stores have Required and when I do cache refresh it goes optional.
I don't know why this happen, Everything seems to have malfunction.
Scenarios 1

Admin Input

webA >> required
webB >> optional

Store output

webA >> required
webB >> required

After flush cache Store output

webA >> optional
webB >> optional

Scenarios 2

Admin Input

webA >> required
webB >> required

Store output

webA >> required
webB >> required

After flush cache Store output

webA >> required
webB >> required

Scenarios 3

Admin Input

webA >> optional
webB >> required

Store output

webA >> optional
webB >> optional

After flush cache Store output

webA >> optional
webB >> optional

Please help me on this.


texts: I deleted default category by mistake. How can I get again. Have to create new root category name default category ? Then what is the configuration.


texts: How to display order comment on checkout page?

texts: I want to display the order comment textarea on checkout page. I can't find any setting in configuration to enable this feature. Any idea? Im using default magento 2 theme Luma


texts: Magento2 - Customer Specific Coupon Codes Generation

texts: By default, magento2 promotions have the feature to create coupon code for specific customer groups. I want to send coupon code to users who already purchased products with us. Are there any settings needs to be selected in magento2 to apply for customer based promotions.?


texts: Can't copy data from quote_item to sales_order_item

texts:
I have a custom value (In a Magento 2.3.3 installation )that gets added to the quote_item table when I add an item to the basket. When I go to checkout I want to pass that value to the same-named column in the sales_order_item table. I am using the event sales_model_service_quote_submit_before to copy my quote data to the sales order table but for some reason, the data to be inserted into the sales_order_item table won't store. Below is the code I am using.

foreach($order->getItems() as $item) {
    $quoteItem = $quote->getItemById($item->getQuoteItemId());
    if ($quoteItem) {
        if($quoteItem->hasData('deposit')){
            $item->setData('deposit', $quoteItem->getDeposit());
        }
    }
}

If I debug straight after the contents of $item then I get the value but it is not storing in the table.


texts: Magento 2 How to Save Data in Two Different Table (Admin Grid Form)

texts:
In NewAction.php I am saving data in two different tables both have a different model for new contact it's working well, but while editing existing data it's updating first table row and creating a new row in the second table. here in my code "con_id" is the foreign key

 class NewAction extends \Magento\Backend\App\Action
 {
/**
 * Edit A Contact Page
 *
 * @return \Magento\Backend\Model\View\Result\Page|\Magento\Backend\Model\View\Result\Redirect
 * @SuppressWarnings(PHPMD.NPathComplexity)
 */
public function execute()
{
    $this->_view->loadLayout();
    $this->_view->renderLayout();

    $contactDatas = $this->getRequest()->getParam('contact');

    if(is_array($contactDatas)) {
        $contact = $this->_objectManager->create(Contact::class);
        $contact->setData($contactDatas)->save();
        $id = $contact->getId();
        $contactt = $this->_objectManager->create(Contactt::class);
        $contactt->setData('con_id', $id);
        $contactt->setData('address', $contactDatas['address']);
        $contactt->setData('zipcode', $contactDatas['zipcode']);
        $contactt->setData('country', $contactDatas['country']);
        $contactt->save();
        if($contact->save()){
             $this->messageManager->addSuccessMessage(__('You saved the data.'));
        }else{
             $this->messageManager->addErrorMessage(__('Data was not saved.'));
        }
        $resultRedirect = $this->resultRedirectFactory->create();
        return $resultRedirect->setPath('*/*/index');
    }
}
}


texts: How to check if URL has http:// or https://?

texts:
In my Magento website I have configured SSL certificate in some pages only. So how to check if the current page has http:// or https://?

I am using Magento 1.9


texts: How to print Product collection mysql query in magento2

texts: In my product page Price sorting not works properly. So i need to know which field value consider for sorting ? the issue occurs in configurable products.How do I print the actual MySQL code that gets executed?


texts: Add Additional Fee to shipping methods for specific products

texts: what is the best approach to add Additional Fees to shipping methods for specific products


texts: Custom Translation of Backend in Magento 2 - path of the translate.csv?

texts:
I am familiar with translations in Magento 1 and found out also how translations in M2 work for the frontend. My questions is where to do my translation for my own custom module for the backend. Is there also a translation.csv and where should I put it?

Thanks in advance!


texts: Save file that customer submits through a form

texts:
I have a form:

<form class="customDocs" method="post" action="<?php echo $this->getUrl('customdocuments/index/send') ?>">

Upload Seller's Permit Here:

   <input type="file" name="sellerPermit" id="sellerPermit">
   <input class="submitBtn" type="submit" value="Upload Documents" name="submit">
</form>

Which is submitted to my controller:

class Sean_CustomDocuments_IndexController extends Mage_Core_Controller_Front_Action{
    public function indexAction(){
        $this->loadLayout();
        $this->_initLayoutMessages('core/session');
        $this->renderLayout();
    }
    public function sendAction(){ //handles the form submit
        $post = Mage::app()->getRequest()->getParams();
        $info = pathinfo('/media/custom_documents/seller_permits/' . $post['seller_permit']);
        $ext = $info['extension'];
        $filename = $post['seller_permit'] . $ext;
        $target = '/media/custom_documents/seller_permits' . $filename;
        move_uploaded_file($post['sellerPermit'], $target);

        Mage::getSingleton('core/session')->addSuccess($this->__('Your Documents have been updated!'));//add success message.
        $this->_redirect('*/*');
    }
}

I want to save their file into this directory:
/media/custom_documents/seller_permits/
Is there something I'm missing or is this not possible?


texts: Load other phtml file in product/view.phtml

texts:
I want to load an other phtml template inside the product/view.phtml file.

But my edits are not working. What am I missing?

Inside the product/view.phtml I added:

<?php echo $this->getChildHtml('delivery'); ?>

Inside the catalog.xml file I added:

<block type="core/template" name="delivery" as="delivery" template="catalog/product/view/delivery.phtml"/>

At the following section:

<catalog_product_view translate="label">
  <reference name="content">


texts: The right way to set/get items to/from quote

texts:
There are 3 places to store items data in the quote:

\Magento\Quote\Model\Quote::$_items
\Magento\Quote\Model\Quote::$_data['items']
\Magento\Quote\Model\Quote::$_data['items_collection']

\Magento\Quote\Model\Quote

const KEY_ITEMS = 'items';
/**
 * Quote items collection
 *
 * @var \Magento\Eav\Model\Entity\Collection\AbstractCollection
 */
protected $_items;

public function getItems()
{
    return $this->_getData(self::KEY_ITEMS);
}

public function setItems(array $items = null)
{
    return $this->setData(self::KEY_ITEMS, $items);
}

public function getItemsCollection($useCache = true)
{
    if ($this->hasItemsCollection()) {
        return $this->getData('items_collection');
    }
    if (null === $this->_items) {
        $this->_items = $this->_quoteItemCollectionFactory->create();
        $this->extensionAttributesJoinProcessor->process($this->_items);
        $this->_items->setQuote($this);
    }
    return $this->_items;
}

What is the right place to store items data in the quote?

Magento version: 2.1.2


texts: Magento 2.3.1 Frontend stock not correct after sql update

texts:
I'm updating stock via SQL update along the lines of  below website https://www.danjoseph.me/2017/01/12/magento-2-database-level-inventory-management/

The price and qty is updated and visible in backend but the frontend still seems to reflect the 'old' qty & pric. I have reindexed & flushed cache but backorder message remains. The cataloginventory_stock_item and cataloginventory_stock_status tables all look correct are there any other tables that could cause this??

As soon as I manually save the product in the admin backend (without altering any values) the stock is reflected correctly


texts: zero prices in sales_flat_order_item for bundled product items

texts:
I have a test bundled product https://www.themertailor.com/dev/test-product-bundle.html

its all working well except the order in the back end shows zero prices for the individual items.

I traced this back to the table sales_flat_order_item which shows all zero prices for the individual items - only the actual bundle shows prices.

This results in zero invoices and errors when paying by credit card.

The magento version is 1.9.2.2


texts: Magento 2.3 Dropdown Custom Attribute API Error

texts:
I have a dropdown custom attribute with values:
"options": [
    {
        "label": " ",
        "value": ""
    },
    {
        "label": "Green",
        "value": "5640"
    },
    {
        "label": "Blue",
        "value": "5641"
    },
    {
        "label": "Red",
        "value": "5642"
    }
]

When updating products in Magento 2.2, if I want to set the value to the default (no value chosen), I would use the following in my JSON request body.
"custom_attributes": [
        {
            "attribute_code": "new_color",
            "value": ""
        }
    ]

In Magento 2.3, it is not working anymore and the error is
"message": "Error occurred during \"custom_attributes\" processing. Attribute \"new_color\" has invalid value. The \"\" value's type is invalid. The \"int\" type was expected. Verify and try again.",
"trace": null

How will I be able to set to the default value if the default value of the custom attribute is "" and not an int type?
Note that in the admin, I can do it by just selecting the default value, but I want to know how it can be done thru the API


texts:
I have created product grid under customer view tab using below URL as a reference

http://www.ibnab.com/en/blog/magento-2/magento-2-backend-create-custom-tab-in-customer-view-and-load-grid-inside-admin

I have added checkboxes to every item in the grid.

Now I want to save selected products to the customer account in a custom table. For this, I need to add the grid under a form.

So can anyone has an idea on how to add form to the grid.