texts:
I have been a PHP developer for 13+ years, have extensive knowledge of PHP itself as long as some other popular projects like WordPress.  I have no experience with Magento.

I now have a full time job working for a company that uses Magento, all my development work will be on Magento pretty much now.

My initial thoughts after looking at Magento for the first time are, wow what have I got myself into now?  But then the experienced developer in me comes out and remembers, it's just PHP.

So I have some basic Magento questions I would really appreciate some answers to from more experienced Magento Developers...

What is the best most useful places to learn about magento development beside this site?
Extensions/plugins are very confusing so far to me.  Other platforms like WordPress allow you to place a plugin into it's own folder and all it's files will live under that folder.  From what I have seen so far, a plugin might be scattered accross several folders in Magento, is this correct?
I have learned about how to over-ride Core functionality.
So if a file in the core is located here /app/code/core/Mage/SitemapModel/Resource/Catalog then I can over-ride it by creating the file in this location /app/code/local/Mage/SitemapModel/Resource/Catalog so how does this work with an Extension/plugin?  If I create a plugin that need to over-ride core functionality, then I must have my files all over the place for that extension to work?
Any other info you wish you knew starting out with magento?

Thanks for any insight, I know this is a multi part question but I feel any of the answers would be helpful to myself and other starting out, I will make this public wiki if I must as well.


texts: Magento 1.9: Favicon switches to a magento symbol in internet explorer

texts:
When I

Open internet explorer/Edge
Go to a product page
Click on one of the product tabs
The favicon switches to a Magento symbol

Why is this happening?


texts: Using wysiwyg editor on frontend templates in magento 2

texts:
I found so many articles about how to use wysiwyg editor in admin pages, and I was wondering if I could use it in the frontend templates.
if yes, please tell me how.
I'm using magento 2.1.5.


texts: Refresh cached product images programmatically

texts:
After flushing image cache, cached product images are rebuild when they are loaded from frontend like from product view page ...

I need them restored w/o vistit every page manuall, so how to this in an efficent way?

I needed a fast solution and just came up with, to "simulate" page view ...

<?php
require_once('./app/Mage.php');
umask(0);
Mage::app();

$collection = Mage::getModel('catalog/product')->getCollection()
    ->addAttributeToFilter('visibility', array(3,4))
    ->addAttributeToFilter('status', 1);
$ids = $collection->getAllIds();

$func = function($id) {
    return 'http://domain.com/catalog/product/view/id/' . $id;
};

$urls = array_map($func, $ids);
foreach ($urls as $url) {
    file_get_contents($url);
}

I know i could make it store view based to reduce URL count ... but is there a method to generate cached images without using file_get_contents?


texts: How to calculate shipping cost based on Zip Codes

texts:
the scenario is this:
The site offers two types of shipping, one standard and one fast and the customer can choose what he wants.

The request is to apply a surcharge fixed for certain zip codes to both expeditions.


texts: Recommended method to protect /downloader?

texts:
Since Magento uses the /downloader as a way to conveniently install programs via Magento Connect Manager it is apparent that this is also a security concern since it allows the possibility for bots or people to attempt to learn credentials for the installation.

Checking access logs to my website, I was alarmed at the amount of attempts to the www.mysite.com/downloader

As a work around I've gotten into the habit of renaming the downloader directory to downloader.offline but occasionally I forget. (Either to rename it back to install a program or after I'm done).

What is the recommended method to protect this link?


texts:
Background:

I am planning to use Magento2 web-service using SOAP. This will be for Mobile App where customer are allowed to add to cart then checkout.
The store will be a multi-store website where the customer can easily change the store of their choice.

Question:

To initialize quote / empty cart, we can use web-service:
http://magento210.dev/soap/?services=quoteGuestCartRepositoryV1
but this doesn't have storeId as an input request (unlike Magento1)

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:def="http://magento210.dev/soap/default?services=quoteGuestCartManagementV1">
   <soap:Header/>
   <soap:Body>
      <def:quoteGuestCartManagementV1CreateEmptyCartRequest/>
   </soap:Body>
</soap:Envelope>

Since website will be multi-store one, store_id of quote needs to be updated as they switch the store. The following questions remain unanswered for me:

How will we update the store_id of a quote?
OR How can we add to cart as per store?


texts: The search of product name, SKU does not get the exact result in Magento 2

texts: I am using Magento 2.3.4. I want to get the exact search result using SKU or product name but currently get the related results. Please help and Thanks in advance.


texts:
I have some attributes (size, color, type ect).

I want to order them in layered navigation in category page.


texts: How to get tax rate for particular country in magento?

texts: In my code i get the current country of the user from that current country I want to get tax rate. So that I can apply that tax rate accordingly to current company. Can anyone help please?


texts: Php missing extension for php_intl via composer install

texts:
The OS version is CentOS 6.6. I have installed PHP 7.1.4 and all PHP extensions are installed except for intl.

I did the following commands:

yum list php*intl

And installed the one that was compatible with my PHP version

yum install php71-php-intl.x86_64

Despite that, intl doesn't appear when I do 'php -m' and I still get the error in composer :

magento/product-community-edition 2.2.2 requires ext-intl * ->

Is there a way to install the intl? I have restarted the apache server several times but no luck. What do you think i'm missing?


texts: Prevent magento 2 from empty the cart after cancel/fail payments

texts:
How to prevent Magento 2.1 from emptying cart after canceled or failed payments?

When I cancel a payment the cart is empty, and I need to prevent this behaviour.

There are a lot of solutions for 1.9, but I've found nothing for magento2, I've seen even answers about solutions in magento 1.9 for questions about magento2, but not a solution for magento2.

Is there any solution for magento 2.1?


texts: Unable to save a custom product attribute created manually

texts:
I've created a custom product attribute: my_custom_attribute from the backoffice and assigned it to the right attribute set.
Now I am trying to set some values for my attribute programatically. This is my code:
//Magento\Catalog\Api\ProductRepositoryInterface
$myProduct = $this->product->getById(123);
$myProduct->setData('my_custom_attribute', 'test');
$this->product->save($myProduct);

When I run that code, it is executed with success, no errors, no exceptions. But my product attribute is empty. IF I add some random string manually and save it from the backoffice and rerun my script, I got the right value: test.
Did someone face this issue ? I know it is weird.. Please share your thoughts! Thank you


texts:
I need to get all module's helpers, can you explain me, how can i do it?

PS: I see only one way - scandir() Helper directory and no more ideas.


texts:
How to fix the migration error How to fix the migration error [Exception]
Warning: PDOStatement::execute(): MySQL server has gone away in

C:\xampp7.0\htdocs\magento220\vendor\magento\data-migration-tool\src\Migration\ResourceModel\Adapter\Mysql.php on line 169.

I don't know how to find out this error? Could you please help me?


texts: Magento:2.2.8 Save response in db under custom_column created in sales_order and quote tables

texts:
I am using Custom Shipping API where I am getting response from API. Here I want to save this response to my order and quote table, I used event checkout_onepage_controller_success_action
Here's code of my event under etc/frontend

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
       <event name="checkout_onepage_controller_success_action">
        <observer name="bigpost_order_controller_success_action" instance="Some\Somename\Observer\Processorder" />
    </event>
    </config>

Here's I am using in doing in execute function under Observer/Processorder

          $order_ids = $observer->getEvent()->getOrderIds()[0];
           $order = $this->orderRepository->get($order_ids);
           $order_id = $order->getIncrementId();
$job = json_decode($resut, true); //response here
  foreach ($job as $key => $consignment) {
      $condignment = $consignment['CarrierConsignmentNumber']; //got reponse 'BP459090'
      try {
        $orderDetailData = $condignment;
        if(!empty($orderDetailData)){
        $order_id->setData('carrier_consignment_number', $orderDetailData); //tried to set data
        $order_id->save();
      }
        print("succssfully done");

    } catch (\Exception $e) {
        error_log($e->getMessage());
        print("error in this");
    }
            }

it's not saved my data in db under sale_order table or quote table. while I created column there.

Getting error here : Fatal error: Uncaught Error: Call to a member function setData() on string in


texts: Moving "Add to cart" block before configurable product options on product page

texts:
I'm trying to move product.info.options.wrapper.bottom block before product.info.options.wrapper.

I tried using "before" and "after" attributes in catalog.xml, but they don't work.

I tried unsetting and adding these blocks in local.xml, still no luck.

These blocks are rendered by this line in product's view.phtml file:

echo $this->getChildChildHtml('container1', '', true, true)

(sorted = true)

How can I move these blocks?


texts: How can I move an element and wrap it in a tag?

texts:
I am trying to move the minicart into the top links area, but I need to wrap it inside an element. I realize I can't use an li, but can I use a div? How can I do this?

Creating an empty container and trying to move it into it does not work.
Trying to reference the minicart inside the container does not work.

<referenceContainer name="top.links">
    <container name="top.links.cart" as="topLinksCart" htmlTag="div" after="-"/>
</referenceContainer>
<move element="minicart" destination="top.links.cart" after="-"/>


texts: How to make state/company field in new customer creation required from admin panel?

texts:
How to make the company field and state field in the address form (in admin panel, Customer->Manage Customer->new Customers) mandatory when a user is created. I tried to find a phtml corresponding to the form, but dint find any.
Also how to make just the js validation for the company and state field?


texts: Question regarding two contact forms in my store

texts:
I have a module for a custom contact form which is working great.

Now I want a seperate contact form for customers to place returns. I figured to use the default contact form magento provides. I've edited the associated template file and email template within admin, but I can't figure out to how assign an email that it will be sent to.

Within admin -> general -> contacts I only see the ability to select an email for one form (which is now the custom contact form):

http://linenwoods.com/testing/Capture.PNG

How can I select an email for the default form as well? Or is this not possible.


texts: Slick slider: Image size issue on page load

texts:
I added CSS so first slide show up with other elements, but I think the image shows up with the original size and then working perfectly when page load up completely.

My css:

.home-slider-wrapper .item  {
    display: none;
}

.home-slider-wrapper .item:first-child  {
    display: block;
}

.home-slider-wrapper .slick-initialized .item {
    display: block;
}

My slider:

<?php foreach ($bannerCollection as $banner): ?>

        <a href="<?php echo ($banner->getBannerLink()) ? $banner->getBannerLink() : "#"; ?>">
            <img class="desktop-image" src="<?php echo $baseUrl.$banner->getDesktopImg(); ?>" alt="<?php echo $banner->getBannerTitle(); ?>">
            <img class="mobile-image" src="<?php echo $baseUrl.$banner->getMobileImg(); ?>" alt="<?php echo $banner->getBannerTitle(); ?>">

