texts: Magento2 How can get the Attributes based on the Attribute Set Id or Attribute Set Name

texts: In Magento2, How can get the all (product) Attributes based on the Attribute Set Id or Attribute Set Name in the Custom Product List Page.


texts: Magento 2 | Which refrenceContainer to use for adding additional button on 'Create New Order Page?

texts:
I am adding a new button with Add Products button at:

Sales->Order->Create New Order->New Add Product Button as shown in screenshot!

I searched for the relevant referenceContainer in vendor but all in vain. Is this approach right or have to do it by some other way ?


texts:
I'm using Porto theme (documentation: porto doc) and i want to change to topLinks:

The problem is that i can't find the static block that contains those links. Or are those links inside a .phtml file? :-s

Thank you!


texts: how to multiply cost attribute and sold quantity of products in magento reports

texts:
$this->addColumn('cost', array(
    'header'    =>Mage::helper('reports')->__('Cost'),
    'width'     =>'120px',
    'align'     =>'right',
    'index'     =>'cost * ordered_qty',
    'total'     =>'sum',
    'type'      =>'number'
));


texts: Magento 2: whenever I check product ids and filter grid and select other product ids at that time first selected ids get removed in grid serializer

texts:
$this->addColumn(
            'in_product',
            [
                'type' => 'checkbox',
                'field_name' => 'in_product[]',
                'align' => 'center',
                'index' => 'entity_id',
                'filter_index' => 'entity_id',
                'values' => $this->getSelectedProducts(),
            ]
        );


texts: Catalog_product_attribute list empty in Python-Magento API?

texts:
Using this for fetching data from My Magento website. The catalog product API is working fine. It returns all the products. But when I try to fetch attribute using the following command it returns an empty list.

>>> magento = MagentoAPI("magentohost,com","80","**","**","/api/xmlrpc")
>>> products = magento.catalog_product.list()
>>> len(products)
3345
>>> attrs = magento.catalog_product_attribute.list()
>>> attrs
[]

I have lot of products attributes in my catalog. Why does it return empty then?

P.S: Is the JSON Magento API better than XML API ?


texts: What method is best for importing products in bulk. Magmi or Magento's API?

texts:
I would like to know which of the following methods for bulk importing is best.

Magmi or using Magento's API.

I am currently using Magmi. I am writing a script for bulk import in Vb.net using the Soap API, but before I waste anymore of my time I want to know if Magmi is the absolute best way to import. If so I will just stick with that method.


texts: Magento 2: URL Rewrite by custom router URL

texts:
I am using Magento version 2.2.6

I have already tried with Marketing >> URL Rewrite >> Add New URL Rewrite add custom URL but not working when we use it with question mark in URL, it's working with / (slash)

I have URL like this mydomain.com/product.asp?product=977 and I want it to be rewritten to this mydomain.com (redirect to the root of the domain)

Also, I have another example mydomain.com/catalogsearch/result/?q=lim and I want to redirect to this mydomain.com/ingpage/about-lim.html

Can anyone suggest to me how to do this via custom programming in Magento 2?


texts: Magento 2 - There is an event or method to "plug-in" when the coupon is removed from the cart/quote in the checkout flow?

texts:
Looking at events.xml of Magento_SalesRule there are two events,

<event name="sales_order_place_after">
    <observer name="salesrule" instance="Magento\SalesRule\Observer\SalesOrderAfterPlaceObserver" />
</event>
<event name="sales_model_service_quote_submit_before">
    <observer name="salesrule" instance="Magento\SalesRule\Observer\AddSalesRuleNameToOrderObserver" />
</event>

but none looks like the one i need. I needed the same for when adding a coupon but i managed to do something if "pluggin in" the canProcessRule method of Magento\SalesRule\Model\Utility but i cant find something similar for when the coupon is removed

Theese operations like add and remove a coupon are made only in JS? There is a controller that process this?

Looking at checkout_index_index.xml layout it pass an item argument Magento_SalesRule/js/view/payment/discount which then loads theese two js

Magento_SalesRule/js/action/set-coupon-code
Magento_SalesRule/js/action/cancel-coupon

That by the name itself looks pretty straightforward, one to add and one to remove the coupon

In the cancel-coupon JS doing a console.log to url return:

rest/default/V1/guest-carts/21229ffad7bf01311b645a4423a4ae22/coupons

This is using rest web services? (Kind of same url for when adding a coupon)

There is a way to know when a coupon is removed from the quote/cart?


texts: Magento2.2.4 - Invalid form key while save product

texts:
I have Magento 2.2.4.

I have tried increasing max_input_vars in php.ini file.

I have cleared var/cache, browser cache, removed domain cookies.

Still, get the error when trying to edit an existing product.
But, I can create new products without any issue.

Error: Invalid Form Key. Please refresh the page.


texts: How do I block hackers or bots from accessing newsletter signup

texts: I am receiving large amounts of newsletter subscription signups which are coming in at a rate that is too fast to be real. When I looked up the ips from my online customers, some of the ips are proxy ips and other ips from Russia, Ukraine and France. I disabled newsletter signup and blocked a whole lot of ips, and when I enable it again, I was fine for a day or two and it started up again. Are these hackers or bots? Does anyone know how I could stop this?


texts: how to sort specific payment method in 1st place in checkout page in magento where i want  PPG as 1st option which is not having sort order field


texts: Use datasource of admin grid in another grid

texts:
In Magento 2.2.5, I am using datasource in the grid and it is working fine.

I want to use the same datasource in another grid with some filters. I am using vendorname_module_deal_listing_data_source again in the another grid. But it is keeps loading. I cannot find any errors in console and log anywhere.
Code of di.xml is:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="vendorname_module_deal_listing_data_source" xsi:type="string">Vendorname\Module\Model\ResourceModel\Deal\Collection</item>
        </argument>
    </arguments>
</type>
<virtualType name="Vendorname\Module\Model\ResourceModel\Deal\Collection" type="Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult">
    <arguments>
        <argument name="mainTable" xsi:type="string">module_manage_deal</argument>
        <argument name="resourceModel" xsi:type="string">Vendorname\Module\Model\ResourceModel\Deal</argument>
    </arguments>
</virtualType>

Update:

admin layout Code: https://pastebin.com/ZRw0ug9D

Screenshot: https://prnt.sc/kzqzov

Working Grid's UI Component: https://pastebin.com/Lb7QZmUt

Copied Grid's UI Component: https://pastebin.com/i3DXVita


texts: Magento 2 - Add image to a product programmatically without saving the whole product

texts:
I'm writing a script which saves products programmatically using a large file of data (6k products). My file can add or update a product.
Saving a product is a long process, so if the product already exists, I don't want to use the save method.
$this->productRepository->save($product); // Too slow for 6k products !

Currently, my script works perfectly with the product resource saveAttribute() method for all my attributes... but I want to do it with my images too !
Here is how my code looks like:
/** Magento\Framework\Filesystem $fileSystem */
/** Magento\Framework\App\Filesystem\DirectoryList */
/** Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
/** Magento\Catalog\Api\Data\ProductInterface $product */

class Stock extends Command
{
    protected function __construct(
        Filesystem $filesystem,
        ...
    ) {
        $this->mediaDirectory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA)
        ...
        parent::__construct();
    }

    ...

    private function updateProduct(ProductInterface $product, array $data) {
        ...

        $productResource = $product->getResource();
        $productResource->saveAttribute($product, 'price');
        ...
        $productResource->saveAttribute($product, 'height');

        ...

        $imagePath = "catalog/product/{$sku}.png";

        if ($this->mediaDirectory->isFile($imagePath)) {
            $product->addImageToMediaGallery($imagePath, ['image', 'small_image', 'thumbnail'], false, false);
            /* How to save image without saving the whole product now ? */
        }
    }
}

Is there a way to save image without using the save() method of the product ?
Is there a more optimized way to save attributes ? (I save one attribute per lines, which means I have 12 lines "saveAttributes", which is not very elegant).
Thanks !


texts: Stores->Configuration->Advanced->Advanced Not showing up

texts:
I'm trying to set up a custom cron job as per this tutorial, but Stores -> Configuration -> Advanced -> Advanceddoes not exist on my backend.
This is what the Advanced menu looks like for me:

This is what step 2 (before any code) the tutorial thinks it should look like:

Was that tab removed in 2.2?


texts:
I'm looking for a method of password protecting an entire magento store. Unfortunately i can't use the htpasswd method, as I have some external SOAP stuff going on that can't be updated to bypass this.

I also can't have it based on the standard magento user accounts, as I need the magento store to function as normal (sign up for individual accounts etc) once someone has entered in a global username and password.

Any thoughts?


texts: Destroy customer sessions programatically

texts:
Even if I'm logged out of the site, I see my information in Online customers section in Magento admin if I'm not closing the window which seems to be normal Magento flow.

How can I destroy my session completely so that when I'm logged out, website will track me as a guest user?

I've tried firing customer_logout event and cleaning frontend cache using Mage::app()->cleanCache(); but it doesn't seem to be built for this purpose.

Here is observer function

public function flushCache(Varien_Event_Observer $observer)
    {
        $customer = $observer->getEvent()->getCustomer();
        Mage::app()->cleanCache();
        Mage::getSingleton('customer/session')->unsetAll();
    }


texts: How to add a 'preview' column in magento grid?

texts:
I want to add a Column in grid with 'preview' text. Like in image :

 When I am over text with mouse I want to display a html page. The html page it is tacked from database(BLOB type).

I've tried:
RENDERER:

 public function render(Varien_Object $row)
            {
               //grid is filled with data from custom table page(id, title, html_code-BLOB)
                $aId =  $row->getData($this->getColumn()->getIndex());
                $a = Mage::getModel('page')->load($aId);

               //HtmlCode is a column from database that contains BLOB html page
                $sourcecode = $a->getHtmlCode();

            if(isset($sourcecode))
        {
            $value='preview';
        }

        return $value;

    }

but I don't know how to make to show $sourcecode on hover.


texts: Return sub category thumbnails on all pages (at all levels)

texts:
I have the following to return all thumbnails however it only returns top-level category thumbnails:

                        <?php $_helper = Mage::helper('catalog/category'); ?>
                        <?php $_categories = $_helper->getStoreCategories(false, true, false)
                                        ->addAttributeToSelect('thumbnail')
                                        ->addOrderField('name');?>

                         <?php foreach($_categories as $_category): ?>
                         <?php $thumb = Mage::getBaseUrl('media').'catalog/category/'.$_category->getThumbnail();?>

                           <a href="<?php echo $_helper->getCategoryUrl($_category) ?>"><?php echo '