<?php endforeach; ?>

and JS:

require([
    'jquery',
    'slickSlider'
], function ($) {
    $("#header_slider").slick({
        dots: true,
        autoplay: true,
        infinite: true,
        slidesToShow: 1,
        slideswToScroll: 1,
        arrows: true
    });
});

I am adding screenshot for more understanding,
during page load:

after loading:


texts: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'cataloginventory.qty' - Magento 2

texts:
I didn't change anything in the database at all and the system logged me out and when I logged back in, I get this error message:

I have tried the following with no success:

Cleaning the cache
Flushing the cache
Reindexed everything
Changed the indexer status to realtime and back to schedule
Ran the setup:upgrade and static-content deploy command

*UPDATE Here is the table for cataloginventory_stock_item


texts: Want to remove categories from top nav and only show page links

texts:
I have a lot of categories and I dont want them showing on the top nav, I only want them to show in my side nav. I am wanting to have just page links on the top nav.

I do not know how to get this working, I have looked and looked and I cannot find a solution.

My top nav looks like this


texts: Magento 2: Can anyone explain when the js-translation.json comes into picture

texts:
I want to change all the text on the checkout page. I have refer many documents.

But I want to understand flow that it will work.

Has anyone idea about it?

I want to do customization on checkout page.


texts:
I have a code for getting abandoned cart details:

$quotes = Mage::getResourceModel('reports/quote_collection');
    foreach ($quotes as $quote) {
        $itemsCollection = $quote->getItemsCollection();
        foreach ($itemsCollection as $item) {
            //Getting item info
        }
    }

But how can I get item options(Color:Green, Size:L, etc..) ?


texts: Magento 2 ui form multiselect field not checked not in $_POST

texts:
I have multiselectin my form displaying all store view available one is selected when I save only one show in the post array:

<field name="store">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Store\Model\ResourceModel\Store\Collection</item>
        <item name="config" xsi:type="array">
            <item name="label" xsi:type="string" translate="true">Store</item>
            <item name="visible" xsi:type="boolean">true</item>
            <item name="dataType" xsi:type="string">number</item>
            <item name="formElement" xsi:type="string">multiselect</item>
            <item name="source" xsi:type="string">store</item>
            <item name="multiple" xsi:type="boolean">true</item>
            <item name="dataScope" xsi:type="string">store</item>
            <item name="valueMap" xsi:type="array">
                <item name="true" xsi:type="number">1</item>
                <item name="false" xsi:type="number">0</item>
            </item>
            <item name="default" xsi:type="number">0</item>
        </item>
    </argument>
</field>

Is there anyway I can make all available options to go with post with the value of 0 ?


texts: Magento 2 - Can I use magento v2.3 on a production environment?

texts: I want to develop a new website on magento 2. Should I use the latest officially released version of magento 2 which is v2.2.6 (nowadays) or is it better to use v2.3?


texts:
I followed the devdocs below link to create theme:

  http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/themes/theme-create.html

But after I added the registration.php, the Magento admin returns error.

Here is my registration.php, file structure and Composer.json

Would you let me know what my error is ?


texts: How do I get the MySQL affected rows using the Magento resource?

texts:
$conn  = Mage::getSingleton('core/resource')->getConnection('core_write');
$sql = "UPDATE ...";
$result = $conn->query($sql);

How do I get the number of affected rows - i.e. mysql_affected_rows();


texts: Magento 2 Change the content of the luma theme's topmost div

texts:
I need to change the content of the topmost div of the luma theme.

See image below:

How can I change this?


texts: Magento Custom Dropdown Column in Manage Product Grid Disappears the Colums when i apply filter

texts:
I wanted to add custom column called brands(dropdown) in magento product grid in backend.I achieved this task but the issue is when i start filter the brands the column brands disappers and when i refresh the page then comes back.can any one please help me.
Here is my code.

in _prepareCollection() function i added

$collection = Mage::getModel('catalog/product')->getCollection()
            ->addAttributeToSelect('sku')
            ->addAttributeToSelect('name')
            ->addAttributeToSelect('attribute_set_id')
            ->addAttributeToSelect('type_id')
        ->addAttributeToSelect('brands'); // added by me

in _prepareColumns()

$brands = Mage::getModel('eav/entity_attribute_option')->getCollection()->setStoreFilter()->join('attribute','attribute.attribute_id=main_table.attribute_id','attribute_code');
        foreach($brands as $brand):
            if($brand->getAttributeCode() == 'brands')
                $brand_options[$brand->getOptionId()] = $brand->getValue();
            endforeach;

        $this->addColumn('brands',
            array(
            'header'=> Mage::helper('catalog')->__('Brands'),
            'width' => '10px',
            'index' => 'brands',
            'type'  => 'options',
            'sortable' => false,
            'options' => $brand_options,
        ));


texts: Magento 2:- How to create Vertical or Horizontal tagging with Tabs widget

texts:
I tried to create tabbing using Tabs widget but It does not display what i want.
I follow this Link:- Tab widget and Building Tabbed Interface with Magento 2 Javascript UI

Widget/Modal/view/frontend/layout/modal_index_tabwidget.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">

I want output like below if someone knows then please help me.


texts: Reinstall an existing Module using Composer (in Git)

texts:
I have a module already installed in the tree and want to replace it by installation via composer.

The magento hackathon composer installed is used.

Also all symlinks created by the installer are excluded via .gitignore


texts: Unassigned Attributes from an attribute set Magento 1

texts: How Can I unnasigned an attribute from an attribute set without deleting it, in case I need to assign it back. I use Magento 1.9


texts: get eav attribute collection Code format in Magento2

texts:
I am migrating m1 code to m2, below is the code i used in m1 to get eav collection.

  $customerattrs = Mage::getModel('eav/entity_attribute')->getCollection();
    $customerattrs->addFieldToFilter('is_user_defined', 1);
    $customerattrs->addFieldToFilter('entity_type_id', Mage::getModel('eav/entity')->setType('customer')->getTypeId());

how this can be used in magento2?

here is my controller code

 class CreatePost extends \Magento\Framework\App\Action\Action
 {
protected $helperData;
public function __construct(

    \[Vendor}\[Module]\Helper\Data $helperData
) {
    $this->helperData = $helperData;
}
public function execute()
{
    if ($this->getRequest()->isPost()) {

        $helderDataObj = $this->helperData- >getCustomerUserDefinedAttributes();
        echo '<pre>';
        print_r($helderDataObj);
        die;
    }

  }

 }

I have declared helper file like below

class Data extends \Magento\Framework\App\Helper\AbstractHelper
 {
   protected $eavAttribute;
   protected $entity;
   public function __construct(
    \Magento\Framework\App\Helper\Context $context,
    \Magento\Eav\Model\Attribute $eavAttribute,
    \Magento\Eav\Model\Entity $entity
) {
    $this->eavAttribute = $eavAttribute;
    $this->entity = $entity;

    parent::__construct($context);
}
 public function getCustomerUserDefinedAttributes()
{
    $attributeCollection = $this->eavAttribute->getCollection();
    $attributeCollection->addFieldToFilter('is_user_defined', 1);
    $attributeCollection->addFieldToFilter('entity_type_id',$this->entity->setType('customer')->getTypeId());

    return $attributeCollection;
 }
}


texts: Resaving a simple product generated from configurable product in Magento2 for Layered navigation to update?

texts:
Not sure if it's a bug or I'm just missing the point but when I create a configurable product in Magento 2.2.1 - the layered navigation on the front end doesn't update.

To get the layered navigation to be updated, I have to resave any one, yes only one, of the simple products that were generated when creating the configurable product.

So I guess my question is...

Why do I need to resave a simple product that's been generated from creating a configurable product in Magento 2.2.1 for changes to be applied to the Layered navigation on the frontend?


texts: Magento 2: What is the source_service field element?

texts:
In app/code/Magento/Config/etc/system.xsd, we can see that there is a source_service field element type that is defined:

<xs:element ref="source_service" />

Its definition is the following:

<xs:element name="source_service">
    <xs:annotation>
        <xs:documentation>
            Service used to populate select options
        </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="idField" type="xs:string" use="optional" />
                <xs:attribute name="labelField" type="xs:string" use="optional" />
                <xs:attribute name="includeEmptyValueOption" type="xs:boolean" use="optional" />
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
</xs:element>

However, I couldn't find any reference to system fields using this element.

What is this field for and how to use it ?


texts: Magento 2.3 - LEMP Localhost - For Multi Website where should be create Symbolic links folder - Root folder or Pub folder?

texts:
I just want to create multi-website, i read some links to guide me to create a subfolder and create symbolic links of app,pub,lib,var and copy index.php & .htaccess from root folder to a subfolder.
Here where i can create a subfolder  Root folder or Pub folder?
This guide leads to create under Root folder => https://meetanshi.com/blog/setup-magento-2-multi-store/
This guide leads to create under Pub folder => https://magento.stackexchange.com/a/198257/57334
Which one should I follow?
And how to add my localhost URL to my Nginx configuration, most of the documents and online links teach only live URL.
My single store Nginx Configuration :
server {
listen 8087;
server_name gomart;
set $MAGE_ROOT /usr/share/nginx/html/gomart;
include /usr/share/nginx/html/gomart/nginx.conf.sample;
error_log /usr/share/nginx/html/gomart/gomart_error.log;
access_log /usr/share/nginx/html/gomart/gomart_access.log;
set $MAGE_RUN_TYPE website;
}

upstream fastcgi_backend2 {
server 127.0.0.1:9000;
}


texts:
I am trying to install magento2 via composer using following command.
My System specification is PHP Version 7.0.20-1~ubuntu16.04.1

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition

I got the following error

Updating dependencies (including require-dev)

Your requirements could not be resolved to an installable set of packages.

Problem 1

- Installation request for magento/product-community-edition 2.1.7 -> satisfiable by magento/product-community-edition[2.1.7].
- magento/product-community-edition 2.1.7 requires php ~5.6.5|7.0.2|7.0.4|~7.0.6 -> your PHP version (7.1.6) does not satisfy that requirement.


texts: How to use getUrl() function in Magento 2

texts:
Can I call Mage::getUrl() directly using $this-> in Magento2?

How can I use below code in Magento2?

$link = Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$this_params));


texts:
I am using magento 2.2.3 in ubuntu 16.04. I have transferred a server copy to my local pc. I am having following error

RuntimeException: Can't create directory /var/www/html/new_utshob/generated/code/Magento/Framework/App/Http/. in
[Magento\Framework\App\Http\Interceptor] in
/var/www/html/new_utshob/vendor/magento/framework/Code/Generator.php:115 Stack trace: #0
/var/www/html/new_utshob/vendor/magento/framework/Code/Generator/Autoloader.php
(35): Magento\Framework\Code\Generator->generateClass('Magento\\Framewo...') #1
[internal function]: Magento\Framework\Code\Generator\Autoloader-
>load('Magento\\Framewo...') #2 [internal function]:
spl_autoload_call('Magento\\Framewo...') #3
/var/www/html/new_utshob/vendor/magento/framework/Code/Reader/ClassReader.php(19
): ReflectionClass->__construct('Magento\\Framewo...') #4
/var/www/html/new_utshob/vendor/magento/framework/ObjectManager/Definition/Runt
ime.php(44): Magento\Framework\Code\Reader\ClassReader-
>getConstructor('Magento\\Framewo...') #5
/var/www/html/new_utshob/vendor/magento/framework/ObjectManager/Factory/Dynamic/
Developer.php(48): Magento\Framework\ObjectManager\Definition\Runtime-
>getParameters('Magento\\Framewo...') #6
/var/www/html/new_utshob/vendor/magento/framework/ObjectManager/ObjectManager.p
hp(56): Magento\Framework\ObjectManager\Factory\Dynamic\Developer-
>create('Magento\\Framewo...', Array) #7
/var/www/html/new_utshob/vendor/magento/framework/App/Bootstrap.php(232):
Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Framewo...',
Array) #8 /var/www/html/new_utshob/index.php(38):
Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #9
{main}

Could you please help?


texts:
On home page cms, I have added block as below :

{{block type='page/html' as='homepagecategories' template='page/html/homepagecategories.phtml'}}

And I am trying to load few of the categories as below

$store = Mage::app()->getStore()->getId();
$homeCategoryCollection = Mage::getModel('catalog/category')
        ->getCollection()
        ->setStoreId($store)
        ->addAttributeToFilter('display_on_home_page',1)
        ->addAttributeToSelect('url_path')
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('is_active')
        ->addAttributeToSelect('display_on_home_page');
foreach($homeCategoryCollection as $cat) {
 //category display output
}

when I comment foreach block, I am able to see my homepage but if I remove that comment, It gives me following log in system.

2014-03-10T15:07:42+00:00 DEBUG (7): Failed to load template:/mystorepath/default/template/page/html/homepagecategories.phtml

I have created "display_on_home_page" category attribute(dropdown) using extension and I am able to see dropdown in the backend. Any suggestion to move further?


texts: get how many products per row from event

texts:
I'm listening to the catalog_product_collection_load_after event to add some code when the category products grid / list is loaded, and from the observer code I want to get the following data:

is it list view or grid view?
if grid view, how many products per row?

looks like I need to access the products toolbar block, but I'm not sure how to do it. or maybe there's a better way?

Edit: forgot to mention, when screen is resized products per row change (for example reduced on smaller screens). can I know that ahead inside the php?

thanks!


texts: How Can I Configure Standing Order (Repeat Same Products Order Every Month to sent customer via Mail)

texts: Initially customer able to selected products for standing Order list, Every month starting customer get alert for "Your Monthly Alert" via E-mail. How can i configure standing order.


texts: SQLSTATE[HY000]: General error: 1114 The table 'catalog_product_index_price_tmp' is full

texts: While changing the configurable product status , getting a strange error like The table 'catalog_product_index_price_tmp' is full,


texts: TypeError: options is undefined (customer-data.js)

texts:
I'm building a custom Magento theme that relies on a couple of third party JS libraries (slick, bootstrap) and I've suddenly hit a problem that I cannot figure out.
When on the homepage I receive the error:

TypeError: options is undefined

In the customer-data.js file on line 85:

return $.getJSON(options.sectionLoadUrl, parameters).fail(function (jqXHR) {

This only happens on the homepage and any other page such as search results I do not receive this error, this leads me to believe it is the cause of some third party js on the homepage conflicting.

The shopping cart and Bootstrap.js stop working due to this error but slick slider continues to work fine. I've tried removing all code related to Slick and temporarily removed it from the RequireJS-Config file however this didn't change anything :(

Here's a link to the site in progress: removed

If anybody has had any experience with this any input would be much appreciated.


texts:
I am looking for (and am so far unable to find) a way to load all the transactional email templates in Magento 1.

Is there a way to do this? I don't want to load a single one, I need to load them all at once.


texts: How can I get a selected child product of a specific option of a bundle quote item?

texts:
I have $quoteItem (Magento\Quote\Model\QuoteItem) which represents a bundle product.

The order options are fetched via

$typeInstance = $quoteItem->getProduct()->getTypeInstance();
$this->orderOptions = $typeInstance->getOrderOptions($quoteItem->getProduct());

But in the returned array, there seems to be no link to the Product Entity IDs of the selections?

It is possible to fetch the available selections for an option:

    $selections = $typeInstance->getSelectionsCollection([self::MY_OPTION_ID], $quoteItem->getProduct());

But can I get the chosen option out of this?


texts: Magento 2.3 - Save and filter custom ui form record by store view

texts:
I want to store custom record by specific store view which is selected and also want to filter UI grid by it.

UI form


texts: Magento 2 Customer Attribute in REST Order API

texts:
I have added a new custom attribute for order in sales_order table. It contains a value for the order.

I have added extension_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Sales\Api\Data\OrderInterface">
        <attribute code="custom_order_no" type="string">
        </attribute>
    </extension_attributes>
</config>

File Company\Mymodule\Api\Data\MyModuleInterface.php

namespace Company\Mymodule\Api\Data;

    interface MymoduleInterface extends \Magento\Framework\Api\CustomAttributesDataInterface
    {
        public function getCustomOrderNo();

        public function setCustomOrderNo($custom_order_no);

        public function getExtensionAttributes();

        public function setExtensionAttributes();
    }

If I retrieve the order with /rest/V1/orders/4 REST api call, the custom attribute is not getting displayed


texts: Magento product save is not working when i add special price in it

texts:
I am working in Magento Enterprise.

When I save a product without any special price, everything is working fine and products are saving from admin.

But when I add a special price, product save is not working. My page does not stop loading when I click save. It is not showing any error and I need to stop Apache to stop loading.

What's wrong with special price?


texts: Check If Product Attribute Has Store View Specific Value

texts:
I want to check whether the "use default value" flag is set for a specific product attribute in the admin for a specific store view.

If I have the full product model, I can easily check it like that:

$product = Mage::getModel('catalog/product')->setStoreId($storeViewId)->load($productId);
$hasStoreViewSpecificValue = $product->getExistsStoreValueFlag('my_attribute');

Is it possible to get this information in a smart way without loading the whole product (optimally without any direct SQL queries, but if there is no other way...)?


texts: Magento 1.9 - Add custom zipcode validation on Home page

texts: Validate a zip code field on a home page popup in Magento 1.9 style might be using jquery button click.


texts: Why /V1/carts/mine/totals [GET] and /V1/carts/mine [GET] give 400 and 404 error after placed order in Magento-2.2.7 using Rest API?

texts:
I have one issue in Magento-2.2.7 API.After Placed order, This API /V1/carts/mine/totals [GET] and /V1/carts/mine [GET] give errors

  400[Bad Request],404[Not Found] error.

Please guide me what is issue in this api .


texts: How to change default order of products in search result page (Magento 1.9)

texts: I have been using Solarium search module. The solarium module returns the correct search results in the order of relevance and is stored in 'catalogsearch_result' . The problem is that they are displayed in a random order and not according to relevance. So I need to change the order of products in search results page. How can I achieve this.


texts: Get custom options from nominal items that were ordered

texts:
In a helper class, I am trying to get, via a foreach loop, custom options from each purchased product from a loaded order. I am successful in grabbing the options and option values on each regular virtual product. However, when it comes to nominal virtual products (recurring based), the below code won't pick those picked options up from the order.

Since $item->getProductOptions() is null on nominal virtual based products, is there another way I can get what options the customer picked? Note that customers are able to pick the custom options before placing any products (including nominal) into the cart and checkout successfully.

The below code is successful in getting custom options on virtual products, but not with nominal virtual products:

$items = Mage::getModel('sales/order')->loadByIncrementId($orderId)->getAllVisibleItems();

$productOptions = array();
foreach($items as $iKey => $item) {
    $options = $item->getProductOptions(); /* Null on nominal products only */

    foreach($options['options'] as $oKey => $option) {
        $productOptions[$iKey]->label = $option['label'];
        $productOptions[$iKey]->id = $option['option_id'];
        $productOptions[$iKey]->type = $option['option_type'];
        $productOptions[$iKey]->print_values = explode(",",$option['print_value']);
        $productOptions[$iKey]->option_values = explode(",",$option['option_value']);
    }
}

*Note that I am still able to get all items, just not their options in nominal based products.

Update:  I've looked at the DB table sales_flat_order_item and found that the column product_options is null on nominal products but has listed options for regular products. Since Magento's recurring feature is listed as (beta) that this maybe a bug.


texts: Determine product info inside a Plugin (How to change decimal precision for specific product type)?

texts:
Currently I'm building off of a previous question I asked which involved displaying prices to 4 decimals points. The solution I was given worked great, but I actually only need it to run on a specific product. I'm unsure of how to conditionally call my plugins or for the plugins to conditionally run a specific way based on the product information.

My plugin is something like this (you can reference my question to see the unabridged answer)

# File: {Vendor}/{Extension}/Plugin/Framework/Pricing/Render/Amount.php
public function beforeConvertAndRound( $subject, ... ){
    return [$amount, $includeContainer, 4];
}

Using my IDE, I can see that the information I need is visible in the scope of the above function call:

$subject->price->product->_data->type_id; //-> 'customtype'

The more experienced probably recognized right away that the following code block doesn't work, but it shows the logic I'm looking for.

public function beforeFormatCurrency( $subject, ..., $currentproduct ){
    if (  $subject->price->product->_data->type_id == "customtype" ){
        return [$amount, $includeContainer, 4];
    }
    else {
        return [$amount, $includeContainer, 2];
    }
}

So my question is: What is the recommended strategy to get current page or product information inside of a Plugin?* My question is specifically about getting the product info inside my plugin, but I imagine the approach would very similar in any scope and inside of my template files as well.

Using Magento 2.1.2 CE*


texts: How to call resource model method in model

texts:
I am overriding Mage/Customer/Model/Customer.php in my local module:

Abc/Customer/Model/Customer.php

protected function _beforeSave()
    {
        parent::_beforeSave();
        echo get_class($this);   //Abc_Customer_Customer_Model_Customer_Customer is the above output

        Mage::getResourceModel('customer/customer')->_beforeSave($this);

The above code is coming from Mage/Model/Resource/Customer.php

This is throwing an error :

  Fatal error: Call to protected method
  Mage_Customer_Model_Resource_Customer::_beforeSave() from context
  'Abc_Customer_Model_Customer_Customer ....

How to call this method  Mage::getResourceModel('customer/customer')->_beforeSave($this);


texts: Error Occur in Data Migration Magento 1.8.0.0 to Magento 2.3.3

texts: Notice: Undefined offset: 19 in vendor/magento/data-migration-tool/src/Migration/Step/Eav/Data.php on line 455


texts: Website horribly slow to load. (Around 15 seconds)

texts:
I have all cache enabled, running around 16GBs of memory, 8 core CPU. And yet, the website is still horribly slow. Fetching the products takes around 15 seconds or so! Trying to see what's taking so long, I found that products.html is what's taking so long.

The odd thing is, if I call the -entire- product collection from my own code, it takes around 1-2 seconds. But on the website it's taking well over 15 seconds!

What might be causing this slow down? And how can I solve the issue?


texts: Magento 2 - Get tree of specific category, child categories and product collection

texts:
I have specific categorize and I want to create a menu from this specific categories with categories children and display product name.. example

Specific root categories
   subcategory
              product
              product
        subcategory
              product
              product
              product
              product
   subcategorie
              product
              product
        subcategory
              product
              product
              product
              product
              product
        subcategorie
              product
              product
              product
   subcategorie
        subcategorie
        subcategorie
   subcategorie
        subcategorie
        subcategorie
        subcategorie


texts: Magento 2 : How to remove the default Store langauge code from the URL

texts:
I have integrated multi language stores one for "EN" and second for "DE"
After changed options "Add Store Codes to URL"=>"YES"

(Magento2:: System -> Configuration -> Web -> Add Store Codes to URL=>YES)

German - http://www.domain.com/de/product-url

English - http://www.domain.com/en/product-url

But now I want to remove "/en" only from English URL.
so my both URLs would be like below.

German - http://www.domain.com/de/product-url

English - http://www.domain.com/product-url

Also i have checked many answers but not related Magento-2

Please any suggestions for Magento2 ?


texts: _addColumnFilterToCollection not working in page 2

texts:
Here is a method in a observer to add a custom column in customer grid, and use custom filter collection function to filter. The problem is when i search billing_company for example test in page 1, it works, but not works in page 2.

    public function beforeCollectionLoad(Varien_Event_Observer $observer)
    {
        try {
            $event = $observer->getEvent();
            if ($event->getBlock() instanceof Mage_Adminhtml_Block_Customer_Grid) {

                $this->_grid = $event->getBlock();
                $this->_collection = $this->_grid->getCollection();

//echo count($this->_collection);
                $this->_collection->addAttributeToSelect('billing_company')->joinAttribute('billing_company', 'customer_address/company', 'default_billing', null, 'left');

                $this->_grid->addColumnAfter(
                    'billing_company',
                    array(
                        'header' => Mage::helper('Test_Admin')->__('company_name'),
                        'index'  => 'billing_company',
                        'type'   => 'text',
                    ),
                    'entity_id'
                );

                $this->_grid->sortColumnsByOrder();
                // rebuild the filters
                $filter = $this->_grid->getParam($this->_grid->getVarNameFilter(), null);
                if (is_null($filter)) {
                    return $this;
                }
                $this->_collection->clear();
                if (is_string($filter)) {
                    $data = $this->_grid->helper('adminhtml')->prepareFilterString($filter);
                    $this->_setFilterValues($data);
                } else {
                    if ($filter && is_array($filter)) {
                        $this->_setFilterValues($filter);
                    }
                }
                // force a reload of the collection
                $this->_collection->load();

            }
        } catch (Exception $e) {
            mage::logException($e);
        }

        return $this;

    }

    protected function _setFilterValues($data)
    {
        foreach ($this->_grid->getColumns() as $columnId => $column) {
            if (isset($data[$columnId]) && (!empty($data[$columnId]) || strlen($data[$columnId]) > 0)
                && $column->getFilter()
            ) {
                $column->getFilter()->setValue($data[$columnId]);
                $this->_addColumnFilterToCollection($column);
            }
        }

        return $this;
    }

    protected function _addColumnFilterToCollection($column)
    {

        if ($this->_collection) {

            $field = ($column->getFilterIndex()) ? $column->getFilterIndex() : $column->getIndex();

            if ($column->getFilterConditionCallback()) {
                call_user_func($column->getFilterConditionCallback(), $this->getCollection(), $column);
            } else {
                $cond = $column->getFilter()->getCondition();

                if ($field && isset($cond)) {
                    $this->_collection->addAttributeToFilter($field, $cond);
                }
            }
        }

        return $this;
    }


texts: Get product only with attributes used in product listing in a test

texts:
In my test I am creating a product like this:

$product = $this->objectManagerHelper->create('Magento\Catalog\Model\Product');
$product
    ->setId(1)
    ->setTypeId(Product\Type::TYPE_SIMPLE)
    ->setWebsiteIds([1])
    ->setName('Simple Product 1')
    ->setSku('simple1')
    ->setPrice(10)
    ->setVisibility(Product\Visibility::VISIBILITY_BOTH)
    ->setUrlKey('url-key2')
    ->setCategoryIds([2])
    ->setStockData([
        'use_config_manage_stock' => $manageStock,
        'qty' => $qty,
        'is_qty_decimal' => 0,
        'is_in_stock' => $isInStock
    ])
    ->setData('erp_procurement', $erpProcurement)
    ->setData('qty', $qty)
    ->setData('manage_stock', $manageStock)
    ->setData('stock_lead_time', $stockLeadTime)
    ->setData(Product::STATUS, $stockstatus)
    ->save();

But how can I have the product as if it is loaded in listing only with the attributes that have used_in_product_listing set to true?


texts: Magento 2: quote data is not working with cache enable

texts:
I tried the below code but when the cache is disabled. it works, but when I enable cache it does not work.
Overview of retrieving the data of shopping cart items, subtotal, grand total, billing & shipping address in Magento 2

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$cart = $objectManager->get('\Magento\Checkout\Model\Cart');
echo $totalItems = $cart->getQuote()->getItemsCount();
echo $totalQuantity = $cart->getQuote()->getItemsQty();

  I know that we do not use an object manager. I will change the code.


texts: how to show category image and that category associated product in home page

texts: I want show the category image and their product on  home page i used many example but none to work for me can any one help me to do this task thanks in advance.


texts: Different Payment Method based on billing Country

texts:
I am migrating an e-commerce site to Magento.

I need to use different payment methods depending on the billing country.

Default site currency is USD. Any orders with a non-Canadian billing address use Authorize.net for CC payment.

If the billing address is Canadian, the site will use Paypal Payments Pro for Visa/MC and Authorize.net for Amex and will be billed in CAD.

From my research, it seems that I'm going to have to use 2 Stores (which seems less than ideal to me). Can anyone provide some experienced feedback on how to configure this?

Thanks!


texts: Is this the best way to add Font Awesome icons into header.links - Magento 2

texts:
Will this work?

<argument name="label" xsi:type="string">
    <i class="fa fa-facebook fa-lg" aria-hidden="true"></i>
</argument>

EDIT - I am trying to add font awesome icons into the header.panel and footer. Thanks to comments here, I added phtml templates into the blocks in the default.xml, referenced the correct containers and now the custom ul>li>a are rendering. However the font awesome i class and icons wont show. The cdn is loading (checked in chrome developer) and I set a width and height to the .fa class. still they aren't appearing.


texts:
I developed a custom magento module and was trying to test it using the validate_m2_package tool as part of marketplace upload. I am little confused on folder structure for Magento module.

I developed the modules using the following
1. app/code/vendorname/modulename/etc/module.xml
   app/code/vendorname/modulename/composer.json
   app/code/vendorname/modulename/registration.php

It was working fine functional as required for my purpose. But when I am package it to zip file with vendorname folder as root and run it against the validation tool it throws error saying "composer.json" is unexpected place. But when i package module file as root and validate it passes through all validation. is the folder structure correct? if yes, is the validation script is having a bug. if no, am i suppose to package only module file for marketplace upload?


texts: Hunks failed in Mage/Catalog/Block/Product/Abstract.php SUPEE 8788

texts:
I'm searching high and low and can't find the solution to my problem.
I almost got the patch working properly except for this file (app/code/core/Mage/Catalog/Block/Product/Abstract.php).
Excerpt from terminal:

patching file app/code/core/Mage/Catalog/Block/Product/Abstract.php
Hunk #1 FAILED at 34.
Hunk #2 FAILED at 43.
Hunk #3 FAILED at 56.
Hunk #4 FAILED at 89.
Hunk #5 FAILED at 126.
Hunk #6 FAILED at 155.
Hunk #7 FAILED at 169.
Hunk #8 FAILED at 304.
Hunk #9 FAILED at 419.
9 out of 9 hunks FAILED -- saving rejects to file app/code/core/Mage/Catalog/Blo                   ck/Product/Abstract.php.rej

I checked and the file seems to be the same as from stock (no changes made to the core file). Can anyone help?

PS I reverted SUPEE-1533, installed SUPEE-3941 before trying to patch 8788 v2.

PPS it's not duplicate, this issue isn't covered in that post..... please read before you mark it duplicate


texts:
I am unable to get product id with this code, and getting error imageUrl undefined. Please let me know if any solution regarding this.

<?php foreach ($items as $_item): ?>
       <?php echo($iterator++ == 1) ? '
' : '

' ?>

       <a href="<?php echo $_product->getProductUrl() ?>" class="product photo product-item-photo" tabindex="-1">

       <?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
       $product = $objectManager->create('Magento\Catalog\Model\Product')->load($_item->getId());
       $images = $product->getMediaGalleryImages(); $imgCNT = 1;
       foreach($images as $child){ if($imgCNT==1) {$imgurl1=$child->getUrl();}
       elseif($imgCNT==2) {$imgurl2=$child->getUrl();
       }
       else{
           break;
       }
       $imgCNT++;
       }
       $imageUrl = $this->helper('Magento\Catalog\Helper\Image')
       ->init($_item, 'product_page_image_large')
       ->keepAspectRatio(TRUE)
       ->keepFrame(FALSE)->
       resize(270, 404)
       ->getUrl(); ?>
        <img class="product-image-photo" src="<?php echo $imageUrl; ?>"
       <img class="product-image-photo" src="<?php echo $imageUrl; ?>" onmouseover="this.src='<?php if($imgurl2){ echo $imgurl2;}else{echo $imageUrl;} ?>';" onmouseout="this.src='<?php echo $imageUrl; ?>';"/>


texts: how to notify customer when admin puts into hold status from grid?

texts:
In admin side sales order grid screen we can select orders & we can put into hold status.but in this case there is no possibility for notifying customers.

When we are open that order there is a section for notifying customers with check box.

but i want to put orders into hold status from grid & notify to customers.


texts: Installing Magento CE through Installatron in Cpanel - Yay or Nay?

texts: In the past I've paid an expert to install Magento CE on my servers, because despite being reasonably tech savvy, it looks like a daunting task to do manually. I'm starting a new store and recently discovered that I could do an 'easy' install of Magento using Installatron in Cpanel. Does anyone have any experience in doing this, and would you recommend it?


texts: Getting error when creating a new customer account in magento 2

texts: I have installed a theme in Magento 2 when I create a new account for the customer it shows error. when I fill up customer info. and go for submitting it display error that is in   please solve this problem.


texts: MAGENTO 1.9 Soap delete all image from product

texts:
I'm using the SOAP web service to add images to products after I import them. Now before I want to add the image to the specific product, I want to delete all the images of that product. But the SOAP service wants me to specify the name of the image. This is randomly generated so I don't have the name of the image for each product.

Ho do I delete all the images of 1 product with a SOAP call.

Here's a part of the code:

foreach ($array as $prod) {
            $sku = $prod[0];

            $photo = $prod[8];
            $data = file_get_contents($photo);
            $base64 = base64_encode($data);

            $file = array(
                'content' => $base64,
                'mime' => 'image/jpeg'
            );

            $resultDelete = $client->catalogProductAttributeMediaRemove($sessionId,(string)$sku, '');
            $result = $client->catalogProductAttributeMediaCreate($sessionId, (string)$sku, array('file' => $file, 'label' => $sku, 'position' => '1', 'types' => array('thumbnail', 'image', 'small_image')), '', 'sku');

            print_r($resultDelete . ' - ' . $result . '<br>');

        }

As you can see, what do I need to add to the parameters of

catalogProductAttributeMediaRemove

to make it delete all the images of that product instead of one?


texts: Since updating to 8788v2 patch the Browse button does not work. I have checked and the swf files have now been deleted. And now the Browse button does not seem to work.Is there a way to fix this issue.


texts:
Just upgraded to a clean install of 1.9.1.0 from 1.7.0.2. For some reason tax is being subtracted from the unit price so that the total includes tax but is the same as the unit price.

Was there a change between these 2 version that would cause this? I saw something that sounded like a bug fix for this issue in the the base theme for 1.9.1.


texts: Magento 2 New Install on WAMP Can't Login to Admin

texts:
I've installed Magento 2 on WAMP and the admin username/password page displays okay. However, after clicking login chrome shows a "This site can’t be reached, The connection was reset." message.

Same install process on LAMP server works okay.
Have confirmed that the admin account is enabled and password is okay. Saw posts about there being a Magento 2 setup bug related to passwords.
Have created a new admin user via cli but get the same result.
Tried changing the admin url via cli but get the same result.
Have turned off caching and deleted all files in var/cache.
Same behavior in other browsers.
Complete re-install from scratch.
Reboot PC


texts: How can I reposition buttons on magento2 theme

texts:
How can I change position of my buttons in magento theme I am using ultimo. I need something like this
.Any help will be highly appreciated. AS I am so much stuck here


texts: Pass session and location between two sub-domains?

texts:
We have two main sites (www.website.com, and ca.website.com) We utilize GEOip to redirect to the appropriate site for US/Canada.

We share the same catalog, back-end for both sites. However, it doesn't seem to share the Cart, nor the sessions between the two sites when you change.

We would like to have it so that, for example: Canadian goes to ca.website.com, and chooses to switch to the US site (www.website.com) if they were already viewing a product, to load that product page (and/or if they add a product to the cart, to "bring" that cart with them between each site).

I have enabled SID on the frontend but it doesn't seem to do much (or anything by the looks of it).

Something I did note: If I add someone the to cart, switch sites (in either direction) the cart isn't brought over, however if I switch back, the cart is still there with the previous items.

Is there a way to resolve this without needing to do custom coding to fix this issue?


texts: Mediagallery images not corresponding with Sku images

texts:
I'm trying to get all the the different kind of product images from the Media-gallery (see code below). Product with the black-11 SKU is my black-product but it doesn't show that product image. What is wrong with the code. I noticed this with all the product so maybe it's a sorting problem or initiating

<?php
require '../app/Mage.php';
Mage::app("default");

$gallery_images = Mage::getModel('catalog/product')->load('black-11')->getMediaGalleryImages();

$items = array();

foreach($gallery_images as $g_image) {
  echo "URL: " . $g_image['url'] . "<br/>";
}
?>


texts: Magento 2: How to move product info media block to my custom tab on product page

texts:
How can I move Product.info.media block to my custom created tab on product view page in Magento 2.

My custom tab code is:

<block class="Magento\Catalog\Block\Product\View" name="specs.tab" as="specification" template="Magento_Catalog::product/related-products.phtml" group="detailed_info">
    <arguments>
        <argument translate="true" name="title" xsi:type="string">Specification</argument>
    </arguments>
</block>


texts: Cron error: sales_send_order_emails has an error: No such entity

texts:
I have these errors in cron.log:

main.ERROR: Cron Job sales_send_order_emails has an error: No such entity with cartId = 0.

We also have a problem with email confirmations and they are not being sent. We use 3rd party SMTP extension.

What is that error about and is there a fix to remove that? Might this error have something to do with emails not being sent?


texts: Rule for BOGOGO(Buy 1 get 1 same product free) in magento 2

texts: How to create a rule in Magento 2 for BOGOGO(Buy 1 get 1 same product free and give another product)?


texts: Adding custom product customizable option in Magento 2.1

texts:
I am looking into the way the new custom options works in Magento 2.1, looking through it, their doesn't seem to be an obvious way to inject your own uiComponents into this, since it is all written in an object, inside protected methods (so no plugins).

This is the class that seems to controll it.

\Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\CustomOptions

I though this would be an obvious thing you would want to modify, and previously this was easily possible by adding a renderer, which you still can and all the product custom options still do in the product_options.xml by adding a renderer

Am I missing something?


texts: Magento2 how to make query in the right method?

texts:
I have created a sql query but i don't know how to make this as in the Magento2 format any help

$sql = "`select product_id,customer_Id,bid_status,MAX(bid_Amount) max_bid FROM mbid_history as d where customer_id in(select max(customer_id) from mbid_history as m where m.product_id=d.product_id) AND bid_status=1 group by product_id,customer_id,bid_status`";

I have tried this but it is returns wrong data

$sql = $connection->select()
            ->from(
                ['o' => $tableName],
                ['MAX(bid_amount) as max_bid', 'product_id', 'customer_id']

            )->where('o.bid_status=?', '1')
            ->group('product_id', 'customer_id');


texts:
I have a modal with 2 buttons that have a click function. Inside of each of these click functions is a block that's supposed to only be executed when clicked. However, the block seems to be executed before one of the buttons is clicked.

buttons: [
            {
                text: $.mage.__(`Don't Allow`),
                class: 'dontAllow',
                click: function(){
                    console.log(`I clicked Don't Allow`);
                    <?= $block->disableAdminUsage(); ?>
                    this.closeModal();
                },
            },
            {
                text: $.mage.__('Ok'),
                class: 'action',
                click: function(){
                    console.log("I clicked Ok");
                    <?= $block->enableAdminUsage(); ?>
                    this.closeModal();
                },
            }
        ],


texts: Reindex gets scheduled by cron but never executed

texts:
For magento 2.2.4 my cron.sh looks like this (crontab is not available in this environment):

#!/bin/bash

PHP_BIN=`which php7-71STABLE-CLI`;

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BIN="$DIR/bin/magento"
INI="$DIR/php.ini"

$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI $BIN cron:run | grep -v "Ran jobs by schedule" >> $DIR/var/log/magento.cron.log
$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI $DIR/update/cron.php >> $DIR/var/log/update.cron.log
$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI $BIN setup:cron:run >> $DIR/var/log/setup.cron.log

It is run every minute and produces no errors.

In the table cron_schedule I see all kinds of scheduled entries including indexer_reindex_all_invalid.

While others are properly executed the reindex never gets executed. It is stuck with status pending.

The cron config in backend is using the default options.

Manual php bin/magento indexer:reindex works fine but this should be done automatically as it is in my dev environment.

I googled and searched everywhere and ran out of options. What could possibly be wrong here?


texts: How to Override phtml file in Magento 2?

texts:
I am overwriting

vendor/magento/module-catalog/view/frontend/templates/product/view/attributes.phtl

and I tried puting the overriden file in two locations but no chages occur

First:

app/code/<VENDOR_NAME/<MODULE_NAME>/view/frontend/templates/product/attributes.phtml

Having created a module here

Second:

app/design/frontend/<VENDOR_NAME>/<THEME_NAME>/Magento_Catalog/templates/product/view

What am I doing wrong?


texts: How to add new product problem solve(There has been an error processing your request) in magento?

texts:
"catalog > manage new product > add product > continue" then...

after...
"domain > public_html > magento > error"
local.xml.sample change rename local.xml
"domain > public_html > magento > lib > zend > cache > backend > file.php"
edit code row no 99 'null' to 'tmp/'
"domain > public_html > magento" create new folder tmp
then reload further this problem

How can solve please help me


texts:
I could really use some help!

I was tasked with upgrading somebody's Magento installation from 1.7.x to 1.9.x. So, I installed Magento 1.9.x to a separate directory and copied over theme, skin, media, etc. All went fine and the site was up and running. That was until I discovered that some contact forms were missing from the upgraded site.

Upon further investigation, I figured that Admin panel in the new install was missing some tabs under System -> Configuration -> General. Those tabs seem to control the missing forms:

I started to dig dipper and noticed that corresponding modules were added under app/core/code/Mage. Here is what it looks like for the "Get a Quote" tab:

app/code/core/Mage/GetQuotes
app/code/core/Mage/GetQuotes/controllers/IndexController.php
app/code/core/Mage/GetQuotes/etc/adminhtml.xml
app/code/core/Mage/GetQuotes/etc/config.xml
app/code/core/Mage/GetQuotes/etc/system.xml
app/code/core/Mage/GetQuotes/Helper/Data.php
app/code/core/Mage/GetQuotes/Model/System/Config/Backend/Links.php
app/code/core/Mage/GetQuotes/sql/getquotes_setup/install-1.6.0.0.php
app/code/core/Mage/GetQuotes/sql/getquotes_setup/mysql4-install-0.7.1.php
app/code/core/Mage/GetQuotes/sql/getquotes_setup/mysql4-install-0.8.0.php
app/code/core/Mage/GetQuotes/sql/getquotes_setup/mysql4-upgrade-0.7.1-0.7.2.php

I also noticed that extra code was added to app/etc/modules/Mage_All.xml for each of the modules. Here is a section for "GetQuotes":

<Mage_GetQuotes>
   <active>true</active>
   <codePool>core</codePool>
   <depends>
      <Mage_Core/>
   </depends>
</Mage_GetQuotes>

So, naturally, I copied those modules and Mage_All.xml to the new install's directory structure, hoping that missing tabs would re-appear. But no such luck! What else did I miss? How can I add them back? I'm new to Magento and it's driving me nuts!


texts:
I want to include category path for products inside my sitemap.xml.

Currently I am using Atwix Sitemap module, to split sitemap in multiple sitemaps. See: https://github.com/Atwix/Sitemap

How can I edit this module or the default Magento code, to include full product url's?


texts: Magento Override frontend template in custom module file

texts:
I want to override the contact page frontend from my module file.

To override the frontend template of contact form,  i have created module and in that module i have created layout file mymodule.xml in
app/design/frontend/base/layout/mymodule/mymodule.xml    in this file i have copied following code:

  <layout version="0.1.0">
      <contacts_index_index translate="label">
    <label>Contact Form</label>
       <reference name="head">
        <action method="setTitle" translate="title" module="contacts"><title>Contact You Us</title></action>
    </reference>
    <reference name="root">
        <action method="setTemplate">
         <template>page/1column.phtml</template></action>
        <action method="setHeaderTitle" translate="title" module="contacts"><title>Contact Us</title></action>
     </reference>
     <update handle="cms_menu"/>
      <reference name="content">
        <block type="core/template" name="contactForm" template="mymodule/form.phtml"/>
    </reference>
    </contacts_index_index>
  </layout>

I did following code in my module's xml file but it doesn't loading from my module.  What could be the issue?

Any help would be appreciated


texts: How tax import export works in Magento 2?

texts: In Magento 2 added tax rates import & export functionality, but I am not understating this module. Can you please explain in details?


texts: Have different urls for desktop and mobile sites

texts:
In my project, I want to have different urls for Desktop site and mobile site.

For example:

 www.example.com      // For Desktop

 www.example.com/m    // For Mobile site

How to do this?

Both have access to same Database.


texts:
I have an issue while accept the payment for an order in  admin side. It shows the below error while accepting payment that is made using Paypal Standard, Paypal Payments pro.

PayPal gateway has rejected request. Internal Error (#10001: Internal Error)

How to fix this issue?
Any assistance will be helpful...


texts: Contact us form doesn't send emails, other emails are sent immediately

texts:
Contact us page displays successful message but doesn't sent emails.
The method used is Sendmail, standard php way to send mails with own mail server. And it only happens on production server, when I send mails locally, no problems.

Test php script sends mail ok
Test Mage script sends mail ok
Mage sends all the other mail just right (registration mail etc.)

I have also tried to put try/catch here, but got no errors:

lib/Zend/Mail/Transport/Sendmail.php::_sendMail()
lib/Zend/Mail.php::send()

Where do I debug this thing rightly?


texts: how to add state wise tax charge without adding customer and product class

texts:
my question is bit technical. i want to ask if i belong to state named NJ, and i want apply tax rule only on this state, means if user selects NJ on checkout as its billing state it should charge him 7% extra in checkout. i have made the tax rule as well but unable to implement on front end.
i want this without influence of product and customer class.
if i am wrong please give me proper direction with step by step guide.
i am using magento 1.8.0.
please help........................


texts: Extending another modules form fields using addfield but values will not saving

texts:
I am using the block rewrite below to add two fields to module Amasty_Shopby.

<?php

class Etre_Amshopby_Block_Rewrite_Shopby_Adminhtml_Filter_Edit_Tab_General extends Amasty_Shopby_Block_Adminhtml_Filter_Edit_Tab_General
{

protected function _prepareRegularForm()
{

    $fldSet3 = $this->_form->addFieldset('etre_amshopby_extra', array('legend'=> $this->__('Bonus Options by Etre')));
    $fldSet3->addField('labelOnFrontend', 'select', array(
        'label'     => $this->__('Show Label on Frontend'),
        'name'      => 'displayLabelFrontEnd',
        'values'    => $this->yesno,
        'required' => true
    ));
    $fldSet3->addField('labelInDropdown', 'select', array(
        'label'     => $this->__('Show Label in Dropdown'),
        'name'      => 'displayLabelInDropdown',
        'values'    => $this->yesno,
        'required' => true
    ));
    parent::_prepareRegularForm();
}
}

The fields show up but they do not save. I'm not sure what the most appropriate way to handle this is.

My guess is part of what needs to be done is each of these fields needs to be added to the Amasty filter table in the DB but I have setup few SQL install scripts within Magento modules so I am unsure as to how I should proceed.

The save action for the filter form is below. My fields are displayed when Zend_Debug::dump($data) is called within this action.

public function saveAction()
{
    $id     = $this->getRequest()->getParam('id');
    $model  = Mage::getModel('amshopby/filter');
    $data = $this->getRequest()->getPost();
    if ($data) {
        $model->setData($data);
        $model->setId($id);

        if ($model->getData('display_type') == Amasty_Shopby_Model_Catalog_Layer_Filter_Price::DT_FROMTO) {
            $model->setData('from_to_widget', true);
        }

        try {
            $model->save();
            Mage::getSingleton('adminhtml/session')->setFormData(false);

            $msg = Mage::helper('amshopby')->__('Filter properties have been successfully saved');
            Mage::getSingleton('adminhtml/session')->addSuccess($msg);
            if ($this->getRequest()->getParam('continue')){
                $this->_redirect('*/*/edit', array('id' => $model->getId()));
            }
            else {
                $this->_redirect('*/*');
            }

        } catch (Exception $e) {
            Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
            Mage::getSingleton('adminhtml/session')->setFormData($data);
            $this->_redirect('*/*/edit', array('id' => $id));
        }

        $this->invalidateCache();
        return;
    }
    Mage::getSingleton('adminhtml/session')->addError(Mage::helper('amshopby')->__('Unable to find a filter to save'));
    $this->_redirect('*/*/');
}


texts: Magento 2 display a category's product listing with its layered navigation on home page?

texts:
I am using Magento 2.2.2

I want to display a particular category products on homepage along with its respective layered navigation.

What I have already tried:

1) Changed home page layout to "2 columns with left bar"

2) Added a widget in home page content from admin for category id 1. Enabled pagination.

But I am not getting the default listing header for changing the product listing and neither it is displaying the layered navigation for this category on home page.

Check this image :

Is there any issue with this approach

Can you tell me if my approach is right or I am missing something to achieve my task.

Or is there a way that I could display a category page as my home page and the URL still remains the websites URL only i.e. nothing more than www.website.com


texts: Import configurable products through data profiles

texts:
I have imported a configurable product through data profile for different stores view. For the model I exported one configurable product and edited it by adding separated lines for each store view. The products are imported almost fine.

I don't understand why I can't see configurable attributes for my product in frontend. When I try to edit the configurable product in admin it shows me

  Only attributes with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available.

and I can choose some attributes like color and size. I will mention that my attributes have Scope - Global and Catalog Input Type is Dropdown.

My question is what have I done wrong? If I check my attributes than my product will be fine on frontend but I don't think this is the solution


texts:
I'm trying to override "content" block of page.xml. It works with default design package. I can output products in content block:

but with rwd package it not overriding "content":

no matter if I put my 'trening' theme in rwd or default directory:

#\app\code\local\Trening\NewModule\etc\config.xml
<?xml version="1.0"?>
<config>
    <global>
        <models>
            <newmodule>
                <class>Trening_NewModule_Model</class>
            </newmodule>
        </models>
        <blocks>
            <newmodule>
                <class>Trening_NewModule_Block</class>
            </newmodule>
        </blocks>
        <helpers>
            <newmodule>
                <class>Trening_NewModule_Helper</class>
            </newmodule>
        </helpers>

        <events>
            <customer_login>
                <observers>
                    <NewModule>
                        <type>model</type>
                        <class>NewModule/observer</class>
                        <method>logCustomer</method>
                    </NewModule>
                </observers>
            </customer_login>
        </events>
    </global>

    <frontend>
        <routers>
            <trening_newmodule>
                <use>standard</use> <!--standardowy router, (nie ważne, trzeba to wpisać)-->
                <args>
                    <module>Trening_NewModule</module>
                    <frontName>trening</frontName> <!--pierwszy człon adresu url który ma prowadzić do tego modułu  localhost/trening/.../..-->
                </args>
            </trening_newmodule>
            <catalog> //nadpisanie kontrolera catalog/product
                <args>
                    <modules>
                        <demo before="Mage_Catalog">Trening_NewModule</demo>
                    </modules>
                </args>
            </catalog>
        </routers>
        <layout>
            <updates>
                <newmodule>
                    <file>trening.xml</file>
                </newmodule>
            </updates>
        </layout>
    </frontend>
</config>

How to do it to make it work in rwd?


texts: Magento 2 - How to add compare product and My orders link in header dropdown after logging in?

texts:
As I require compare product and my order link in user dropdown shown in image below My account. I tried to edit header.phtml file. which only displays

 <?php echo $this->getChildHtml("header.links"); ?>

Where exactly should I edit??

Your Suggestions will be appreciated.


texts: AWS Read Replica fails to sync magento MEMORY-engine table

texts:
Our Magento 1.9 database is hosted on AWS RDS. For improving database performance, we created an Amazon Read Replica.

Unfortunately, the read replica runs out of sync. Error messages indicate, that replication tries to delete records from

catalog_product_index_eav_tmp

... but these records don't exist.

Further investigation showed, that this table uses the MEMORY engine, and tables using the MEMORY engine cannot be replicated properly.

https://www.percona.com/blog/2010/10/15/replication-of-memory-heap-tables/ suggests to prevent these tables from being replicated by using the option replicate-ignore-table=db.memory_table . But this option seems to be unavailable in Amazon RDS.

Does anyone have a suggestion of how to get the read replica running in our environment?


texts: Magento 2 Checkout page customer address attribute save Dropdown value

texts:
I have created one module that has created Customer Attribute called Title:

For that i have created layout processor Vendor/Modulename/Plugin/Checkout/Model/Checkout/LayoutProcessor.php

      class LayoutProcessor
 {
/**
 * @param \Magento\Checkout\Block\Checkout\LayoutProcessor $subject
 * @param array $jsLayout
 * @return array
 */
public function afterProcess(
    \Magento\Checkout\Block\Checkout\LayoutProcessor $subject,
    array  $jsLayout
) {
    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shipping-address-fieldset']['children']['delivery_date'] = [
        'component' => 'Magento_Ui/js/form/element/abstract',
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/date',
            'options' => [],
            'id' => 'delivery-date'
        ],
        'dataScope' => 'shippingAddress.delivery_date',
        'label' => 'Delivery Date',
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [],
        'sortOrder' => 250,
        'id' => 'delivery-date'
    ];

    $jsLayout['components']['checkout']['children']['steps']['children']['shipping-step']['children']
    ['shippingAddress']['children']['shipping-address-fieldset']['children']['cutitle'] = [
        'component' => 'Magento_Ui/js/form/element/select',
        'config' => [
            'customScope' => 'shippingAddress',
            'template' => 'ui/form/field',
            'elementTmpl' => 'ui/form/element/select',
            'id' => 'drop-down',
        ],
        'dataScope' => 'shippingAddress.cutitle',
        'label' => 'Drop Down',
        'provider' => 'checkoutProvider',
        'visible' => true,
        'validation' => [],
        'sortOrder' => 251,
        'id' => 'cutitle',
        'options' => [
            [
                'value' => '',
                'label' => 'Please Select',
            ],
            [
                'value' => 'mrs',
                'label' => 'Mrs.',
            ],
            [
                'value' => 'mr',
                'label' => 'Mr.',
            ]

        ]
    ];

     return $jsLayout;
   }

Plugin: di.xml

      <?xml version="1.0"?>
   <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
   <type name="Magento\Checkout\Block\Checkout\LayoutProcessor">
    <plugin name="dipen_add_custom_field" type="Vendor\Modulename\Plugin\Checkout\Model\Checkout\LayoutProcessor" sortOrder="100"/>
   </type>

   </config>

I want to save dropdown attribute value and it should show in admin order. What's missing?

Any help would be appreciated.


texts: "Invalid value of "%value" provided for the %fieldName field" Error in reset forgot password from multiwebsite

texts:
We have multi website (country wise) in Magento2 and the customers are shared through the multi website. In each website only the default country is allowed through Magento backend.

While resetting password from other website/country other than the default address, country getting error "Invalid value of "IN" provided for the country field". While it is working fine if the default address, and the allowed country is same.

So what is the best way to skip this step from AbstractAddress.php file and we cannot allow more than one country for a single website.


texts: How to get all contain (all modules) of Site from my theme in Magento2

texts:
I have create my theme From default magento-luma theme so luma is a parent them of my theme.

Below is the Step that I followed to create my theme from luma.

1). copy theme-frontend-luma folder from vendor/magento and place it to app/design/frontend/package_name/theme_name.

now onwards all below changes I have done in my theme folder.

2). in register.php file I changed with my package name and theme name.