';?>

                        <?php endforeach; ?>


texts: How to get pending products in magento 2

texts:
Here I added one product per customer function works well. But if payment is canceled or pending also this works. I need this to work only when order status is pending or canceled  but shouldn't work when status is processing or success.

 $_product = $objectManager->create('Magento\Catalog\Model\Product')->load($match);
        $categoryIds = $_product->getCategoryIds();

    if (in_array(77, $categoryIds)) //if its category is schemes
      {

    echo "
You have repeated items In Cart, try adding Differnt products
";
      $block->deleteQuoteItems();
      }


texts: Strike orginal price and show advanced pricing and show total saving in 2.3.3

texts:
I have a configurable product in which each simple product is given as advanced pricing.
I need to show the both advanced pricing and the original price to be striked out as shown below.

It has to get applied on the cart and mini cart section also.

I need to display the total saving also in mini cart and checkout.

i.e Original price -Advanced price = Total saving for each product

Can anyone tell how to acheieve this?

Thanks in advance.


texts: Magento 2 Zoom in not working for mobile screens

texts:
we are using magneto 2.2.6, ethan theme for some website.Zoom option is working for desktop only for mobile screens it doesn't support here is our code

            20

            350
            300
            hover
            true

                    767px

                        thumbs

    <var name="product_small_image_sidebar_size">100</var>  <!-- Override for small product image -->
    <var name="product_base_image_size">275</var>           <!-- Override for base product image -->
    <var name="product_base_image_icon_size">48</var>       <!-- Base product image icon size -->

    <var name="product_list_image_size">166</var>           <!-- New Product image size used in product list -->
    <var name="product_zoom_image_size">370</var>           <!-- New Product image size used for zooming -->

    <var name="product_image_white_borders">0</var>
</vars>
<vars module="Magento_Bundle">
    <var name="product_summary_image_size">58</var>

        1MB


texts: Magento 2 : How to handle array values in custom email templates?

texts:
This is my observer from where i am passing product name,prodcut price and product quantity in my custom email template file email_template.html .

$templateVars = array(
            'store' => $this->storeManager->getStore(),
            'order' => $order,
            'items'=> $items,
            'productName'=>$productName,
            'productPrice'=>$productPrice,
            'productQuantity'=>$productQuantity,
            'payment_html' => $this->getPaymentHtml($order),
            'formattedShippingAddress' => $this->getFormattedShippingAddress($order),
            'formattedBillingAddress' => $this->getFormattedBillingAddress($order),
       );
        $from = array('email' => "ramkishan.suthar@ranosys.com", 'name' => 'Ramkishan');
        $this->inlineTranslation->suspend();
        $to = array($customerEmail);
        $transport = $this->_transportBuilder->setTemplateIdentifier('order_template')
            ->setTemplateOptions($templateOptions)
            ->setTemplateVars($templateVars)
            ->setFrom($from)
            ->addTo($to)
            ->getTransport();
        $transport->sendMessage();
        $this->inlineTranslation->resume();

In my email_template.html

       {{layout handle="email_product_list" items=$items area="frontend"}}

email_product_list.xml

product.phtml

<?php $_items = $block->getItems() ?>

                <?= /* @escapeNotVerified */  __('Items'); ?>

                <?= /* @escapeNotVerified */  __('Qty'); ?>

                <?= /* @escapeNotVerified */  __('Price'); ?>

    <?php foreach ($_items as $_item): ?>

            <?php $_item->getName() ?>
            <?php $_item->getSku() ?>
            <?php $_item->getPrice() ?>

    <?php endforeach; ?>

what i am doing wrong ?


texts: Use all images from my default store on my new store view

texts:
I have a new store view and i've updated all the products using the

magento admin: Manage Products > Select all > Update Attributes

and then selecting the new store. Now that all my products are affiliated with my new store view i'm having a problem with all my images. On the front end it shows all placeholders. In the admin panel when i click on a product and then images.. it may have images but it's not selected to use base image, small image or thumbnail.

Is there a way to update all images on my new store view to use the default store view main images?

require_once 'abstract.php';

class Attach_Default_Store_Images Extends Mage_Shell_Abstract {

    public function run()
    {
        $products = Mage::getModel('catalog/product')->getCollection();
        foreach ($products as $product) {
            $productFrom = $product->setStoreId(1)->getImage();
            $productTo = $product->setStoreId(13)
            ->setImage($productFrom)
            ->setSmallImage($productFrom)
            ->setThumbnail($productFrom);
            echo "Images Updated\n";
            $product->save();
   }

        Mage::getModel('catalog/product_image')->clearCache();
        echo "Image Cache Cleared\n";

    }

    public function usageHelp()
    {
        return <<<USAGE
Usage:  php -f cache.php -- [options]
        php -f cache.php -- clean

  clean             Clean Old Cache
  help              This help

USAGE;
    }
}

$shell = new Attach_Default_Store_Images();
$shell->run();

Run a shell script with above?


texts: Inserting multiple elements into product grid cells with unique css (Magento 2)

texts:
I'm wondering how to insert many html elements into a cell in the product grid. I have an HTML template that serves style and other attributes via a JavaScript component, but I can only insert one HTML element into the cell.

Is it possible to insert multiple HTML elements?


texts: The main entry point of our webshop is shop.com/dashboard. When I want to redirect to this page, I use Mage::getUrl('dashboard') and it works fine. However, when in a specific website (E.g.: shop.com/branded-shop), Mage::getUrl('dashboard') returns shop.com/branded-shop/dashboard. Same goes for login/register/account/... links. How can I generate a link using Magento's getUrl methods, that always points me too /dashboard, so without the website folder (branded-shop)?


texts: Modify In Stock functionality of Layered Navigation

texts: In a specific requirement, we need to have out of stock product listed on website for back orders, magento does offer it very well, but I am looking to have a filter for layered navigation, if chosen it should only list products which has got qty >0 , means readily available, if I enable that qty and stock status in layered navigation along with option of show out of stock products, it always list out of stock products too, while I dont want them if that filter is selected.


texts: Control visibility of layout Block on the basis of session value

texts:
I want to display a layout block only when there is some attribute is set in customer session.
It can be controlled with a config value. Is it possible to do it with session too?


texts: Disable product attribute from admin edit in magento 2

texts:
I have create an attribute viewed_count, I will write a code to update it from observer.

Now I don't want anyone to edit it from admin, So I want to make it disabled from admin edit.

How can I achieve it? Please help me find solution on this.


texts:
What are the limits for pictures on the product page? Is it the total size of the pictures that's limited, the number of pictures or both?

I've gotten fatal errors when I uploaded 9 images and also when the image was 6mb.

This is magento1.9

Update. I uploaded 24 images about 100kb each and at first try the page didn't load right (only pictured loaded, no text, no buttons, everything was blank) On second try it did.

When I try from my phone I get same thing but with errors, but after reloading a few times it loads.

And here are the links. Try all 3 products. They're identical.

http://booomchik.com/leashes.html

Can someone please explain what those errors mean? Total size of my pics is 3mb or so.


texts: Get items in cart by customer id in custom adminhtml controller (M1)

texts:
In my custom adminhtml controller, I need to check if a customer's cart is empty or not.

I have tried things like:

$quote = Mage::getModel('sales/quote')->setSharedStoreIds($storeIds)->loadByCustomer($customer_id);

and variations.

I'm able to get a quote's id and even tried to get products from the cart by loading a quote by id but it always returns empty. Anyone has done something similar?

Magento 1.9.2.4


texts: how to get additional details in soap api response

texts:
Hi i am working on magento soap_v2_wsdl. now i want some additional data for example i want category image in the category tree.

i know there is no default method to get the detail. But i can over write the core file to get the result. Now i want to know which file do i have to change to get the category image in the category tree soap response. Thanks in advance.

i already try to edit Mage_Catalog_Model_Category_Api which is located in /app/code/core/Mage/Catalog/Model/Category/Api.php but it is not changing anything in the result.


texts: When I click on Upload Image, nothing happens in Firefox.  There are no popups and no error messages in the code inspector.  This works fine in Chrome and IE, but since last week I have been unable to add images to products in Firefox.  I am using the latest version of Firefox (32.0.2) and Flash.  I maintain five Magento sites on different servers, using versions 1.7.02 and 1.8 and they all have this issue.  Are there any workarounds or bug fixes available?


texts:
I'm looking around to see if this is possible but have not found anyone explicitly stating it as such.

What I want to know is can I have a Magento multi store setup where one store is on a subdomain, one on the main domain and one on a completely different domain but all pointing to the same Magento.

My Magento install is 1.9.1

Alternatively if this is not possible, how much work is involved in changing the whole multisite to use just the different domain names option from currently using the sub domains set up.


texts: Compare data in database with jquery and json

texts:
Is it returning me error 500 syntax, does anyone see any errors?

jQuery Code

            var ordertxt = $j("#ordertxt");
                ordertxt.blur(function() {
                    $j.ajax({
                        url: '<?php echo Mage::getUrl('contato/index/verifica') ?>',
                        type: 'POST',
                        data:{"ordertxt" : ordertxt.val()},
                        success: function(data) {
                        console.log(data);
                        data = $j.parseJSON(data);
                        $j("#msg_pedido").text(data.ordertxt);
                    }
                });
            });

Controller Action

    public function verificaAction() {

            if(isset($_POST['ordertxt'])){

            //Recebe o Email Postado
            $ordertxt = $_POST['ordertxt'];

            //Conecta banco de dados
            $sql = Mage::getModel('sales/order')->loadByIncrementId($ordertxt) or print mysql_error();

            //Se o retorno for maior do que zero, diz que já existe um.
            if ($sql[0]['increment_id'] == $ordertxt) {
                echo json_encode(array('ordertxt' => 'Pedido Valido'));
            }else{
                echo json_encode(array('ordertxt' => 'Pedido Invalido.' ));
            }
        }
}


texts: Products not loading on Load More in magento 2.3

texts:
The load more button is not working for loading products as shown here.

  https://prnt.sc/p45em5

When i click on load more it shows Loading.

  https://prnt.sc/p45f11