<?php
\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/Forever/theme',
__DIR__
);

3). theme.xml file

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
<title>Forever Theme</title>
<parent>Magento/blank</parent>
<media>
    <preview_image>media/preview.jpg</preview_image>
</media>

Now I go to admin content->design->themes and I see that now my theme is showing there so I go to **store->configuration->general->design and assign my package and theme.

After that using CMD I run magento setup:static-content:deploy comment.

Now I go to frontend and what I see is yeah I done this. I have set up my theme for magento2 store.

but when I enable template path hint and see in frontend  some of the content (modules) are coming from vendor folder.so I have done some changes in vendor folder. So If I upgrade my magento version so will my changes remove?

Now what I want is below.

Like magento 1.x if we create theme from base folder then all modules are coming from our theme folder not from base I want same for magento 2.x And I don't want to come any module from vendor folder. so what I need to do?


texts:
Mage::getModel('core/cookie')->set('visitor_id', $visitorId, $this->_getExpiryTime(), '/');

How to convert this code into magento2?

I have trying this:

 $this->_cookieManager->setCookie('visitor_id', $visitorId, $this->getExpiryTime(), '/');

But its shows error.

This is my fun():

public function generateVisitorId()
{
    $visitorId = $this->_checkoutSession->get('visitor_id');
    if (!$visitorId) {
        $visitorId = uniqid();
        $this->_cookieManager->setCookie('visitor_id', $visitorId, $this->getExpiryTime(), '/');
    }

    return $visitorId;
}