But then again it show load more

  https://prnt.sc/p45em5.

The products are not getting loaded.
May be the script is not called?


texts: How do you get the new product ID after programmatically creating the product?

texts:
I have a configurable product and am trying to programmatically create a new simple product and then associate it with my configurable product.  This is what I have so far...

$newProduct = $this->_productFactory->create();
$newProduct->setName('Test Product')
    ->setTypeId(Type::TYPE_SIMPLE)
    ->setSku('test-product')
    ->setPrice($configurableProduct->getPrice())
    ->setWeight($configurableProduct->getWeight())
    ->setStatus(Status::STATUS_ENABLED)
    ->setVisibility(Visibility::VISIBILITY_NOT_VISIBLE)
    ->setAttributeSetId($configurableProduct->getAttributeSetId())
    ->setData('my_product_attribute', 'sample_value');
$this->_productRepository->save($newProduct);
$newId = $newProduct->getId();

However, when I try to get the new product ID $newId after using the product repository to save, the value is null.  The simple product saves correctly, but I need the ID to be able to associate it with the configurable one.  Am I missing something?


texts: Autoselect free shipping option on checkout

texts: On checkout page, if free shipping available - this option should be already selected. How can I do this in Magento2?


texts: Magento 2.3.5 Content Security Policy directive: "img-src

texts:
Upgrade to 2.3.5 and now getting this error bellow thought out the site on every page:

  [Report Only] Refused to load the image
  'blob:http://my.domayn.com/axxxxxxxxxxxx' because it violates the
  following Content Security Policy directive: "img-src
  widgets.magentocommerce.com www.googleadservices.com
  www.google-analytics.com t.paypal.com www.paypal.com
  www.paypalobjects.com fpdbs.paypal.com fpdbs.sandbox.paypal.com
  *.vimeocdn.com s.ytimg.com 'self' 'unsafe-inline'".

Is anyone facing the same issue?


texts: I would like send newsletter from Magento control panel.But that function not working. How can i send newsletter from Magento. How is it working? if you have any reference link send me.


texts: How to Add VAT or Business number on .PDF invoice?

texts: How to add a Business Number or VAT number on .PDF invoice that is generated in Magento?


texts: Magento 2 Configurable Products Cannot Be Built From Attribute Set

texts: In the previous version of Magento, it was possible to create a configurable product from an attribute set.  Why is it that when I create a new configurable product, the magento manual says that I can choose an attribute set, but the admin pages block that option and do not allow me to select an attribute set?


texts: How to customize checkout page in magento 2?

texts:
Is it possible to sort the order of email field at the top of the page after lastname field in shipping form?
Is there any way to bring remove login part in checkout page and bring email field after last name field?


texts: Magento 2: Not showing customers in backend grid

texts:
There are customers imported from Magento 1.9.1.0 which are in customer eav customer_entity and related tables. But admin customer grid shows no records. I have also tested adding new customer from the backend, they are added. Those imported customers can login in the frontend. Customer Index Management always shows processing.

I have tried to manually reindex bin/magento indexer:reindex customer_grid.

It doesn't seem to do anything. I don't think setting up cron will help either. However, it is my localhost.

  Customer Grid index has been rebuilt successfully in 00:00:00

Your suggestions are highly appreciated.

Thank you in advance


texts: Use Mailchimp templates for Magento transactional emails

texts: I am about to set up marketing automation and abandoned cart emails using Mailchimps integration for Magento. I would however like to align the design between the marketing emails from Mailchimp and the transactional emails in Magento. What is the easiest way to use a template from Mailchimp for Magento's transactional emails?


texts: Can't import product names/descriptions with special characters

texts:
I'm trying to import a product CSV which has Bulgarian product names/descriptions (using the standard import under import/export->import)

The only way I've been able to import any so far is by wrapping them in quotes or by putting roman characters in front of the Bulgarian.

e.g. 'Ламинирани ПДЧ' or xxx Ламинирани ПДЧ

without adding these characters it outputs the error: Required attribute 'name' has an empty value in rows: 1

It seems like the Bulgarian is being stripped out completely? My file is encoded as UTF-8 and I've also set the default charset as UTF-8 in the htaccess file.

Is it possible to import the Bulgarian without quotes/roman characters? Im hoping it works out of the box but if there's a programmatic solution to it then that's fine too.


texts:
Vendor/ModuleName/Model/TestModel.php
Vendor/ModuleName/Model/Data/TestModel.php
Vendor/ModuleName/Model/TestModelRepository.php

Interfaces are already created.

The Data Model contains for eg. these methods:

public function getFirstname() {};
public function getLastname() {};

the regular Model contains:

public function getName() {
    return $this->getDataModel()->getFirstname() . ' ' . $this->getDataModel()->getLastname();
}

The new Magento service contracts architecture recommend to seperate entity information methods (from data model) and "action" methods (regular model). The repository return an instance of data model, so how can i call the getName() method from regular model ? Should i create a new feactory for the regular model and add the data model data?

Magento 2.2.6

Maybe someone has a good example for me?

lots of thanks


texts:
Magento 2.3.3 is behaving weird.

I have sample products. All have the same base price 0.30 €, tax is 19% VAT

But when my clients order the prices in the same order are sometimes 0.36 €, sometimes 0.35 €

Does anyone have a clue how to fix this? That is super strange.

I would be very thankful for any help on this.

Best regards


texts: How to add a (working) widget button to category WYSIWYG editors?

texts:
I need to add the widget button to the WYSIWYG editors of some category attributes.

There are two questions on Stack Overflow with accepted answers:

Magento: How to add the widget button to the WYSIWYG Products Editor
Magento: Add Widget tool onto product and category WYSIWYG

The one problem: this solution doesn't work 100% (tested on EE 1.12.0.2 and CE 1.7.0.2).

What's the problem?

If you set the config entry add_widgets to true (btw, you can do that by observing the event cms_wysiwyg_config_prepare, that's better than rewriting or overwriting the helper block), the widget buttons are displayed. That's fine.

You can even use the "Insert Widget..." button outside the WYSIWYG Editor. That's good.

The problem is the widget button in the WYSIWYG editor: you can click on it, the widget manager opens but when you select a widget type, the configuration area doesn't open.

The reason is that there is a JavaScript error happening:

"HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy"

Even after debugging for some time I didn't find out how this can be fixed. Did somebody of you already solve that problem?


texts: Magento 2.2.6: How to define max width page?

texts:
I need the page to be seen with the maximum possible length

Class:

What do I need to replace?


texts: getting order details from sales_order_save_commit_after event

texts:
I am trying to get Product id and and product price from <sales_order_save_commit_after event>
Here's my Observer code

$order = $observer->getOrder();
$product_id=$order->getProductId();
$price=$order->getPrice();
  Mage::log($product_id, null, 'events.log', true);
    Mage::log($price, null, 'events.log', true);

But I am not getting any value


texts: Magento 2 how to refresh/reload shipping-method-item.html

texts:
I would like to reload the shipping methods information on a click of button for example.

When the country change it does an ajax to

http://magento2/rest/default/V1/guest-carts/d24ce87dd5f5681ce4597740729664d8/estimate-shipping-methods

and then reload the Shipping Methods!

How to reload in like when user change the country in the drop down on address form.?

thanks in advance.


texts: How to rewrite Shipping_Model_Carrier_Tablerate on Magento 1.9

texts:
I would overwrite app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php with my custom component. My code:

  app/etc/modules/Infocurci_Shipping.xml

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

  app/code/local/Infocurci/Shipping/etc/config.xml

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <modules>
        <Infocurci_Shipping>
            <version>0.1.0</version>
        </Infocurci_Shipping>
    </modules>
    <global>
        <models>
            <shipping>
                <rewrite>
                    <carrier_tablerate>Infocurci_Shipping_Model_Carrier_Tablerate</carrier_tablerate>
                </rewrite>
            <shipping>
        </models>
    </global>
</config>

  app/code/local/Infocurci/Shipping/Model/Carrier/Tablerate.php

<?php
class Infocurci_Shipping_Model_Carrier_Tablerate extends Mage_Shipping_Model_Carrier_Tablerate
{

    public function collectRates(Mage_Shipping_Model_Rate_Request $request)
    {
       die('this is only a test');
    }

}

What's wrong? I do not see my code in action.


texts: Why is additional_information on payment information empty?

texts:
While testing my checkout process, I buy an item and in the Sales, Orders admin screen, in the payment information box, I get
'CreditCard
Payment has not been processed yet.' Instead of the credit card details, name of account holder etc.

In the comments history it says 'The payment was successfully processed.'

After checking the phtml template in the path hints, I think my problem is that

$this->getInfo()->getData('additional_information');

from

class Mage_Payment_Model_Info extends Mage_Core_Model_Abstract

is empty. Why could this be happening, or is there a way for me to retrieve the additional information as an array?

Any help would be much appreciated.


texts: Product image not showing in Category Page In Magento 2.1.6

texts:
I have installed Magento 2.1.6 and import products using csv, After import Products.

I have did below services,  But Product image not showing on Product list Page. its goes to 404.

upgrade the module
Reindex
Flush Cach
Restart Cron.

Reference:

Product List Page:

404_error Image:

I have checked Product image path, like

  /media/catalog/product/cache/f073062f50e48eb0f0998593e568d857/1/_/1.jpg

but not generated f073062f50e48eb0f0998593e568d857 this folder in with in cache folder.

I also regenerated static content also., its not works for me Suggest me How to fix this issue.


texts: Magento 2 - How to upgrade to magento 2.4.0?


texts: Magento 2: Different layout for specific product?

texts: Is there a way to specify a layout (blocks in different positions and styled differently) for a specific product ?


texts: override magento url routing in my module

texts:
how can i override URL routing of magento2?

there is a huge UTF8 problem on URLs

magento2 don't recognize something like تست.html

Anybody please help me on how can i override the routing in module so I can dig into and fix the utf8 problem of URLs


texts: Basic steps to install a languge pack or locale in Magento 2

texts:
I am trying install a German language pack by following below steps.

app/i18n/splendid/de_de/composer.json

{
    "name": "splendidinternet/mage2-locale-de-de",
    "description": "German (Germany) language",
    "license": [
        "OSL-3.0"
    ],
    "require": {
        "magento/framework": "^100.0.0"
    },
    "type": "magento2-language",
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
}

app/i18n/splendid/de_de/language.xml

<language xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/Language/package.xsd">
    de_DE
    <vendor>splendid</vendor>
    <package>de_de</package>
</language>

app/i18n/splendid/de_de/registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::LANGUAGE,
    'splendid_de_de',
    __DIR__
);