texts: Call custom product list instead of base

texts:
I want to call my custom app/design/frontend/default/default/template/mytheme/catalog/product/list.phtml file instead of base/default/template/catalog/product/list.phtml

The list.phtml file is same as in base, but i have added some conditions for price.

I have my custom XML file at app/design/frontend/default/default/layout/mycustom.xml

I have used below code in my xml but no luck and is still calling the list.phtml file from base

<catalog_category_default>
            <reference name="content">
                <block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml" />
            </reference>

How can I do this using XML ?


texts:
When I go to Manage Customers and click on any of the customers, I get "There has been an error processing your request" and the following error in the log:

  Source model "marketplace/entity_attribute_source_table" not found for attribute "customerstatus"

and then a long list of codes.
What is creating the issue?


texts: How I can add custom config in categories in magento2

texts:
I need Add custom config to magento 2 category.
I Add in my module view/adminhtml/ui_component/category_form.xml

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">

<fieldset name="search_engine_optimization_templates" sortOrder="80">
    <settings>
        <collapsible>true</collapsible>
        Search Engine Optimization TEMPLATES
    </settings>

    <field name="meta_title_template" sortOrder="160" formElement="input">
        <settings>
            <dataType>string</dataType>
            Meta Title Template
        </settings>
    </field>

    <field name="meta_keywords_template" sortOrder="170" formElement="input">
        <settings>
            <dataType>string</dataType>
            Meta Keywords Template
        </settings>
    </field>

    <field name="meta_description_template" sortOrder="180" formElement="input">
        <settings>
            <dataType>string</dataType>
            Meta Description Template
        </settings>
    </field>

    <field name="template_weight" sortOrder="190" formElement="input">
        <settings>
            <dataType>string</dataType>
            Template Weight
        </settings>
    </field>