app/i18n/splendid/de_de/de_DE.csv

Filled with translation phrases.

Run the below commands.

php magento setup:upgrade
php magento setup:static-content:deploy de_DE
php magento i18n:collect-phrases -o "/var/www/m7agento211/app/i18n/splendid/de_de/de_DE.csv" -m
**Got the responce : Dictionary successfully processed.**

php magento i18n:pack -d /var/www/m7agento211/app/i18n/splendid/de_de/de_DE.csv de_de de_DE
**Got the responce : Successfully saved de_DE language package.**

Then i configured

Admin -> Stores -> Gonfiguration -> General ->Locale Options
<option value="de_DE">German (Germany)</option>

I browsed lot of question like this but none of them has proper answer.

No errors in above steps, But language is not applied in front-end. Can any one help me on where i am doing wrong.


texts: Magento 1.9 : Error getting collection Model of Catalogrule

texts:
I try to get a collection of Mage::getModel('catalogrule/rule') but when I do Mage::getModel('catalogrule/rule')->getCollection() I have an error because can't call a function of boolean.

I do a if:

if(Mage::getModel('catalogrule/rule')) echo "hello"; else echo "no";

Always say "no".


texts: Integrity constraint violation: when updating an attribute value of a product

texts:
I have a global attribute called vouchercode_amount (textfield) and I want to set text data when ever the value is calculated.

Everything works fine till I try to update the value of that attribute for that specific product.

Code is below :

    $simple_product = Mage::getModel('catalog/product')->load("sku",$sku);
    $realProduct = Mage::getModel('catalog/product')->load($simple_product->getId());
    $vouchercode_amount = $couponCode."-".$voucherRule->getData('discount_amount')."-".$voucherRule->getData('description');
    $realProduct->setData("vouchercode_amount", $vouchercode_amount);
    //Tried also with
    // $realProduct->setVouchercodeAmount($vouchercode_amount);
    // No difference
    try{
        $realProduct->save();
    }
    catch(Exception $e){
        echo "{$e}";
    }

I got always the same error saying that :

  Integrity constraint violation: 1452 Cannot add or update a child row:
  a foreign key constraint fails (**********.catalog_product_entity,
  CONSTRAINT FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID
  FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set
  (attribute_set_id))

Product is there, attribute is there and put inside the related attribute_set already.

How can I solve this issue?


texts: DEBUG (7): Security problem: block_name has not been whitelisted. (Magento system.log)

texts:
In the system.log file of my Magento install I have the following error message

  DEBUG (7): Security problem: block_name has not been whitelisted.

where block_name is the name of a block used in my store.

What does it mean and how do I fix it?


texts: Price as Configured Displaying as 0.00 on Bundle Product in Magento 1.9

texts:
I have created a bundled products,

In that product price as configured showing zero.

I don't know why its showing zero and please explain me what is the use of price as configured.


texts:
how can I show the loader only on my div and not on the body during an ajax call ?

Can't make it work.

Here's my code, I have the show loader and the context but I'm missing something ?


texts:
We used to be able to access advanced reporting now we are displayed with the following

Your Base URL has been changed and your reports are being updated. Advanced Reporting will be available once this change has been processed. Please try again later.

Our site meets all the criteria of being on SSL, on a public server etc. any assistance in getting this working again would be great. Also to note under config settings advanced reporting the status never moves from pending


texts: Shopify to Magento 2 products csv converter

texts:
I want to migrate my products from shopify to magento. Is there any code present on github or any other software for this? I don't need to go for paid extensions. Need some script to convert programmatically to get products from shopify and convert to Magento 2.3 format csv.
I found this https://gist.github.com/molotovbliss/857973a27109b6770346 but it is for Magento 1.


texts: CSS broken for the fresh magento ver 1.9.2.0 install

texts:
I've downloaded magento ver 1.9.2.0 (latest one) from the official website magentocommerce.com/download  and installed it using the standard steps. But, now the css is broken and I'm getting a plain text file. Attaching the screenshot.

I've tried the following solutions already:

Cleared the cache in var/cache folder and removed all the files from var/session folder as well.
changed the permissions of media and var folders to 777.
Made sure that core_config_data table has proper values for the paths:-

web/unsecure/base_url    mystore.com/
web/secure/base_url      http://mystore.com/

Tried installing different theme(bluescale) but couldn't do that because the UI of our website is broken and hence, few of the buttons are not working.
Tried installing magento from windows/mac laptop.
Installed flash on my chrome.

I checked few more similar answers but nothing worked out so far.
Please see if someone can help.


texts:
I create my theme for magento and i can't show products in grid mode on my homepage.

I use this to show all products on my homepage but products is in list mode.

{{block type="catalog/product_list_random" name="product_random" template="catalog/product/list.phtml"}}

Here is my catalog.xml and my list.phtml

Can you tell me what i need more to add for this grid mode?


texts: Magento 2 Get Product collections by specific attribute

texts:
I'm trying to get product collection by custom attribute "Age"
Age is a Dropdown attribute

Please help me to get this solution?


texts: Creating new header child block in local.xml under  doesn't work

texts:
I want to include my custom bolck inside header block, only on <catalog_category_layered>.

So I have this code in local.xml:

<catalog_category_layered>
    <reference name="header">
        <block type="core/template" name="header.catnav" as="header.catnav" template="catalog/catnav.phtml" />
    </reference>
</catalog_category_layered>

And my block is not included.
When I change my reference to <reference name="head"> or <reference name="left"> it gets included in these areas.

It doesn't get included in name="content" and name="footer" too.

What do you think am I doing wrong?
How do I make my block appear in the header?


texts: Magento-2 : Add "Use Config Settings" check-box to custom block form

texts:
I have custom admin form and want to show "Use Config Settings" check-box to just under form field.

For Example,
In product edit page, If you open "Advanced Inventory" link, you will see "Use Config Settings" which is display default system configuration value.

I want to do same thing in my custom admin form.

Any one had did this? Please share your solution here.

Thanks


texts: Creating product attribute programmatically in Magento 2.3.5

texts:
Ive tried to add 2 product attributes in Magento 2.3.5 programatically using install data. The attributes aren't being created and after some searching i found out that > 2.3.3 install and upgrade data where phased out for a declarative approach. Does anyone have any examples on how to do this outside of installdata/upgradedata? Here is what i was trying to add:
<?php

namespace XX\Pricing\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;

    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->removeAttribute(\Magento\Catalog\Model\Product::ENTITY, 'product_price_tier');
        $eavSetup->addAttribute(\Magento\Catalog\Model\Product::ENTITY, 'product_price_tier', [
            'group' => 'Product Price Tier',
            'type' => 'int',
            'sort_order' => 200,
            'backend' => '',
            'frontend' => '',
            'label' => 'Custom Yes/No',
            'input' => 'boolean',
            'class' => '',
            'source' => 'Magento\Eav\Model\Entity\Attribute\Source\Boolean',
            'global' => \Magento\Catalog\Model\ResourceModel\Eav\Attribute::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '',
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'unique' => false,
            'apply_to' => ''
        ]);

        $eavSetup->removeAttribute(\Magento\Catalog\Model\Product::ENTITY, 'product_price_family');
        $eavSetup->addAttribute(\Magento\Catalog\Model\Product::ENTITY, 'product_price_family', [
            'group' => 'Product Details',
            'type' => 'varchar',
            'backend' => '',
            'frontend' => '',
            'sort_order' => 220,
            'label' => 'Product Price Family',
            'input' => 'text',
            'class' => '',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '',
            'searchable' => false,
            'filterable' => false,
            'comparable' => false,
            'unique' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => true,
            'apply_to' => ''
        ]);
    }
}


texts: Retrieve dropdown attribute value magento2

texts:
Hello I have created one dropdown attribute with code "custom_collection"

I want to show it on product listing page under each product so in list.phtml file i added this code

$attr_m = $_product->getData('custom_collection');

echo $attr_m;

It returns some id but its not showing the attribute value


texts: Magento 2 - Retriving frontend layout blocks from adminhtml

texts:
Problem

I need to gain access to the children blocks from the parent block alias of customer_account_navigation from the frontend layout to be used in the adminhtml system configuration.

Current Attempt

As the code is being run in the admin area (adminhtml) I assume emulation is required in order to retrieve anything from the frontend, I have used the $appState->emulateAreaCode method which has a call back and the initialised the ObjectManager as frontend.

class AccountLinks implements \Magento\Framework\Option\ArrayInterface
{
    protected $_options = [];

    /**
     * @var \Magento\Framework\ObjectManagerInterface
     */
    protected $_objectManager;

    /**
     * @var \Magento\Framework\ObjectManager\ConfigLoaderInterface
     */
    protected $_configLoader;

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Magento\Framework\ObjectManager\ConfigLoaderInterface $configLoader
    )
    {
        $this->_objectManager = $objectManager;
        $this->_configLoader = $configLoader;
    }

    /**
     * Retrieve my account menu links.
     *
     * @return array
     */
    public function toOptionArray()
    {
        if (!$this->_options) {
            /* @var $appState \Magento\Framework\App\State */
            $appState = $this->_objectManager->get('Magento\Framework\App\State');

            $appState->emulateAreaCode('frontend', [$this, 'emulateDesignCallback']);
        }

        return $this->_options;
    }

    public function emulateDesignCallback()
    {
        $this->_objectManager->configure($this->_configLoader->load('frontend'));

        /* @var $layout \Magento\Framework\View\Layout */
        $layout = $this->_objectManager->create('\Magento\Framework\View\LayoutInterface');

        $layout->getUpdate()->addHandle('default');
        $layout->getUpdate()->addHandle('customer_account_index');

        $layout->getUpdate()->load();
        $layout->generateXml();
        $layout->generateElements();

        $blocks = $layout->getChildBlocks('customer_account_navigation');

        return $this;
    }
}

Debugging

I can see 2 frontend blocks which seems to imply that using addHandle is not working correctly to generate the correct blocks.

I am also unsure if I am loading the layout after setting the handles correctly.