</fieldset>

Ok, i see in admin this:

But how i can save my custom parameters in database ?


texts: Admin left menu (System -> Configuration) - How can I make two different sections (one for each module) under the same tab in admin menu?

texts: I want to make several different sections in the left admin menu. I want one section for each module. I have two modules. Just like there is tab General, and under General, there is General, Web, Design, Currency Setup, etc... I want to make my own tab called About, and several different sections under it, which I will call Myself, I and Me. Now, I know how to make one section under one tab, but I can't make more sections under that first tab, only when this first section is clicked, more groups show in the main content. I want more sections to be visible under the menu tab (About) BEFORE this first section is clicked.


texts: How to add different quantity packages for a product?

texts:
I am using Magento 2.2 and want to be able to set different packages that can be purchased. Like for wine for example. It should be possible to order 1 bottle or 6 or 18 for example.

I know the qty could be entered in the qty field, but I want to be able to add the different package sizes seperately. Please also take a look at https://screenshots.firefox.com/z3HG7swzqBObULdZ/null

Is there something already build in?

Thanks!


texts: Change footer links according to website

texts:
I have 2 websites under same Magento admin: www.sajidat.com and  www.tr.sajidat.com.

I need to translate the footer links and change its links when I change the store. I mean when I choose tr.sajidat.com, I want footer changed to Turkish and change its links to Turkish page. How can I do that?


texts: Override third party module service contract

texts:
There is third party custom module.
For add entries they used service contract entities.
I need to add one more entry.  Don't want to touch third party module.
How can i extend their interface and module and after save data in table.
I've created field in table. But unable to override interface and Model and save entry.
I know there is concept Extension Attributes for this but not getting how to archive.
Please help me on this.


texts:
I have to work with rest APIs in magento2. For that, I added Integration through backend system->Extensions->Integration and activated the same.

Then I tried to get a response of default API of

  http://local.magento.com/V1/customers/1/billingAddres

But it gives 404 error always. Is anything I'm missing to set. I also added a new user and assigned a new role with all permissions How can I activate the rest API?


texts: Magento2 - Website Payments Pro for Australia

texts:
I can see that Website Payments Pro is not available for Australia from this Magento document, but from the Paypal website here I can see that it can be integrated with Australia.
SO how can I integrate Website Payments Pro with Magento2?


texts: magento enterprise to community downgrade, will customer login work after migration?

texts: If I am downgrading from magento enterprise to community edition, will the existing customer login work, as it is in community edition without any change? or will it require to reset the password for all the users?


texts: Magento2: Search products using filterable Attributes

texts:
I'm trying to make a product search engine and i need add a filter attribute option.

(i am using \Magento\Catalog\Model\Layer\Category\FilterableAttributeList)

i obtain the list of attributes

    $filterableAttributeList = $this->_filterableAttributeList->getList();

After i obtain the values for each attribute

foreach ($filterableAttributeList as $filter) {

        $code = $filter->getAttributeCode();
        $name = $filter->getFrontendLabel();

        $entities = $this->_eavConfig
                            ->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $code)
                            ->getSource()->getAllOptions();

}

and finally for each option i want to count the number of products that match with that option but always return 0.

        foreach ($entities as $entity){

            $label = $entity["label"];
            $value = $entity["value"];

            if($label == " ") continue;

            $queryValue = [];
            $queryValue[$code][] = $value;

                $products = $this->_catalogSearchAdvanced
                    ->addFilters($queryValue)
                    ->getProductCollection()
                    ->addStoreFilter($storeId);

                $total = $products->count();

    }

any idea?


texts:
I am adding a product to cart via SOAP V2 API:

$client = new SoapClient('http://mywebsite.com/api/v2_soap/?wsdl');
$session = $client->login('username', 'password');

$quoteId = $client->shoppingCartCreate($session);

$customerData = array(
    "firstname" => "Klevis",
    "lastname" => "Miho",
    "email" => "kmiho@myemail.com",
    "customer_id" => 2522,
    "mode" => "customer",
    "website_id" => "1"
);

$resultCustomerSet = $client->shoppingCartCustomerSet($session, $quoteId, $customerData);

$result = $client->shoppingCartProductAdd($session, $quoteId, array(array(
    'product_id' => '336',
    'sku' => '110757',
    'qty' => '1',
    'options' => null,
    'bundle_option' => null,
    'bundle_option_qty' => null,
    'links' => null
)));

$result1 = $client->shoppingCartInfo($session, $quoteId);

var_dump($result); //returns true

In the end it returns true. But when I login on the frontend there are no products in my shopping cart.

Am I missing something here?


texts: Magento Attribute Set cant save Attributes

texts:
Servus,

when i try to save Attributes to an Attribute Set, i get the confirmation that its been saved. When i reopen the Set, no attribute is saved to my Set.

Log file says:

  ERR (3): Warning: Cannot use a scalar value as an array  in app/code/core/Mage/Adminhtml/controllers/Catalog/Product/SetController.php on line 138

Magento 1.9.3.2

$data = Mage::helper('core')->jsonDecode($this->getRequest()-getPost('data'));
$data['attribute_set_name'] = $helper->stripTags($data['attribute_set_name']);
$model->organizeData($data);


texts: No ID returned for NodeRepository::getList

texts:
In a custom command I'm trying to retrieve the ID of the existing Hierarchy Nodes. In the DB I have 2 rows for the table magento_versionscms_hierarchy_node with ID 1 and 16. But in the code when I call $result = $this->nodeRepository->getList($criteria); with empty criteria ($criteria = $this->criteriaBuilder->create();) the variable $result has 2 items with the values except for the node_id column.

Preconditions

Magento Enterprise Edition version 2.3.0


texts: Modify Product Page layout through Extension

texts:
I am developing a extension and I've to add an icon on images of products having specific tag "app_product". Yes, I know that we can do this task by modifying view.phtml and list.phtml but I think this approach is theme dependent. What I want; when I enable my extension the icon will be appeared and when I disable my extension, the icon must be disappeared. And I've to this task independent of theme. Please help me to figure out this issue.

And Thanks in advance.


texts: How to add login/register form as first step in checkout page of Magento 2?

texts: How to add login/register form as first step in checkout page of Magento 2 ?


texts:
I have created a custom image attribute and I can get this to appear as a Role option.

The problem is roles can only be assigned to a single image and I need an attribute that I can assign to multiple images in order to place the images in certain positions on the front end.

Can this be achieved using image attributes or is there an alternative method for what I need to achieve?

Thanks in advance.


texts: How do I add Product Images as URL instead of uploading them in Magento?

texts:
I am making a fashion store in Magento. I have affiliation with many stores and I don't want to save their product images on my server because of space issue, they require a lots of space more than 30 GB.

I want to add an absolute path for images so I can save space on my server.

Current situation: I need to upload images into Magento folders (/media/... etc.)

Required: I can add any images path for a product

www.imagesss.com/abc/23.jpg,
www.123agesss.com/a13c/2343.jpg,
www.ima1323gesss.com/ab32c/2sdsd33.jpg


texts:
I'm trying to retrieve the current CMS page id in Magento2. Below is the code I used for Magento1.x which obviously doesnt work anymore. But I can not get my head around how to do this for Magento2.

if (Mage::app()->getFrontController()->getRequest()->getRouteName() == 'cms') {
    $_pageId = Mage::getBlockSingleton('cms/page')->getPage()->getPageId();
}

Using the registry as shown below wont work.

 $this->_coreRegistry->registry('cms_page')->getId()


texts: Buy Now button on category page (listing page)

texts:
I want to show "Buy Now" button on listing page i.e. on category page, after click on buy now it will redirect to onepage checkout. I used "

<button onclick="location.href ='<?php echo $this->helper('checkout/cart')->getAddUrl($_product);?>′">Buy It Now</button>

"
It will redirect to cart page but i need to redirect on onepagecheckout.


texts: Why is the theme of Magento 1.9.0 so broken?

texts:
we have a really weird problem with magento frontend. It looks really broken. Some buttons are over other button - like the 2 links at the right top on the main page or that the "to cart"-button is floating over the price...
also another thing: after a reinstallation of magento the description disappiered and we don't know how to bring it back.. (look screenshot)

we didn't change anything on the theme or design, it is like that right after the installation. Is it usually that broken or do we have to care about some special setting befor/while/after the installation??

hope for help!


texts: I want to override model in the Magento 2

texts:
I want to override the Magento\Catalog\Model\Layer\Category\FilterableAttributeList model file.
I have created the module.
This is my di.xml file.

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="Magento\Catalog\Model\Layer\Category\FilterableAttributeList" type="Pos\AdvancedLayeredNavigation\Model\Layer\Category\FilterableAttributeList" />
</config>

This is my model file,

<?php
namespace Pos\AdvancedLayeredNavigation\Model\Layer\Category;
class FilterableAttributeList extends Magento\Catalog\Model\Layer\Category\FilterableAttributeList
{
 public function getList()
    {
     /** @var $collection \Magento\Catalog\Model\ResourceModel\Product\Attribute\Collection */
        $collection = $this->collectionFactory->create();
        $collection->setItemObjectClass(\Magento\Catalog\Model\ResourceModel\Eav\Attribute::class)
            ->addStoreLabel($this->storeManager->getStore()->getId())
            ->setOrder('position', 'DESC');
        $collection = $this->_prepareAttributeCollection($collection);
        $collection->load();

        return $collection;
    }
}

Can you guys help me!!!!
Is there any way to overwrite this file?


texts: How to initialize javascript when the user scrolls?

texts:
I need the javascript to load after the user scrolls. Right now I have a .phtml file that just has this,
<div id="razoyo-gtm-user-code" style="display:none;" data-mage-init='{ "razoyoGlobalUserCode": { "pageType": "<?= $block->escapeJs($block->getPageType()); ?>"} }'>

Which loads razoyoGlobalUserCode as soon as the page is done loading. But I need the file to load after the user scrolls. So I've tried this:
<script>
    var razoyo = document.createElement('div');
    razoyo.id = 'razoyo-gtm-user-code';
    razoyo.style = 'display:none';
    razoyo.setAttribute("data-mage-init", '{ "razoyoTest": { "pageType": "<?= $block->escapeJs($block->getPageType()); ?>"} }');

    document.addEventListener('scroll', function(e) {
    document.head.appendChild(razoyo);
    });
</script>

However this doesnt fix the issue at all. If someone has any advice on what I can do I would appreciate it a lot. Thanks.


texts:
When Quote id generated in magento?

Is it generated:

when customer got registered
or when customer adds product to cart.

I have gone through many article but there is no clearance on it.


texts: How to Checkout Cart Item Section Display in Product Details Page (Popup)?

texts:
I am trying to show Cart page Item details section in Popup on Product Details Page Popup.
Can you please give me any help how to i'll display
(Magento_Checkout/templates/cart/item/default.phtml)
file Data in popup on product details page.
Thanks & Regards.


texts:
Could somebody help me to apply form validation directly in admin html files?
Here is my code for example:

<form method="post" id="commercial_invoice_create_form" name="commercial_invoice_create_form"  action="<?php echo $block->getUrl('adminhtml/commercialinvoice/save',['order_id' => $_order->getId()]);?>"'>
    <?php echo $block->getChildHtml('formkey-ci')?>

        <?php echo __('International Air Waybill Number') ?>

            <input name="airway_billno" id="airway_billno"
            title="International Air Waybill Number" class="input-text  required-entry _required"
            type="text" data-validate="{required:true}" aria-required="true">

    <button id="commercial_invoice_save_button" title="Submit Invoice" type="button" class="action-default scalable action-save action-secondary" data-ui-id="widget-button-0">
        Submit Invoice
    </button>
</form>


texts:
I created a custom module.I want to get the updated details to a front-end page from back-end.

My routes.xml file is - (Ayakil\Bannermanager\etc\frontend)

...
<router id="standard">
    <route id="homebanner" frontName="homebanner">
        <module name="Ayakil_Bannermanager" />
    </route>
</router>
...

Layout file is homebanner_index_index.xml - (Ayakil\Bannermanager\view\frontend\layout)

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">e

    <referenceContainer name="content">
        <block class="Ayakil\Bannermanager\Block\Index\Index" name="homebanner"  template="Ayakil_Bannermanager::bannermanager.phtml" />
    </referenceContainer>

</page>

Template file is bannermanager.phtml - (Ayakil\Bannermanager\view\frontend\templates)

<?php echo $this->getHomepageBanners(); ?>

Block file Index.php - (Ayakil\Bannermanager\Block\Index)

<?php

namespace Ayakil\Bannermanager\Block\Index;

class Index extends \Magento\Framework\View\Element\Template {

protected $_bannersFactory;
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Ayakil\Rewardpoints\Model\BannersFactory $bannersFactory,
array $data = array()
) {
    $this->_bannersFactory = $bannersFactory;
    parent::__construct($context, $data);
}

protected function _prepareLayout()
{
    return parent::_prepareLayout();
}

public function getHomepageBanners(){

    $Banners = $this->_bannersFactory->create();
    $collection = $Banners->getCollection();
    $collection->addFieldToFilter('banner_location',1);
    $collection->addFieldToFilter('banner_active',1);

    return $collection->setOrder('id','DESC');
}//End of function getHomepageBanners
}//End of class

Controller file Index.php - (\Ayakil\Bannermanager\Controller\Index)

<?php
namespace Ayakil\Bannermanager\Controller\Index;

use Magento\Framework\View\Result\PageFactory;

use Magento\Framework\App\Action\Context;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $_resultPageFactory;

    public function __construct(Context $context, PageFactory $resultPageFactory)
    {
        $this->_resultPageFactory = $resultPageFactory;
        parent::__construct($context);
    }

    public function execute()
    {
        $resultPage = $this->_resultPageFactory->create();

        return $resultPage;
    }
}

Here i if i type the url its comes to controller, but block file is not reaching.What is my issue in my layout file?

UPDATE

I am getting this error in system.log file

  [2017-10-31 06:09:36] main.INFO: Cache file with merged layout: LAYOUT_frontend_STORE1_49616ea6e172f105633873ece31b228de and handles default, homebanner_index_index: Please correct the XML data and try again.  [] []