The _configScope is incorrectly saying it's current scope is adminhtml even with the emulation, I wonder if this is causing the problem but I can't work out how to set it

Any ideas? Thanks.


texts: Can't get custom attribute from getUsedProducts

texts:
This follows on from my previous question.

I am getting all the child products of it's parents by using the following:-

$associatedProducts = Mage::getModel('catalog/product_type_configurable')->getUsedProducts(null, $product);

I am already fetching values from custom attributes (dropdowns) in simple products using the following:-

$sizing = $simple->getAttributeText('product_size_women');

This works fine, I am able to get the size value for each simple product but this attribute is set as 'Use To Create Configurable Product'.

I cannot fetch the values from a different custom attribute (also a dropdown) that isn't used to create a configurable product though and I suspect this has something to do with how getUsedProducts functions.

I have tried loading the attribute id into an array like below but this has no affect probably because attributes that aren't used to create a configurable cannot be retrieved in this function - I'm unsure.

getUsedProducts(array(id_of_your_attribute), $product)

I'd simply like to get the value of the custom attribute in the same way as I am getting the sizing ones above:-

$sendtofeed = $simple->getAttributeText('attribute_code'));

Can someone point out where I am going wrong?


texts:
While I'm studying a line of code in magento vendor file I found this code:
$resultRedirect->setPath('*/*/');

What does this '*/*/' means and where does this redirects.
Hope I will get more clarification.


texts: Is using {{block}} to include a CMS block in an Email the right way - or how to include a block in strict email template mode?

texts:
We are running into problems with the I-ways PayPal Module with email templates that use
<div>{{block class="Magento\\Cms\\Block\\Block" area="frontend" block_id="agb_email_german"}}</div>

(see also Magento 2: How to call CMS Block in email templates?)
In Magento 2.3.
I was wondering if that is the right way to include a static block or if there is a better way, especially because of the upcoming strict mode changes.


texts:
I have setup a website on local. Magento version is 2.2.4 and php version is 7.0.33
Frontend is working but admin is not working after upgrade and deploy the code.
But getting error during compilation:
Magearc\Popup\Model\ResourceModel\Statistic
                Incompatible argument type: Required type: string. Actual type: \Magento\Store\Model\StoreManagerInterface; File:
C:/xampp/htdocs/magento224/app/code/Magearc/Popup/Model/ResourceModel/Statistic.php

File code
<?php
/**
 * @copyright Copyright (c) 2016 www.magearc.com
 */

namespace Magearc\Popup\Model\ResourceModel;

use Magento\Framework\Model\AbstractModel;

/**
 * Popup statistic mysql resource
 */
class Statistic extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
{
    /**
     * Block statistic entity table
     *
     * @var string
     */
    protected $_popupInstance;

    /**
     * Construct
     *
     * @param \Magento\Framework\Model\ResourceModel\Db\Context $context
     * @param \Magento\Store\Model\StoreManagerInterface $storeManager
     * @param string|null $resourcePrefix
     */
    public function __construct(
        \Magento\Framework\Model\ResourceModel\Db\Context $context,
        $resourcePrefix = null
    )
    {
        parent::__construct($context, $resourcePrefix);
    }

    /**
     * Initialize resource model
     *
     * @return void
     */
    protected function _construct()
    {
        $this->_init('magearc_popup_statistic', 'statistic_id');
        $this->_popupInstance = $this->getTable('magearc_popup_widget_instance');
    }

    /**
     * Perform actions after object save
     *
     * @param \Magento\Framework\Model\AbstractModel $object
     * @return $this
     */
    protected function _afterSave(AbstractModel $object)
    {
        $connection = $this->getConnection();

        /**
         * save blocks
         */
        $instanceId = $object->getInstanceId();
        if (!empty($instanceId)) {
            $currentCount = $connection->fetchOne(
                'SELECT COUNT(*) FROM ' . $this->getTable('magearc_popup_statistic') . ' WHERE instance_id = ?',
                [$object->getInstanceId()]
            );

            $connection->update(
                $this->_popupInstance,
                ['impression_count' => $currentCount],
                ['instance_id' => $object->getInstanceId()]
            );
        }

        return $this;
    }
}


texts: Filter/Sort Configurable Products by Associated Simple/Super Product Attribute

texts:
I have a query and want to know about this How Magento 2 filtration is working from layered navigation. I have a scenario, There is a configurable product in Magento 2.2 and having 6 associate products with color red, blue, green and size 28, 29

My requirement is that there is the option in admin where admin can disabled color by choose colors(Multiselect). In frontend product list page, that color should not be shown. I have made configuration for disabling color in admin.

  To achieve this,  I have override getUsedProductCollection() in Magento\ConfigurableProduct\Model\Product\Type\Configurable

public function getUsedProductCollection($product){
    $filterColor = array('121'); // where 123 is red color value id.
    $collection = $this->_productCollectionFactory->create()->setFlag(
        'require_stock_items',
        true
    )->setFlag(
        'product_children',
        true
    )->setProductFilter(
        $product
    );
    if (!is_null($this->getStoreFilter($product))) {
        $collection->addStoreFilter($this->getStoreFilter($product));
    }

    if(!empty($filterColor)){
        $collection->addAttributeToFilter(array(
            array('attribute' => 'color','nin'=>$filterColor)
        ));
    }
    return $collection;
}

It works, once category product load but has the issue with layered navigation filter. According to my requirement that if user selects red color from layered navigation. Configurable products shouldn't show red color products because we have disable from collection.


texts: Magento 2.1.3 - no Text Swatches on Frontend [SOLVED]

texts:
I created simple importer for attribute's values.
It works really easy right now and it was necessary for import configurable products.

Importer for attribute values works fine (I'll paste code later).
Importer for products works fine also.

So where is issue?

I have to import values for 2 attributes: Size and Color.
Color is Visual Swatch
Size is Text Swatch.

Color works fine with no problem.
Size is not showing on frontend page:

(there is color swatch and I can select it).

On admin Size attribute, when I'm trying to save it as Text Swatch :

I'm able to save it as Dropdown, and works fine:

Snip for \project\app\code\Magento\Swatches\Model\Plugin\EavAttribute.php:173-183

protected function prepareOptionIds(array $optionsArray)
{
    if (isset($optionsArray['value']) && is_array($optionsArray['value'])) {
        foreach (array_keys($optionsArray['value']) as $optionId) {
            if (isset($optionsArray['delete'])  && $optionsArray['delete'][$optionId] == 1) {
                unset($optionsArray['value'][$optionId]);
            }
        }
    }
    return $optionsArray;
}

code for my importer:
Controller:

namespace Cpny\AttributeImporter\Controller\Attr;

use Magento\Framework\App\Action\Context;

class Upload extends \Magento\Framework\App\Action\Action
{

    protected $_eavSetupFactory;
    protected $_storeManager;
    protected $_attributeFactory;
    protected $_csvImporter;
    protected $_moduleReader;

    public function __construct(
        Context $context,
        \Magento\Eav\Setup\EavSetupFactory $eavSetupFactory,
        \Magento\Store\Model\StoreManagerInterface $storeManager,
        \Magento\Catalog\Model\ResourceModel\Eav\Attribute $attributeFactory,
        \Cpny\AttributeImporter\Model\Getcsv $_csvImporter

    ) {
        $this->_eavSetupFactory = $eavSetupFactory;
        $this->_storeManager = $storeManager;
        $this->_attributeFactory = $attributeFactory;
        $this->_csvImporter = $_csvImporter;

        parent::__construct($context);
    }

    public function execute()
    {

        $attribute_arr = $this->_csvImporter->importFromCsvFile();
        $attributeInfo = $this->_attributeFactory->getCollection()
            ->addFieldToFilter('attribute_code',['eq'=>"color"])
            ->getFirstItem();

        $attribute_id = $attributeInfo->getAttributeId();

        $option=array();
        $option['attribute_id'] = $attribute_id;

        foreach($attribute_arr as $key=>$value){
            $option['value']['000a'.$value][0] = $value;

          //  $option['value'][$value][1] = $value;

        }

        $eavSetup = $this->_eavSetupFactory->create();
        $eavSetup->addAttributeOption($option);
        $eavSetup->save();
    }

}

Model/Getcsv:

namespace  Cpny\AttributeImporter\Model;

class Getcsv
{
    protected $_fileCsv;
    protected $_directory_list;

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Framework\File\Csv $csvProcessor,
        \Magento\Framework\App\Filesystem\DirectoryList $directory_list,
        array $data = []

    )
    {
        $this->_directory_list = $directory_list;
        $this->_fileCsv = $csvProcessor;
    }

    public function importFromCsvFile()
    {
        $directory = $this->_directory_list->getPath('var');
        $returnValues = [];
        $file = $directory . '/kolory.csv';

        if (file_exists($file)) {
            $data = $this->_fileCsv->getData($file);

            foreach($data as $label => $value) {
                $returnValues[] = $value[0];
            }
        }

        return $returnValues;
    }
}

~50 new values for Colors and ~500 new values for Size.

Should I import Text swatch in different way?

I had to use
$option['value']['000a'.$value][0] = $value;
because I want to create new ids for values.
I know it isn't perfect script and I will refactor and upgrade it later but right now I just need to fast import those values.


texts: Showing Error while using Migration tool 1.9 to 2.0

texts:
Currently i am using magento2.0.4 version . I want to migrate data from 1.9.0.1 version of magento . I have completed all steps for migartion tool .
After that i am geeting this error .

[2016-05-20 10:18:04][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
100% [============================] Remaining Time: 1 sec
[Migration\Exception] Integrity Check failed

Please help me to resolve this issue .


texts: Imported products in Magento 2.1.1 doesn't show in the front-end

texts:
I have imported more than 170000 configurable products, products are displayed properly in admin, but products are not displayed in front end. If I import only 30000 records at once, it will work fine.

I just tried php bin/magento indexer:reindex but not working. after reindexing catalogsearch_fulltext status shows Working is there any issue with this ?.

Thanks


texts: How to Disable TinyMCE in WYSIWYG Editor globally for Magento 2.1.x?

texts:
I'm struggling with adding html code to cms blocks and pages via the WYSIWYG editor in Magento 2.1.x(10).

In WYSIWYG editor of cms block I enter:

Click "SAVE", and what I get is:

I also tried with adding a href tag. Tried with all combinations of braces. It keeps stripping my html code on Save. I don't need that.

I read Alan Storm's article on this topic. Read a few questions with no definitive answers on how to fix this around here on the magento stackexchange.

Weighing on the benefits of having tinyMCE keep my html code in WYSIWYG editor in check vs being able to easily add links and images to html elements in my cms pages and blocks, I decide in favor of the latter.

I want to disable tinyMCE altogether. How can I do that?


texts:
Please help me i have a problem with the product sorting condition
i.e
Actual Requirement : need to show promotional products at first.and then order by quantity..

If product is promotional then i have to show the oldest promotion to date at first..

this promotion to date sort will apply when the product is promotion only..
like if(product is promotion) order by promotion_to_date asc

Please help me...
Thanks in advance..


texts: In Magento 1.9.1, is it possible to make out of stock swatch options for configurable products show, but not selectable?

texts:
I am using CE 1.9.1 with a custom theme based on rwd.  I have configurableswatches set for Color and Size attributes.  Everything is working fine, except when a configuration is out of stock, the swatch no longer displays.  This is confusing for my customers because the More Views image still shows for the unavailable option.  They also cannot request to be notified when the specific option is back in stock.

Example:
  A product has multiple colors: Blue, Green, & Red, and sizes: S, M, L
  Blue is still available in S & M
  Green is available in S
  Red is sold out in all sizes

What displays:

Blue Swatch with S  M

Green Swatch with S  M (as strikethru & OOS)

What I want to display:

Blue Swatch with S  M  L (as strikethru & OOS)

Green Swatch with S  M (as strikethru & OOS) L (as strikethru & OOS)

Red Swatch S (as strikethru & OOS) M (as strikethru & OOS) L (as strikethru & OOS)

Can anyone tell me how to accomplish this?  I do show out of stock products.  Can out of stock attributes also be shown?


texts: Error when trying to install extention locally by direct package file upload

texts: I have a working copy of magento locally. I'm trying to install extension directly to that system. But it gives "no file was uploaded" error. Has anyone encountered similar issue? I have not faced this problem when I install same file online.


texts: Magento2: Could not save product "53430" with position 0 to category 1593

texts:
Every time during try update category I get issue:
Could not save product "53430" with position 0 to category 1593

When edit product and try save I see:
The value specified in the URL Key field would generate a URL that already exists.
To resolve this conflict, you can either change the value of the URL Key field (located in the Search Engine Optimization section) to a unique value, or change the Request Path fields in all locations listed below:

What I do:
I deleted table with url_rewrite and regenerate again via extension by Oleg Koval:
bin/magento ok:urlrewrites:regenerate

Now I see extension add to url rewrites unique url path example url-1
Still I get the same issue.
Also I check this module:
app/code/<VENDOR>/<MODULE>/CatalogUrlRewrite/Model/ProductUrlPathGenerator.php:
namespace <VENDOR>\<MODULE>\CatalogUrlRewrite\Model;

class ProductUrlPathGenerator extends \Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator
{
    /**
     * Ignore attribute url_path. Always use url_key instead.
     *
     * @inheritdoc
     */
    public function getUrlPath($product, $category = null)
    {
        $path = $product->getUrlKey()
            ? $this->prepareProductUrlKey($product)
            : $this->prepareProductDefaultUrlKey($product);
        return $category === null
            ? $path
            : $this->categoryUrlPathGenerator->getUrlPath($category) . '/' . $path;
    }
}

Tie this in with app/code/<VENDOR>/<MODULE>/etc/di.xml:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\CatalogUrlRewrite\Model\ProductUrlPathGenerator"
                type="<VENDOR>\<MODULE>\CatalogUrlRewrite\Model\ProductUrlPathGenerator" />
</config>

Still no work. Any other solution?


texts:
The function formatCurrency in js.js is returning 0.0, i have followed the flow and it goes well until here

if (format.pattern.indexOf('{sign}') == -1) {
    pattern = s + format.pattern;
} else {
    pattern = format.pattern.replace('{sign}', s);
}

return pattern.replace('%s',r).replace(/^\s\s*/, '').replace(/\s\s*$/, '');

if i return price before this it returns the actual price but dont show the sign. i havend changed anything in the code. any idea where is the problem ?


texts: The path for Categories in the main menu and Footer Menu is different

texts:
This is the path for About us in main menu

http://name/index.php/about.html

For Same About Us in the footer menu is

http://name/index.php/about.html%EF%BF%BD%20title=

The link for the Categories in the footer menu leads to page not found error.

Pls help


texts: Magento 2: Updating product Price & Quantity Automatically

texts:
I tried to do Updating product Price & Quantity Automatically,
I have created this Module in my Local System.

connected to Oracle Database with OCI in php
Getting details from table and updating price & Quantity of product based on SKU.
Saving Order Details back into My Oracle Database.

Now, I'm not able to figure out how to can connect to Database from server.

I heard that it is possible by consuming Web services, Please let me know how I can be achieved.

Please let me know that is the best way to manage the Fluctuating Price & Quantity in e-commerce world when dealing with magento in perticular.

Let me know if you need any more details, Thanks in advance.


texts: How to put country flag image aside  language switcher without extension

texts:
I'am new to Magento and using 1.9.3.1.
Found solution about placing flag image as language switcher(onclick) in

app/design/frontend/package_folder/theme_folder/template/page/switch/languages.phtml

With this code:

<?php if(count($this->getStores())>1): ?>

    <?php foreach ($this->getStores() as $_lang): ?>
        <?php if ($_lang->getCode() != 'default'): ?>
        <a class="lang-flag" href="<?php echo $this->getCurrentUrl() . '?___store=' . $_lang->getCode();?>"><img src="<?php echo $this->getSkinUrl('images/flags/' . $_lang->getCode() . '.png');?>" alt="">
        <?php endif;?>
    <?php endforeach;?>

<?php endif;?>

As you can see, ther is no <select></select> tag.

Here is default template languages.phtml with <select></select>tag

<?php if(count($this->getStores())>1): ?>

    <select id="select-language" title="<?php echo $this->__('Language') ?>" onchange="window.location.href=this.value">
    <?php foreach ($this->getStores() as $_lang): ?>
        <?php $_selected = ($_lang->getId() == $this->getCurrentStoreId()) ? ' selected="selected"' : '' ?>
        <option value="<?php echo $_lang->getCurrentUrl() ?>"<?php echo $_selected ?>><?php echo $this->escapeHtml($_lang->getName()) ?></option>
    <?php endforeach; ?>
    </select>

<?php endif; ?>

I need to place code to render picture, and to be right betore <select></select> tag depends of store view (but not to be clickable to switch language as first block of code above), and when i chose language in <select></select> tag (to switch language), then flag of another country must be displayed depends of language.


texts: Magento2: Disable user from changing addresses

texts: Is there a way to disable customers from adding, editing, or deleting addresses on their account? I want to be able for users to add the address during registration and then after the account is created, changes can only be made from the backend or rest API. Customers can view the address book but not make any changes themselves. We are using Magento 2.2.0.


texts: How to diagnose magento 1.9.2.1 admin login issues?

texts:
A customer's 'internet service company blah blah blah' did 'something' we do not know on a previously working 1.9.2.1 installation.

Fontend works.

But when accessing /admin we got no error but a redirect to
/index.php/admin/index/index/key/<some_random__key>/

And, so, we cannot access no more to admin panel.

Also, I tried to navigate to

  http://www.customerdomain.ext/downloader

It works, and, here, the login works.

I tried to select one of the lib and choose 'reinstall', but I got an iframe with the downloader login form....

I've no previous experience with Magento.

Please note: Our customer is on a shared host. We can read apache error logs but there are NO error logged. And I cannot login with bash and upgrade it.

I'm asking some idea of possible source of this error.

  Yes, we know, this MUST BE UPDATED. But, first, we must make it works again.


texts:
I am trying to implement Magento 2 Odoo connector by using Zend XmlRpc Client.

$httpClient = new \Zend\Http\Client();
$oxClient = new \Zend\XmlRpc\Client('http://192.168.2.114:8069/',$httpClient);

But it throwing an error like Class 'Zend\XmlRpc\Client' not found

Does magento 2 supports Zend XmlRpc Client?


texts: Magento-2 override template for Group product in my module

texts:
I am using magento-2.0.0 . I am trying to overtire

vendor/magento/module-grouped-product/view/frontend/templates/product/view/type/default.phtml with my module template.

My module layout code of

frontend/layout/catalog_product_view_type_grouped.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="product.info.grouped">
            <action method='setTemplate'>
                <argument name="template" xsi:type="string">Namespace_Modulename::availability.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

Default file code /vendor/magento/module-grouped-product/view/frontend/layout/catalog_product_view_type_grouped.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <attribute name="class" value="page-product-grouped"/>
        <referenceContainer name="product.info.form.content">
            <block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/>
            <container name="product.info.grouped.extra" after="product.info.grouped" before="product.info.grouped" as="product_type_data_extra" label="Product Extra Info"/>
        </referenceContainer>
        <referenceContainer name="product.info.grouped.extra">
            <block class="Magento\GroupedProduct\Block\Stockqty\Type\Grouped" template="Magento_CatalogInventory::stockqty/composite.phtml"/>
        </referenceContainer>

        <referenceContainer name="product.info.type">

          <!-- below block i am trying to overrite-->

            <block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" as="product.info.grouped" template="product/view/type/default.phtml"/>

        </referenceContainer>
    </body>
</page>

My problem is there is no name attribute alias is as="product.info.grouped" . Alias is already used  in above code.

<block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/>

So My template render at product/view/type/grouped.phtml instead of product/view/type/default.phtml

I can able to give different name attribute and use it in my module.But I am developing extension .
Is it magento bug?
Any help would be much appreciated


texts: Bulk price and quantity update using rest api

texts:
How to update price and quantity in bulk using rest api, provide us the process to update in bulk using rest api.

Single price and quantity is updated using rest api, but i need to update in bulk using rest api.


texts: I want to make my own cart design.. So can anyone please help to get all items added to the cart.


texts: How can i enable Credit payment option in magento 1.9

texts: How can i manage returned-amount to customer's store credit so they can purchase another product by using that amount?


texts: Adding Extra Parameters to Select Element HTML

texts:
I am creating a custom module and using Magneto's core framework to render a select box using code as below:
$this->getLayout()->createBlock(
            'Magento\Framework\View\Element\Html\Select'
        )->setName(
            'mycustomname'
        )->setId(
            'mycustomid'
        )->setTitle(
            'my custom title'
        )->setValue(
            $selectedValue
        )->setOptions(
            $myoptionsarray
        )->getHtml();

I get the select box fine but I want to pass extra parameters to select box and I tried following options just before getHtml() but none of them worked for me:
->setExtraParams('disabled = disabled')

->setExtraParams('disabled = true')

can anyone help me regarding this if I want to pass extra parameters to the element
---------- UPDATE --------
if I check core file at:  Magento\Framework\View\Element\Html\Select
 protected function _toHtml()
    {
        if (!$this->_beforeToHtml()) {
            return '';
        }

        $html = '<select name="' .
            $this->getName() .
            '" id="' .
            $this->getId() .
            '" class="' .
            $this->getClass() .
            '" title="' .
            $this->escapeHtml($this->getTitle()) .
            '" ' .
            $this->getExtraParams() .
            '>';

I can see this, which says to getExtraParams() at the end but dont see that working
This one finally worked for me after I ran setup:upgrade
->setExtraParams('disabled=true')


texts: layout sales_order_create_index.xml explain code please

texts:
vendor/magento/module-sales/view/adminhtml/layout/sales_order_create_index.xml

There are two blocks name="coupons" and name="order_create_coupons_form" with classes
Magento\Sales\Block\Adminhtml\Order\Create\Coupons and Magento\Sales\Block\Adminhtml\Order\Create\Coupons\Form. So why in layout this block name="order_create_coupons_form" child of name="coupons" and in this block code like this
public function getCouponCode()
{
    return $this->getParentBlock()->getQuote()->getCouponCode();
}

What reason do like this? Why it doesn't have only one child block with code of parent? Thanks if anybody explain it


texts:
I have magento 2 setup to generate backup on daily basis, code and db only and we keep the backup for 7 days. I have noticed that backup size has been increasing and right now about ~25G/ day backup.

any ideas what I may be doing wrong?

here is what it did last night:

-rw-rw-r--  1 www-data www-data 26G Aug 19 13:43 1534702909_nomedia.tgz
-rw-rw-r--  1 www-data www-data 24G Aug 19 13:43 1534702979_nomedia.tgz
-rw-rw-r--  1 www-data www-data 36G Aug 19 13:10 ~tmp-1534703275.7177.tar
-rw-rw-r--  1 www-data www-data 36G Aug 19 13:10 ~tmp-1534703420.3653.tar

four files were created last night check the size of files.... any suggestions please?

Sajid.


texts:
I have beginner's problem with my magento 2 files. I cannot set my homepage correctly. When I've pasted my HTML code into Content->Pages it results showing my HTML Code not content what it contains. How to set homepage correctly with having code already? Please give me a solutions because I do it for the first time.

Regards


texts: Overwrite admin controller in version 1.6

texts:
I am trying to overwrite the controller located at: app/core/code/Mage/Adminhtml/controllers/Catalog/ProductController.php

First of all I tried just making a copy in my local code directory app/local/code/Mage/Adminhtml/controllers/Catalog/ProductController.php keeping the file exactly the same and just making it die() so I knew if it was getting executed. But this didn't work and I read somewhere that you can't simply just drop an admin controller into the local directory.

Considering this, my next option is to write a module and use the config.xml to "rewrite" the controller. Thankfully I am able to add the functionality I require to a module that I have already been working on so I don't need to create a module simply for this task. So in my config.xml I added:

<config>

    ....

    <admin>
        <routers>
            <adminhtml>
                <args>
                    <modules>
                        <Mycompany_Prime before="Mage_Adminhtml">Mycompany_Prime_Adminhtml</Mycompany_Prime>
                    </modules>
                </args>
            </adminhtml>
        </routers>
    </admin>

    .....

<admin/> is a direct child of <config/>.

Then I created my new controller under app/code/local/Mycompany/Prime/controllers/Adminhtml/ProductController.php with:

require_once "Mage/Adminhtml/controllers/Catalog/ProductController.php";

class Mycompany_Prime_Adminhtml_ProductController extends Mage_Adminhtml_Catalog_ProductController {

....

However the class never gets executed. For that matter, neither does the script:

die('Here');
require_once "Mage/Adminhtml/controllers/Catalog/ProductController.php";

class Mycompany_Prime_Adminhtml_ProductController extends Mage_Adminhtml_Catalog_ProductController {

Any help on overwriting this admin controller would be appreciated. I am using Magento version 1.6


texts: Decoding Failed syntax error in Simple Products Generator extension

texts:
I have used Simple Products Generator extension

https://www.magentocommerce.com/magento-connect/simple-products-generator.html

getting below screenshot error click on Generate Combination simple product


texts: Owl carousel integration with swatches at product detail page in magento 2

texts: At product detail page, in case of image swatches for configurable product. I need to integrate slider in the image swatch option. But no slider library(slik and owlcarousel) is working there. Any help would be appretiated.


texts: Magento Inserting your block into any place - duplicate issue

texts:
I am trying to insert a phtml file using observer through this code

public function insertShippingBlock($observer)
{
    /** @var $_block Mage_Core_Block_Abstract */
    /*Get block instance*/
    $_block              = $observer->getBlock();
    /*get Block type*/
    $_type               = $_block->getType();

    if ($_type == 'checkout/onepage_shipping') {

        $_block->unsetChild('child_branchoptions');
        /*Clone block instance*/
        $_child = clone $_block;
        /*set another type for block*/
        $_child->setType('core/template');

        $_block->setChild('child_options', $_child);
        /*set child for block*/
        $_block->setTemplate('shipping_method/customoptions.phtml');
    }
}

But It's repeating the custom options

"Custom option 1" is repeating twice. Could you please help in this

customoptions.phtml

<input name="selected" type="radio" name="chooseoption" id="chooseoption" onclick="chooseoption()">Custom Option 1
<?php echo $this->getChildHtml('child_options') ?>


texts:
I tried to do a backup system using tools from the mangento cpanel online ( I don't have any local version on my computer).

the website is unreachable as well as the cpanel I have

  "Error 503: Service Temporarily Unavailable"

I have no clue how to delete the file to recover the controlpanel on the website

Thanks in advance for your help.


texts: Magento 2.1 - custom administrator user attributes

texts:
I googled a lot, but it's just not there !!

i need to add "mobile" and "photo" fields to the administrator users in magento 2.1.

how to do that?


texts: Display Product attribute in product list in magento 2

texts:
I want to show manufacturer in product list.

List of product need to be grouped on the basis of Manufacturer

Screen shot attached

Here Pure Aero Bags and Pure Drive are Manufacturer


texts: magento2 remove lastname from checkoutpage

texts: How to remove last name from checkout page in Magento2 ?


texts:
I am almost there, the theme I have does not use view.html but its a folder called view with parts of the product page. I am trying to make the the custom attributes content show but it refuses to show I tried every method out there can't find a solution.

Here is the code:

 <?php

 $this->_product = Mage::registry('product');
 $tabName = 'custom_product_tab_'.$this->_product['entity_id'];
 $staticBlock = $this->getLayout()->createBlock('cms/block')->setBlockId($tabName);

 $tab2Name = 'custom_product_tab2_'.$this->_product['entity_id'];
 $staticBlock2 = $this->getLayout()->createBlock('cms/block')->setBlockId($tab2Name);
 $_helper = $this->helper('catalog/output');
 $_product = $this->getProduct();
 $aso = Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'as_seen_on', $storeId);
 $video = Mage::getResourceModel('catalog/product')->getAttributeRawValue($productId, 'video', $storeId); ?>

 <?php foreach ($this->getTabs() as $_index => $_tab): ?>
 <?php if($this->getChildHtml($_tab['alias'])): ?>
 <li id="product_tabs_<?php echo $_tab['alias'] ?>" class="<?php echo !$_index?' active first':(($_index==count($this->getTabs())-1)?' last':'')?>"><?php echo $_tab['title']?>

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

As Seen On

Video

 <?php foreach ($this->getTabs() as $_index => $_tab): ?>
      <?php if($this->getChildHtml($_tab['alias'])): ?>
      <div class="meigee-tabs-content" id="product_tabs_<?php echo $_tab['alias'] ?>_contents">
      <?php echo $this->getChildHtml($_tab['alias']) ?>

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

<?php echo $aso; ?>

<?php echo video; ?>

Here is the javascript included in the file:


texts:
When I started to learn abot XML Layout in magento, I come to know two terms namely Layout and Layout Update.

Definition for these two terms in an article was

The term layout refers to the visual and structural composition of the page. However, the term layout update refers to a specific set of XML instructions that determines how the page is constructed.

But I'm not able to understand it with xml files of magento.

Can anyone explain these two terms with an example xml file of magento?


texts:
I am trying to override a Mage controller which is in Mage/Catalog/controllers/CategoryController.php.

The folder structure which I created in trying to override the above controller is as follows:

--> app
   --> code
      --> core
         --> local
            --> Edge
               --> AjaxCatalog
                   --> controllers
                       --> CategoryController.php
                    --> etc
                       --> config.xml
  --> etc
      --> modules
          --> EdgeAjaxCatalog.xml

Edge/AjaxCatalog/controllers/CategoryController.php:

<?php
require_once Mage::getModuleDir('controllers', 'Mage_Catalog').DS.'CategoryController.php';
class Edge_AjaxCatalog_CategoryController extends Mage_Catalog_CategoryController
{
   public function viewAction()
   {
       echo "alert('hi')"; //even tried Mage::log("controller..");
   }
}

Edge/AjaxCatalog/etc/config.xml

<config>
    <frontend>
        <routers>
            <catalog>
                <args>
                    <modules>
                         <edge_ajaxcatalog before="Mage_Catalog_CategoryController">Edge_AjaxCatalog</edge_ajaxcatalog>
                    </modules>
                </args>
            </catalog>
        </routers>
    </frontend>
</config>

Edge_AjaxCatalog.xml

<?xml version="1.0"?>
<!--we need to enable this module as any other if-->
<!--you wish to do it as standalone module extension-->
<config>
    <modules>
        <edge_ajaxcatalog>
            <active>true</active>
            <codePool>local</codePool>
        </edge_ajaxcatalog>
    </modules>
</config>

Still I can't see the log message in system.log file. (log is enabled)

what should I do more to override this controller?

Please help


texts: Error in graphql schema running in magento 2 : Cannot query field \"wordoftheday\" on type \"Wordoftheday\"."?

texts:
I created a custom module with a custom table in magento 2.3.2 including grpahql schema.

I want to get the data using graphql by passing an argument.

I am getting the following error in Alatair GrapgQL client chrome extension.

  {
    "errors": [
      {
        "message": "Cannot query field \"wordoftheday\" on type \"Wordoftheday\".",
        "category": "graphql",
        "locations": [
          {
            "line": 3,
            "column": 5
          }
        ]
      }
    ]
  }

I passed the query like below.

{
wordoftheday ( id : 1) {
Wordoftheday{
  word
  verb
  meaning
  detail
}
}
}

  /app/code/Ayakil/Wordoftheday/etc/schema.graphqls

type Query {
wordoftheday (
    id: Int @doc(description: "Current Day to show WOD in Home page")
): Wordoftheday @resolver(class: "Ayakil\\Wordoftheday\\Model\\Resolver\\Wordoftheday") @doc(description: "The Sales Order query returns information about customer all placed order")
}
type Wordoftheday @doc(description: "wod information") {
word : String  @doc(description: "word")
verb : String  @doc(description: "verb")
meaning : String  @doc(description: "meaning")
detail : String  @doc(description: "detail")
}

  /app/code/Ayakil/Wordoftheday/Model/Resolver/DataProvider/Wordoftheday.php

<?php
namespace Ayakil\Wordoftheday\Model\Resolver\DataProvider;
class Wordoftheday
{
protected $_wordofthedayFactory;

public function __construct(
    \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder,
    \Ayakil\Wordoftheday\Model\WordofthedayFactory $wordofthedayFactory
)
{
    $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    $this->_wordofthedayFactory  = $wordofthedayFactory;
}

public function getWordoftheday( int $date_to_show)
{
    try {
        /* filter for all customer orders */
        //$searchCriteria = $this->searchCriteriaBuilder->addFilter('id', $date_to_show,'eq')->create();
        $wod = $this->_wordofthedayFactory->create();
        $collection = $wod->getCollection();
        $collection->addFieldToFilter('id',$date_to_show);

    } catch (NoSuchEntityException $e) {
        throw new GraphQlNoSuchEntityException(__($e->getMessage()), $e);
    }
    return $collection;
}
}

What is my mistake here?please help me to short it out.


texts: What is the difference b/w cacheable="false" and Sections in Magento 2

texts:
I have developed an extension in magento 2.2.6. Now i am upgrade this in magento 2.3.1 but I am facing 1 issue.

In my phtml file $block->method() is called 1 time after cache:clean.

When I refresh the page second time then   $block->method()  execution does not reach in method body. I have done testing by writing die(); in method body and also return preview loaded data.

And now I am write cacheable="false" for block in layout file, then it works like 2.2.6. i.e on every refresh $block->method() read execution in method body.

I don't understand why need cache:clean on every refresh if don't use cacheable="false" .

And what is the best practice for this? May I use cacheable="false" or section.xml?


texts: Adding custom configuration section to existing tab

texts:
Synopsis

I have created a basic local module that is designed to listen to an observer , which it does perfectly fine.  However I wish the observer method to pull out some configured settings which changes the behaviour of it's task.

I want to add a new section under the Catalog tab; I found this question.

I do not want to create a new tab, instead I do want a new section under the existing Catalog tab (similarly to Catalog > Inventory).

Current behaviour

Currently inside the control panel I click Catalog > Catalog, low and behold inside this tab is a group called Section Name Under Catalog Tab. I also don't see my group Group Name.

Image example #1
Image example #2

Expected behaviour

I click Catalog > Section Name Under Catalog Tab, inside this tab is a group called Group Name with my enable/disable field.

As per Image example 1 - I'd expect a section called Section Name Under Catalog Tab;
As per Image example 2 - I'd expect this to expand into a view with my group Group Name;
Finally the group should contain the form present in Image exmaple 2.

Code snippets

local/Vendor/Module/etc/adminhtml.xml

<?xml version="1.0" ?>
<config>
    <acl>
        <resources>
            <admin>
                <children>
                    <system>
                        <children>
                            <config>
                                <children>
                                    <mymodule translate="title" module="mymodule">
                                        <title>Section inside Catalog</title>
                                    </mymodule>
                                </children>
                            </config>
                        </children>
                    </system>
                </children>
            </admin>
        </resources>
    </acl>
</config>

local/Vendor/Module/etc/system.xml

<?xml version="1.0" ?>
<config>
    <sections>
        <mymodule translate="label" module="mymodule">
            Section Name Under Catalog Tab
            <tab>catalog</tab>
            <frontend_type>text</frontend_type>
            <sort_order>0</sort_order>
            <show_in_default>0</show_in_default>
            <show_in_website>1</show_in_website>
            <show_in_store>1</show_in_store>
            <groups>
                <category_options translate="label">
                    Group Name
                    <frontend_type>text</frontend_type>
                    <sort_order>1</sort_order>
                    <show_in_default>1</show_in_default>
                    <show_in_website>1</show_in_website>
                    <show_in_store>1</show_in_store>
                    <fields>
                        <active translate="label">
                            Enabled
                            <frontend_type>select</frontend_type>
                            <source_model>adminhtml/system_config_source_enabledisable</source_model>
                            <sort_order>1</sort_order>
                            <show_in_default>1</show_in_default>
                            <show_in_website>1</show_in_website>
                            <show_in_store>1</show_in_store>
                        </active>
                    </fields>
                </category_options>
            </groups>
        </mymodule>
    </sections>
</config>


texts: Magento 2. customer_entity , customer_address_entity purpose of prefix, suffix columns?

texts: What is the purpose of the prefix and suffix columns on the customer_entity and customer_address_entity tables?


texts: Magento EE refund reward points based on order ID

texts:
I am looking for code/tutorial on how to pragmatically take an order id and get the # of points used on the order and then refund that back to the user. I thought if I would just pragmatically change the status of an order Magento would give any reward points used on the order back to the customer but that is not the case.

Any suggestions on where I could find code to do this?


texts:
Can anyone help me to add radio.js file for adding radio button validation for custom options in magento2 ?

Please find the below screen shot:


texts: Need to save data while custom module installation

texts:
I need to save some data while custom module installation. I save some static data using setup/InstallData.php. I need to process the existing order data and save it into my custom table. Is there any other way to save instead of  setup/InstallData.php. Is this good to call controller function inside the setup/InstallData.php.

I am using Magento 2.2.6


texts: Is it safe o update row from translation table in magento 2

texts:
To update inline translation value without enabling inline translation because its prod environment so Is it safe to update row from "translation" table using update query
|key_id | string      | store_id | translate      | locale | crc_string |
|  14 | Item in Cart |      1 | Produkt i jjsanhj | nb_NO  | 2629046627 |
So i am planing to update the above record using "update translation set translate='abc' where key_id=14";
Kindly advise
Thanks in advance


texts: How to get the Id from Database while Edit functionality in magento 2 grid

texts:
I have created custom admin grid(without ui component). While edit action it needs to get id from DB to display the existing data in form.
Grid.php

$this->addColumn(
                'edit', [
            'header' => __('Edit'),
            'type' => 'action',

            'actions' => [
                [
                    'caption' => __('Edit'),

                    'url' => $this->_url->getUrl('*/*/*', ['id' => '1', 'active_tab' => 'upload']),
                ],
//
            ],
            'filter' => false,
            'sortable' => false,
            'header_css_class' => 'col-action',
            'column_css_class' => 'col-action'
                ]
        );

In above code, I have given id statically as 1 and it loads the data and displayed in the form, but now I need to get Id from DB dynamically, Please provide me a solution


texts: API Rewrites are not working. Must use api.php?type=rest/products rather than api/rest/products

texts:
I'm having trouble getting Magento to use the rewritten API URL. My Apache configuration for the site is:

<Directory /var/www/html/site.com/public_html>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

My .htaccess for the site is:

SetEnv MAGE_IS_DEVELOPER_MODE "true"
RewriteCond %{HTTP_HOST} !^(www|stage|dev)\. [OR,NC]
RewriteCond %{HTTPS} off
RewriteRule ^ https://dev.site.com%{REQUEST_URI} [NE,R=301,L]
############################################
## default index file
    DirectoryIndex index.php
<IfModule mod_php5.c>
    php_value max_execution_time 18000
    php_flag magic_quotes_gpc off
    php_flag session.auto_start off
    #php_flag zlib.output_compression on
    php_flag suhosin.session.cryptua off
    php_flag zend.ze1_compatibility_mode Off
</IfModule>
<IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
</IfModule>
 <IfModule mod_headers.c>
     <FilesMatch "\.(ico|gif|jpg|jpeg|png|flv|pdf)$">
          Header set Cache-Control "max-age=29030400"
     </FilesMatch>
     <FilesMatch "\.(js|css|swf|woff)$">
         Header set Cache-Control "max-age=604800"
     </FilesMatch>
     <FilesMatch "\.(html|htm|txt)$">
        Header set Cache-Control "max-age=86400"
     </FilesMatch>
</IfModule>
<ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl|asp|html)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
<IfModule mod_ssl.c>
    SSLOptions StdEnvVars
</IfModule>
<IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
</IfModule>
    AddDefaultCharset Off
<IfModule mod_expires.c>
    ExpiresDefault "access plus 1 year"
</IfModule>
    Order allow,deny
    Allow from all


texts: Add custom font-family to magento email template

texts: I have used the lato family lato font in frontend. I need to add this font-family in email template also.


texts: Is the salesrule_coupon "expiration_date" field used for anything?

texts:
When you create a coupon code in Magento 1 or Magento 2 (a "Shopping Cart Price Rule"), you can set date range where the coupon is valid from/to.  This information is stored in the salesrule table, and Magento appears to respect it. (i.e. if the end date has passed, Magento won't let you apply the coupon code)

However, Magento stores the actual codes for an individual sales rule in the salesrule_coupon table.  This table includes a field named expiration_date which seems like it would be a way to set expiration dates on specific coupon codes with a sales rule.  However, Magento does not (seem to?) respect this field.

Does anyone know what this field is for?  Does it work and I'm just doing it wrong?  Is it tracking something else? etc.