texts: Search by Categories is not giving accurate result. how to solve?

texts:
I have a problem with our search on front page of our website. It is not showing the correct result.

For ex: I search Reebok Shoes, it searched lot of thing related and unrelated, but didn't find the product I was expecting.

I made sure all the words are existing.

All products are enables.
Re-indexing is done.
All Categories is Is Anchor->'yes'.
Search type is Combine(Like and Fulltext).

What is this issue and can it be fixed. Can I need to make a module for search by categories?

What i found is:

I find that i need to add some code in Mage -> CatalogSearch -> Layer
I didn't get in which function i need to add, someone help please.
I need to add in prepareproductcollection. The code is not calling the category box.

I am looking for a code which can call category name from select option.


texts: Error when getting value form registry in magento2

texts:
I have follow link to get registry

It's working fine when i getting value of normal input filed but it's throwing error when i am apply for image or wysiwyg component:

form.xml

            <field name="default_image">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="visible" xsi:type="boolean">true</item>
                        <item name="formElement" xsi:type="string">input</item>
                        <item name="elementTmpl" xsi:type="string">Ktpl_BannerManagement/form/element/defaultTemplate</item>
                    </item>
                </argument>
            </field>
      <!--        <field name="content" template="ui/form/field" sortOrder="50" formElement="wysiwyg">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="wysiwygConfigData" xsi:type="array">
                            <item name="height" xsi:type="string">100px</item>
                            <item name="add_variables" xsi:type="boolean">false</item>
                            <item name="add_widgets" xsi:type="boolean">false</item>
                            <item name="add_images" xsi:type="boolean">true</item>
                            <item name="add_directives" xsi:type="boolean">true</item>
                        </item>
                    </item>
                </argument>
                <settings>
                    <dataScope>content</dataScope>
                </settings>
                <formElements>
                    <wysiwyg>
                        <settings>
                            <rows>8</rows>
                            <wysiwyg>true</wysiwyg>
                        </settings>
                    </wysiwyg>
                </formElements>
            </field> -->
            <field formElement="imageUploader" name="image">
                <argument name="data" xsi:type="array">
                    <item name="config" xsi:type="array">
                        <item name="source" xsi:type="string">general</item>
                    </item>
                </argument>
                  <settings>
                    <elementTmpl>ui/form/element/uploader/image</elementTmpl>
                    <dataType>string</dataType>
                    <label translate="true">Upload File</label>
                    <visible>true</visible>
                    <required>false</required>
                </settings>
                <formElements>
                    <imageUploader>
                        <settings>
                            <required>false</required>
                            <uploaderConfig>
                                <param xsi:type="url" name="url" path="bannermanagement/image/save"/>
                            </uploaderConfig>
                            <allowedExtensions>jpg jpeg gif png ico apng avi MTS M2TS mov qt wmv mp4</allowedExtensions>
                            <maxFileSize>4194304</maxFileSize>
                        </settings>
                    </imageUploader>
                </formElements>
            </field>

element.js

        var field1 = uiRegistry.get('banner_form.areas.general.general.default_template');
        var field2 = uiRegistry.get('banner_form.areas.general.general.default_image');

        var field4 = uiRegistry.get('banner_form.areas.general.general.image');

i am getting value of field1 and field1 but not field4.

field4 giving me undefined


texts: Magento 2 JSON.parse: unexpected non-whitespace | and  tag in json after json response in every APIs

texts:
show JSON.parse: unexpected non-whitespace | and  tag in json after json response in every APIs;

And

tag is appending after tag in all front end and admin pages and also in ajax response

][send image is here]


texts: Magento 2.3.3 The "https://repo.magento.com/packages.json" file could not be downloaded:

texts:
I want to install a plugin, but the readiness check gives the next error

Check Component Dependency
We found conflicting component dependencies.

Command "require" failed:
In RemoteFilesystem.php line 559:

The "https://repo.magento.com/packages.json" file could not be downloaded:
SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify
failed
Failed to enable crypto
failed to open stream: operation failed

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>...]

I'm using Magento 2.3.3.

Has someone a solution?


texts: How can I change phone number label to Mobile number in Checkout Page;Magento2

texts: I need to change Phone number label into Mobile number label which is  present under Shipping address in Checkout Page.Please suggest me how to do it.Thanks in advance.


texts:
In the configuration I've enabled the editor: Enable WYSIWYG Editor = "Enabled by Default"
Is it possible, that the Editor is open when I start edit products without click on the button and open it in the box?


texts: Magento 2 : when does "sales_order_creditmemo_save_after" event triggers?

texts:
When i open "View memo" page & click on "Refund Offline" then & then the
Magento2/vendor/magento/module-customer-balance/Observer/CreditmemoSaveAfterObserver.php triggers.
I am not sure as by its name its confusing, because how can it trigger when i did not even created memo just initiated.
Any thoughts on this ?


texts: Add a static block through xml to a specific cms_page?

texts:
From a previous question I learned how to add some static blocks to the CMS homepage like this: how to achieve this 2 columns page layout?

The xml is created in:

app/design/frontend/<Vendor>/<theme>/Magento_Cms/layout/cms_index_index.xml

Now if I want to have the same for other new created CMS page how to achieve that?

What would be the name for the xml file? I have tried things like cms_contact_contact.xml but that did not work?

Any suggestions?


texts: Is it possible to copy all customer related data migrate to another magento 2 database?

texts:
I want to know how I can copy only customer related data

  to another Magento 2 database

If it is possible then what are the tables that I can copy to
the second DB

Magento ver 2.2.6


texts: Magento 2 get transaction status from Braintree

texts:
I transaction state is not getting updated at Magento when it changes at Braintree. I manually want to get the transaction status from Braintree but unable to call the Braintree method in my custom module.
Any sugesstion how can I call Braintree method and get the status of transaction?

$gateway->transaction()->search([
  Braintree_TransactionSearch::status()->is(Braintree_Transaction::SETTLED)
]);

I want to call this method.


texts: Excess qty adding into cart when adding product in cart with custom option programmatically

texts:
I am using this the following code to add a product in cart with custom option value. But all the time cart qty taking the value of  "Maximum Qty Allowed in Shopping Cart" and then adding 1. For example if the  Maximum Qty Allowed in Shopping Cart value is 10, then qty in cart taken 11 and the giving the warning "The requested qty exceeds the maximum qty allowed in shopping cart". I am using the following code.

$gproductId = 16213;
            $product = $objectManager->create('\Magento\Catalog\Model\Product')->load($gproductId);
            $cart = $objectManager->create('Magento\Checkout\Model\Cart');
            $formKey = $objectManager->create('\Magento\Framework\Data\Form\FormKey')->getFormKey();
            $option = array('49064'=>'865759');

            $params = array(
            'form_key' => $formKey,
            'product' => $gproductId, //product Id
            'item' => $gproductId, //product Id
            'qty'   =>0, //quantity of product
            'options' => $option,
            'allow_partial_payment' => 0
            );

            // echo "<pre>"; print_r($params); die();
             try {
             $cart->addProduct($gproductId, $params);
             $cart->save();
            }  catch (\Exception $e) {
                echo $e->getMessage();

            }

Please let me know if you have any solution for this problem.


texts: updating the price for cart item give error

texts:
i am updating the cart after user login for that

Error

  Fatal error: Call to a member function getStoreId() on null in
  /opt/lampp/htdocs/instantsearch/app/code/core/Mage/Sales/Model/Quote/Item/Abstract.php
  on line 81

Code

foreach ($items->getAllItems() as $item) {
  $product_id = $item->getProductId();
  $customprice = 50;
  if ($customprice > 0)
      {
       $item= Mage::getModel('sales/quote_item')->load($item->getId());
       $item->setCustomPrice($customprice);
       $item->setOriginalCustomPrice($customprice);
       $item->save();
      }
    }


texts:
Are there any extensions which can do the following:

Customer subscribe to a product at $300, customer enter the desire amount (eg $200) if the product falls below $200, customer will get notification email.


texts: Display custom image in admin edit form magento 2

texts:
How do i display custom image only in admin edit form .. But dont want choose file button

code:

 $fieldset->addField(
                'file_path','image', [
                    'name' => 'file_path',
                    'label' => __('Logo Image'),
                    'title' => __('Logo Image'),
                    'renderer'  => 'Vendor\Module\Block\Adminhtml\Quotation\Renderer\LogoImage',
                ]
            );


texts:
I am getting this error in checkout. Below the Shipping Address form, Shipping Methods is stucked on loading. In console it says:

JSON.parse: unexpected keyword at line 1 column 1 of the JSON data

process http://localhost/magento2/pub/static/frontend/Magento/luma/en_US/Magento_Checkout/js/model/error-processor.js:19
getRates   http://localhost/magento2/pub/static/frontend/Magento/luma/en_US/Magento_Checkout/js/model/shipping-rate-processor/new-address.js:65

But, when I check there is even no model folder created under http://localhost/magento2/pub/static/frontend/Magento/luma/en_US/Magento_Checkout/js

I cleared cache and deployed static content, but it's still the same.


texts: Magento 2: Getting Error When Adding Customer Address Attribute

texts:
I'm using Magento 2.2.3, i need to add Customer Address Attribute, but when i run setup:upgrade I'm getting error of Wrong Entity ID.

Here is My code:
CustomerAddress\Attribute\Setup\InstallData.php

<?php

namespace CustomerAddress\Attribute\Setup;

use Magento\Eav\Model\Config;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Entity\Attribute\SetFactory as AttributeSetFactory;

class InstallData implements InstallDataInterface
{
    /**
     * @var Config
     */
    private $eavConfig;

     /**
     * @var EavSetupFactory
     */
    private $_eavSetupFactory;

    /**
     * @var AttributeSetFactory
     */
    private $attributeSetFactory;

    /**
     * @param Config $eavConfig
     * @param EavSetupFactory $eavSetupFactory
     * @param AttributeSetFactory $attributeSetFactory
     */
    public function __construct(
        Config $eavConfig,
        EavSetupFactory $eavSetupFactory,
        AttributeSetFactory $attributeSetFactory
    ) {
        $this->eavConfig            = $eavConfig;
        $this->_eavSetupFactory     = $eavSetupFactory;
        $this->attributeSetFactory  = $attributeSetFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $setup->startSetup();

        $eavSetup = $this->_eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute('customer_tax_exempt_number_', 'custom_address_attribute', [
            'type' => 'varchar',
            'input' => 'text',
            'label' => 'Customer Tax Exempt Number',
            'visible' => true,
            'required' => false,
            'user_defined' => true,
            'system'=> false,
            'group'=> 'General',
            'global' => true,
            'visible_on_front' => true,
        ]);

        $customAttribute = $this->eavConfig->getAttribute('customer_tax_exempt_number', 'custom_address_attribute');

        $customAttribute->setData(
            'used_in_forms',
            ['adminhtml_customer_address','customer_address_edit','customer_register_address'] //list of forms where you want to display the custom attribute
        );
        $customAttribute->save();

        $setup->endSetup();
    }
}


texts: Writing code to interface with another system

texts:
I'm building a magento store which needs to interface with another system and I could use some guidance.

Although not particularly relevant, I'm communicating with the 'other' system using web services (it's on another server) but what I need help with is finding the places where I need to put in code to do what I want.

There are three major functions that I need to implement:-

When a user clicks on the product detail page I need to make a call to check the stock levels on the other system, update (if changed) the magento stock levels and THEN display the product detail page.
When a sale is completed, I need to send details of that sale to the other system.
When a new product is added I need to communicate with the other system.  This may be a bit more complex because there are a few checks I need to do during the 'add product' process, for example, check the SKU is valid, that the product doesn't already exist on the other system, etc.  I think until I start coding this I shan't realise the full extent of this functionality!

Any guidance gratefully received!  Although I'm very experienced with programming, web , PHP, etc. my Magento experience is fairly limited.


texts: Workaround for CookieManager not being use the first time the session cookie PHPSESSID is set

texts:
I've upgraded a magento 2 store to the latest version and i'm running into this issue:
CookieManager is not used the first time the session cookie PHPSESSID is set #27531:
https://github.com/magento/magento2/issues/27531
The store uses a custom cookie to store first-visit information. Due to the issue described above I have an issue when productdetail pages are opened directly through google because the cookiemanager is not used on the first visit, and the detail pages is where I use the cookie info. When people come in through the home url it's not an issue because the product detail page is not the first page they visit.
I can't figure out a way to work around it until it's fixed. I've tried setting the cookie twice but this is not resolving the issue. Any help or insights into a fix are greatly appreciated.


texts: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'project.search_tmp_6093bb27b463b7_50091618' doesn't exist in Magento2

texts:
I am getting this error in system.log and I think is affecting website performance. I am not sure how to fix it. Would anyone help me fix the problem?
[2021-05-06 09:51:15] main.ERROR: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'project.search_tmp_6093bb27b463b7_50091618' doesn't exist, query was: SELECT `e`.*, `cat_index`.`position` AS `cat_index_position`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `at_bestsellers`.`qty_ordered` AS `bestsellers`, `at_most_viewed`.`views_num` AS `most_viewed`, IFNULL(review_summary.reviews_count, 0) AS `reviews_count`, IFNULL(review_summary.rating_summary, 0) AS `rating_summary`, `stock_status_index`.`stock_status` AS `is_salable` FROM `catalog_product_entity` AS `e`
 INNER JOIN `catalog_category_product_index_store2` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id=2 AND cat_index.visibility IN(2, 4) AND cat_index.category_id=48
 INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '2' AND price_index.customer_group_id = 0
 LEFT JOIN `amasty_sorting_bestsellers` AS `at_bestsellers` ON (at_bestsellers.`product_id`=e.entity_id) AND (at_bestsellers.store_id = '2')
 LEFT JOIN `amasty_sorting_most_viewed` AS `at_most_viewed` ON (at_most_viewed.`product_id`=e.entity_id) AND (at_most_viewed.store_id = '2')
 LEFT JOIN `review_entity_summary` AS `review_summary` ON e.entity_id = review_summary.entity_pk_value AND review_summary.store_id = 2 AND review_summary.entity_type = (SELECT `review_entity`.`entity_id` FROM `review_entity` WHERE (entity_code = 'product'))
 INNER JOIN `cataloginventory_stock_status` AS `stock_status_index` ON e.entity_id = stock_status_index.product_id
 INNER JOIN `search_tmp_6093bb27b463b7_50091618` AS `search_result` ON e.entity_id = search_result.entity_id WHERE (e.entity_id IN((SELECT `cat`.`product_id` FROM `catalog_category_product_index_store2` AS `cat` WHERE (cat.category_id IN('69', '62', '68', '58', '54', '93', '52', '98', '56', '49', '99'))))) AND (stock_status_index.stock_status = 1) ORDER BY `e`.`created_at` DESC, `at_bestsellers`.`qty_ordered` DESC, `at_most_viewed`.`views_num` DESC, `e`.`entity_id` DESC
 LIMIT 12 [] []

Please suggest if anyone can help.
Thanks.


texts: Magento v1.9 cmd line sql query to find certain scenarios backorder out of stock

texts:
I have a real odd issue
Magento v1.9.4.5
I have a ton like thousands of products that are set to back order allowed
However they also say out of stock
I need help I not sql expert
I need a sql query that i can run via cmd line ssh sql that will list all products which backorder are enabled
Then another to list those which backorder enabled and are out of stock
Then Lastly to prove fix one that list backorder enabled and are in stock :)
Thanks


texts: Magento 2.3 Custom Rest Api get size limit

texts:
I have made custom API which returns the categories with the products in them like this:
array(
key: Category name
values:product1,product2,...productX
(

where product is an array:
array(id,price,name,etc)

This was working ok until there were more categories and products. It can still return some small categories meaning with less products but there is a parent category for example which has 3 children categories with 500 products each.
And my question is: Is there a limit somewhere on magento or on the server on the GET call ?


texts:
I want to create an autocomplete input for city in onepagecheckout, and registration form.

I've a database table with all my data and I've a function php tha give me the json that look like this

[{"comune":"Santa Brigida","provincia":"Bergamo","cap":"24014"}, {...},{...}]

In my php code I create a filter like this

 $comuniItaliani= Mage::getModel('comuniItaliani/comuniItaliani')->getCollection()->addFieldToFilter('comune', array('like' => $comuneCode.' %'));

But in this way the filter works only if a word is complete, i want to filter when the word start form:

ex. If I refer to the piece of json written obove:

> If I filter for "Santa" it work perfectly and gives me "Santa Brigida"
but I want it to work even with "san" or "sant"


texts: Possible useless methods overriding magento2

texts:
This is a grid collection file.
In this i didn't get any grid issues.
According to CodingStandard it shows this warning:

----------------------------------------------------------------------
 32 | WARNING | Possible useless method overriding detected
----------------------------------------------------------------------

The warning shows from this line.

$resourceModel = \Companyname\Wallet\Model\ResourceModel\Order::class

which I declared inside the constructor.

<?php
namespace Companyname\Wallet\Model\ResourceModel\Order\Grid;

use Magento\Customer\Ui\Component\DataProvider\Document;
use Magento\Framework\Data\Collection\Db\FetchStrategyInterface as FetchStrategy;
use Magento\Framework\Data\Collection\EntityFactoryInterface as EntityFactory;
use Magento\Framework\Event\ManagerInterface as EventManager;
use Psr\Log\LoggerInterface as Logger;

class Collection extends \Magento\Framework\View\Element\UiComponent\DataProvider\SearchResult
{
    public function __construct(
        EntityFactory $entityFactory,
        Logger $logger,
        FetchStrategy $fetchStrategy,
        EventManager $eventManager,
        $mainTable = 'sales_order_grid',
        $resourceModel = \Companyname\Wallet\Model\ResourceModel\Order::class
    ) {
        parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $mainTable, $resourceModel);
    }

    public function _renderFiltersBefore()
    {
        $this->addFieldToFilter('is_wallet_quote', 1);
        return $this;
    }
}

Anyone facing this issue and anyone knows alternative method for this?

Thanks in Advance.


texts: Payment method with custom form in Knockout js

texts:
I've created a custom payment method successfully in Magento2. When this custom payment method selected, I need a form to display a text field and submit button that will hit some AJAX Api's using in controller and then show a pop-up based on result API response.

Here is my knockout js file:

RLTS/Custompayment/view/frontend/web/js/view/payment/method-renderer/mycustompayment.js

define(
    [
        'Magento_Checkout/js/view/payment/default',
        'Magento_Ui/js/form/form'
    ],
    function (Component) {
        'use strict';

        return Component.extend({
            defaults: {
                template: 'RLTS_Custompayment/payment/mycustompayment'
            },
            initialize: function () {
                this._super();
                return this;
            },
            onSubmit : function () {
                var formData = this.source.get(this.getCode() + '-form' );
                var formField = this.source.get('customformfield');
                console.log(formData);
                console.log(formField);
            }
        });
    }
);

And I added my form in ko template as follow:

        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>

            <form id="custom-checkout-form" class="form" data-bind="attr: {'id': getCode() + '-form' , 'data-hasrequired': $t('* Required Fields')}">
                <input type="text" class="input-text" name="customformfield" placeholder="Custom Form Field" />
                 <button type="reset">

                </button>
                <button type="button" data-bind="click: onSubmit" class="action">

                </button>
            </form>

                <button class="action primary checkout"
                        type="submit"
                        data-bind="
                        click: placeOrder,
                        attr: {title: $t('Place Order')},
                        css: {disabled: !isPlaceOrderActionAllowed()},
                        enable: (getCode() == isChecked())
                        "
                        disabled>

                </button>

Without using form, my payment method is working perfectly fine. How to add custom form and process Ajax calls for it before placing order?


texts: Magento 2.3.4: Buttons do not have an accessible name

texts: web.dev reports an issue that "buttons do not have an accessible name" on the catalog pages. The catalog page appears to only have Add to Wishlist and Add to Cart buttons. How do I fix this when I am using a custom theme? Screenshot below to help you see the only buttons present on the catalog page.


texts: How to change category product position in database

texts:
I want to change the position value of the category product tab in the category page from 0 to 2. When the newly created product is created, its default position value was 0.

This is my progress as off now.

Category ID is 218

I already found the position attribute_id = 53

  SELECT * FROM eav_attribute WHERE frontend_label = 'Position';

I want to change all the position value of the specific category.

What tables do I need to look at?


texts: How to set data for custom attribute in foreach loop Magento 2?

texts:
I need to set data for custom attribute in foreach loop.My code is here. which is in foreach loop.

 echo "".$attribute.""."
";
 echo $value."
";

$attrs = $product->getResource()->getAttribute($attribute); //warrant
$veYstorage = $value;
$avisstorage = $attrs->getSource()->getOptionId($veYstorage); //name in Default Store View
$product->setData($attribute, $avisstorage);

Fatal error: Uncaught Error: Call to a member function getSource() on boolean in E:\xampp7.0


texts: Problem with soap:address location in WSDL file

texts:
So I've got a problem that I tought was solved two weeks ago :

The reference for the soap:address location value in my XML WSDL file is wrong and it keeps changing over time because I solved the problem but today the URL was wrong again.

I don't know how I solved it the other time because I discovered it 3 days later. Maybe by clearing the caches but this today and the XMl hasn't changed.

Here is the format of the wrong URL (actual one) : "http://host/4c-multi/index.php/api/v2_soap/index/?SID=aaqi0ge6jrh1sfs1vsg6f6ofk4"

The working URL (referenced by magic two weeks ago but then changed) :
"http://host/4c-multi/index.php/api/v2_soap/index/"

It bothers me because my old projects (referenced to the good WSDL file) still work but not if I refresh the Web service reference.

Thank you for your help.


texts:
I need to upgrade a Magento store from 1.3.1 to the latest version of Magento (1.9.1). Can anybody point me in the right direction on the best way to do this.

Are there certain versions numbers you need to upgrade to due to major changes or can I upgrade directly to 1.9.1?

Any help would be great!


texts: Magento 2: "Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider"

texts:
My Magento 2 development environment has started poking me with the following error message

  Your web server is set up incorrectly and allows unauthorized access to sensitive files. Please contact your hosting provider

Has anyone tracked down

What security checks are happening?
Where in the core code these checks happen?


texts:
I'm working in a custom payment module and I created an authorize transaction using my payment api.
How can I capture this payment from admin panel in the order ?
I can't see the button to capture payment in the admin panel.
In Magento 1.9.x I can do the capture in the invoice of order, in the button "Capture online". How can I do this in Magento 2.3.x ?


texts: Exclude breadcrumbs from cache on product page

texts:
I need to exclude a breadcrumbs block from cache on product page.

But I can't use cacheable="false" construction because the whole page will be excluded from cache.

Also I can't use _isScopePrivate because it's deprecated.

I'm looking at this article on magento docs and trying to create getIdentities method in the breadcrumbs block but still that block always in the cache anyway.
Magento version - 2.2.2
I'm using varnish cache, don't know if approach is different from FPC in this case.

Can someone help?


texts:
I wanna build up an e-commerce site using magento 2 with zero cost.

Is there, any website where I can get free domain and free hosting. And it will give access me to use softaculas installer to install software free?


texts: how to change meta title and meta description in after filter of category page

texts:
I want to change category page after filter opens any page and change Title, MetaTitle, MetaDescription in after search result.

What can I do ..and any observer this possible ?


texts: Magento 2: Required parameter 'theme_dir' was not passed

texts:
I have installed the following module:

  https://landofcoder.com/magento-2-out-of-stock-notification.html

It works like it's supposed to but getting an error.

When looking inside the module i see it tries to do the following when trying to send a notification email:

$alertGrid = $this->_appState->emulateAreaCode(
        \Magento\Framework\App\Area::AREA_FRONTEND,
        [$block, 'toHtml']
    );

It does this for each website that has enabled the product notification (and if a product comes back in stock)

I have 3 websites in one magento 2 installation. Each has it's own theme completely different than the other. lets call them theme 1 till theme 3.

When it tries to send a notification email for the website with theme 1, i already get the exception:

Required parameter 'theme_dir' was not passed.

This gets catched and will try to send the email for  the websites withtheme 2 and theme 3.

Only the first theme fails and gives me the error.

Any idea which could be the problem? I tried to look in the theme table. but everything looks fine, path and everything. The theme works when i navigate to the website.

I will keep this updated.

Update 1

I have found the problem. It is storeview related.

The $block variable is based on storeid, it doesn't work with my storeId 1 (english). But when i hardcoded it to my storeview id 2 (dutch). It works. Any idea why it only happens with my default store id?

The block variable is build like this:

  $this->_getStockBlock()->setStore($store)->reset();
        foreach ($this->_stockProducts as $product) {
            $this->_getStockBlock()->addProduct($product);
        }
        $block = $this->_getStockBlock();
        $templateId = $this->_scopeConfig->getValue(
            self::XML_PATH_EMAIL_STOCK_TEMPLATE,
            \Magento\Store\Model\ScopeInterface::SCOPE_STORE,
            $storeId
        );


texts: How to add a filter to products grid programmatically?

texts:
I've created an EAV attribute and I want to add a filter to products grid, like:

Could someone tell me what steps I have to do to solve it?


texts: How to get top parent Category from current category object?

texts:
How can I get the top level parent category (just after Default Category) from current category object? I want the Category Name and Category URL of that parent category to show in the subcategories.

Default Category

Cat A

Cat B

Cat C

How can I get Cat A's Name and URL in Cat B and Cat C objects?


texts: How to get Newsletter form shown in footer block?

texts:
I'm new to Magento. I'm using Magento 2 Community Edition and I'm trying to get the newsletter subscriber form in the footer, but for some reason, it doesn't appear.

How should I do that?


texts:
I understand that Magento 2 if you enable MAP then the product price doesn't display on the frontend.
I need both msrp and price to be displayed on the frontend, for product list page, product page so I'm looking to see if anyone has a solution for this.
I can add a msrp and regular price in the admin.
Can anyone advise me please?
Many Thanks in Advance

Andy.

Would there be any implications if I created a 'custom_msrp' attribute for the product msrp?
I'm thinking I could do this and then use an if statement in the frontend to display the new attribute value if it was other than null.

Any thoughts?
Thanks


texts: Rich Snippets Weltpixel | Hide "price" and "in stock" in Google Search Results | Magento 2.4.1 CE

texts: We installed the extension Weltpixel "Rich Snippets" (freeware) in our Magento Shop vers. 2.4.1 CE and we want to hide / disable / remove the "price" and "in stock" in the Google search results (content and image search). Do you have a tutorial / solution for this? Thank you!


texts: Multi Store - Multi User solution needed

texts:
I am looking for an extension/other kind of solution that would allow

Upon registration, for users to create a sub-store. (Or allow a parent-store admin to deploy a sub store on behalf of the user). The sub-store would need to be on a different domain.
The sub-store would have all (or part) of the products in the parent-store. If choosing specific products is difficult, then all products is acceptable.
Registered users can only access their sub store. See orders and customers only within and for their own sub-store
Users can modify some content in their sub store (about us, contact us, front page header, slide/banner should be changed etc).
Payments: Option 1: Payment gateway separate for each sub store (different Paypal email, pay by bank transfer to a different account etc). Option 2 (less preferred): Payment gateway the same across all sub-stores and goes to the same account.
Regardless of the payment option, each sub store would have multiple currencies available.
Products in the sub-store are the same as the main store but with an increase cost (by applying a margin as a global percentage e.g. everything is 35% more expensive than the main store etc).
Specific pricing can be set on a product by product basis (nice to have feature but not a must).
Shipping - no special requirement. Shipping for all sub-stores will be done from a central warehouse in Asia.
Emailing customers will be done from the domain of the sub-store.
The user cannot alter their sub-store aside from defining content, payment gateway and setting the margin.

Can anyone help with an idea?


texts: Magento - Uncaught ReferenceError: billing is not defined

texts:
Upon hitting continue on the shipping method step, it won't allow me to proceed further to "Billing" step. I have previously rearranged this order so that the order is shipping->shippingmethod->billing information->payment information->order review but this issue had occurred before too (would not proceed beyond billing step).

I have looked around and can't seem to fix this issue that I am having on my Magento website. This is the error:

  Uncaught ReferenceError: billing is not defined(anonymous function) @ (index):638

When I click into the javascript source error, this is highlighted:

billing.onSave = function(evt){
    new Ajax.Updater('onepage-checkout-shipping-method-additional-load', 'http://dev.vaughanflowers.com/index.php/checkout/onepage/getAdditional/', {onSuccess: function() {
          this.nextStep(evt);
    }.bind(this), evalScripts:true});
}.bindAsEventListener(billing);

I have compared and ensure that the billing in my core files are consistent with the billing.phtml in my theme persistent folder but that is all. I have seen very little articles on this error and in my case, the theme does not provide this file so I am assuming it's calling the core template file instead:

  app\design\frontend\base\ {interface} \ {theme} \template\checkout\onepage\billing.phtml

This is the URL of the checkout (Hope this helps): http://dev.vaughanflowers.com/index.php/checkout/onepage/


texts: Is it possible to run commands for the Magento in xampp from another device?

texts:
My colleague installed Magento in xampp on his system and I can browse the site frontend and backend on my system using his system IP.

Is it possible to develop and run commands in my system though he installed the Magento on his system?

Could anyone please guide me?


texts:
I have a custom form which I have made and want to  display within the magento default theme (for now, until create specific css for it). To do this I have set out to try and understand magento's layouts, I've read this and this as well as a couple of other pages to try and learn the basics before I dive in, but the articles seems really unhelpful (or am I missing some nuggets of quality information?). So I had a look around at the layout files that come with magento to try and learn from them, the goal being, work out what handles I need to use. IVE FAILED, hence this question.

How do I add my form in to a Magento theme?

indexController.php

$this->loadLayout('handle_name')->renderLayout();

module/modulename.xml

<handle_form>
    <block type="core/template" name="the_form" output="toHtml" template="ps/prefcentre/signup.phtml" />
</handle_form>

I realise the above will only render the form but how do I create this file to render a default layout around it.

Ive tried so many different options i've lost track of what ive done. From what I have read I first assumed that the default tags held within other .xml files would cause the basic template to load.

I know once I have got this I will be able to learn how to use the layouts, I'm so stuck on this point.


texts: magento 2 Communication link failure:1047 WSREP has not yet prepared

texts: I am getting a strange error Communication link failure:1047 WSREP has not yet prepared. Can you guys please help me out.


texts: Magento 2 : Change Order # Formatting for M2 Orders

texts:
I am trying to implement feature that Orders placed on M2 should start with a ' 3 ' instead of a ' 2 '
This will help me with easily identifying new orders while we move test orders to production and for post live tracking.
What would be the most convenient method to do so programmatically, following by best practice ?


texts:
When using jquery .change on an input the event will only be fired when the input loses focus

In my case, I need to make a call to the service (check if value is valid or empty) as soon as the input value is changed. How could I accomplish this? this validation for without using submit event.


texts: how to debug 'page not rendering' in magento 2- possible problem with the xml

texts:
How do you debug a page in a custom module. or more to the point. How do you debug whether the xml is rending the correct page content.

I am trying to create a page in my custom module, I am able to create the page but its content is blank.

I believe that the problem relates to the xml because if I do a vardump on the controller it renders an output. this means that the problem relates to the xml output.

below are my files-- I would really appriate any advice on how I can go out debugging the problem.

=> Block :

namespace Lsg\Authunpw\Block;

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

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,

        array $data = []
    ) {
        parent::__construct($context, $data);
    //    $this->_postCollectionFactory = $postCollectionFactory;
    }

    public function getIdentities()
    {
        return [\Lsg\Authunpw\Model\Customer::CACHE_TAG . '_' . 'list'];
    }

}

Fronend xml :

  Lsg\Authunpw\etc\frontend\routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="auths" frontName="auths">
            <module name="Lsg_Authunpw" />
        </route>
    </router>
</config>

Frontend view :

  authunpw_index_index.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="Lsg\Authunpw\Block\PostList" name="auths.list" template="Lsg_Authunpw::list.phtml" />
        </referenceContainer>
    </body>
</page>


texts: Simulate click and set guest in checkout/onepage/ (skipping first step)

texts:
I was wondering, can we (and how) emulate a click and set guest in checkout/onepage/ (skipping first step)

Ofcourse there is a plugin, but we have had some bad experiences with this (Crius skipstep) working on and off (and related to responsive theme)

Ideally: could we keep first step, but directly onload emulate a SET TO GUEST and CLICK NEXT

Thx!


texts: Apply discount from existing order total in admin order page

texts:
is there any module that I can subtract the amount that I want to discount from the order totals?

How to apply discount on order page?
I need to apply discount manually in admin order page.


texts: Magento 2 | Reindex very slow in local server

texts:
On my server with:
MariaDB 10.4
PHP 7.4
Elasticsearch 7.9.1
Elasticsuite 2.10.0
I am trying to relaunch the full reindex for Magento2 but I have seen that catalog_category_product is very slow, its reindex time is 16 minutes (On my online server it is only 2 minutes).
When the reindex arrives on catalogsearch_fulltext the system is even slower and seems to never end.
The question is: How can I increase the speed of the reindex? Do I need to increase some PHP or MySQL values or is the problem due to Elasticsearch?


texts: Get Tether to Load Before Bootstrap (v4) Using Requirejs in Magento2

texts:
To use the tooltip component in Bootstrap 4 you need to include tether.

I have tried to do this using the recommended RequireJs method in Magento2, but am not having much luck.

In my requirejs-config.js I have the following:

var config = {
    paths:  {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
    },
    "shim": {
        "tether": ["jquery"],
        "bootstrap": ["tether", "jquery"]
    }
};

So, the idea is that I am using shim to make sure bootstrap has a dependency on tether.

I then use the following to use the tooltips:

define(['jquery','tether','bootstrap','domReady!'], function ($) {
    'use strict';
    $(function() {
        $('[data-toggle="tooltip"]').tooltip()
    });
});

The end result is that I get a JavaScript error:

  "Error: Bootstrap tooltips require Tether
  (http://github.hubspot.com/tether/)"

I have tried many things based on some Google searching and have tried the following combinations:

var config = {
    paths:  {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
    },
    "shim": {
        "tether": ["jquery"],
        "bootstrap": ["tether", "jquery"]
    },
    deps: ["js/bootstrap/tether.min"]
};

var config = {
    paths:  {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
    },
    "shim": {
        "js/bootstrap/tether.min": ["jquery"],
        "js/bootstrap/bootstrap.min": ["js/bootstrap/tether.min", "jquery"]
    }
};

define(['jquery','bootstrap','domReady!'], function ($) {
    'use strict';
    $(function() {
        $('[data-toggle="tooltip"]').tooltip()
    });
});

Not sure if anyone has come across this, but if anyone knows what I am missing or not adding it would be massively appreciated.


texts: Magento 2 UI component- Element argument is not allowed here

texts:
After upgrade to Magento 2, in IDE PhpStorm, the UI component file show a lot of errors , like Element argument is not allowed here, Element xxx is not allowed here etc.

But, the UI component file is working well in system. And the official UI component file also has the errors. Like cms_block_listing.xml:

How to fix it?


texts: How to change the URL on menu selection?

texts:
Iam working on magento 1.9 theme

When i make a menu selection of " Jewellery " , the url shown is http://192.168.1.99/in/index.php/sports.html
instead of
http://192.168.1.99/in/index.php/jewellery.html
The case is same while selecting submenus also, its shown as http://192.168.1.99/in/index.php/sports/submenu.html

Can anyone tell me from where i can make the corresponding changes, so that each menu when selected will give their respective URL.


texts: Problem with custom payment module magento2

texts:
we are developing a payment gateway module for Magento 2.X but we have trouble figuring out why it is not working. We think maybe the /etc/di.xml file is not correct:

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<virtualType name="Girosolution\Girocheckout\Block\Form\Girocheckoutmethod\Default" type="Magento\Girocheckout\Block\Form" shared="false">
    <arguments>
        <argument name="data" xsi:type="array">
            <item name="template" xsi:type="string">Girosolution_Girocheckout::form/paymentmethod/default.phtml</item>
        </argument>
    </arguments>
</virtualType>

<virtualType name="GirosolutionCommandPool" type="Magento\Payment\Gateway\Command\CommandPool">
    <arguments>
        <argument name="commands" xsi:type="array">
            <item name="giropay_sale" xsi:type="string">Girosolution\Girocheckout\Gateway\Giropay\Command\SaleCommand</item>
        </argument>
    </arguments>
</virtualType>

<virtualType name="GirosolutionCommandManager" type="Magento\Payment\Gateway\Command\CommandManager">
    <arguments>
        <argument name="commandPool" xsi:type="object">GirosolutionCommandPool</argument>
    </arguments>
</virtualType>

<type name="Magento\Payment\Gateway\Command\CommandManagerPool">
    <arguments>
        <argument name="executors" xsi:type="array">
            <item name="girosolution" xsi:type="string">GirosolutionCommandManager</item>
        </argument>
    </arguments>
</type>

Then we have the file app\code\Girosolution\Girocheckout\Gateway\Giropay\Command\SaleCommand.php but the function execute() is never triggered when the customer try to pay with our payment method giropay. The code is:

namespace Girosolution\Girocheckout\Gateway\Giropay\Command;
use Magento\Payment\Gateway\Command;
use Magento\Payment\Gateway\Command\ResultInterface;
use Magento\Payment\Gateway\CommandInterface;
use Magento\Payment\Gateway\Data\PaymentDataObjectInterface;
use Magento\Payment\Helper\Formatter;
use Magento\Paypal\Model\Payflow\Transparent;

 class SaleCommand implements CommandInterface
{
use Formatter;

/**
 * @var Transparent
 */
private $girocheckoutFacade;

/**
 * SaleCommand constructor.
 * @param Transparent $girocheckoutFacade
 */
public function __construct(
    Transparent $girocheckoutFacade
) {
    $this->girocheckoutFacade = $girocheckoutFacade;
}

/**
 * Executes command basing on business object
 *
 * @param array $commandSubject
 * @return null|ResultInterface
 */
public function execute(array $commandSubject)
{
    error_log("execute() in SaleCommand.php");
    /** @var double $amount */
    $amount = $commandSubject['amount'];
    /** @var PaymentDataObjectInterface $paymentDO */
    $paymentDO = $commandSubject['payment'];
    $payment = $paymentDO->getPayment();

    $storeId = $paymentDO->getOrder()->getStoreId();
    $this->girocheckoutFacade->setStore($storeId);

    /** @var \Magento\Vault\Api\Data\PaymentTokenInterface $token */
    $token = $payment->getExtensionAttributes()->getVaultPaymentToken();

    $request = $this->girocheckoutFacade->buildBasicRequest();
    $request->setAmt($this->formatPrice($amount));
    $request->setTrxtype(Transparent::TRXTYPE_SALE);
    $request->setOrigid($token->getGatewayToken());

    $this->girocheckoutFacade->addRequestOrderInfo($request, $payment->getOrder());

    $response = $this->girocheckoutFacade->postRequest($request, $this->girocheckoutFacade->getConfig());
    $this->girocheckoutFacade->processErrors($response);
    $this->girocheckoutFacade->setTransStatus($payment, $response);
}
}

We really need some help, thanks in advance.


texts: how to change the price filter in Magento

texts:
Now I am working on magento-1.9.1. We all know Magento has default price filter. In stead of the default filter, I want to use a slider.

actual code: view.phtml,

<?php $_filters = $this->getFilters() ?>
 <?php foreach ($_filters as $_filter): ?>
    <?php if($_filter->getItemsCount()): ?>

<?php echo $this->__($_filter->getName()) ?>

<?php echo $_filter->getHtml() ?>

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

filter.phtml:

<?php foreach ($this->getItems() as $_item): ?>

   <?php echo $_item->getLabel();?>

        <?php if ($_item->getCount() > 0): ?>

            <a href="<?php echo $this->urlEscape($_item->getUrl()) ?>">
                <?php echo $_item->getLabel() ?>
                <?php if ($this->shouldDisplayProductCount()): ?>
                (<?php echo $_item->getCount() ?>)
                <?php endif; ?>

        <?php else: ?>

                <?php echo $_item->getLabel(); ?>
                <?php if ($this->shouldDisplayProductCount()): ?>
                    (<?php echo $_item->getCount() ?>)
                <?php endif; ?>

        <?php endif; ?>

<?php endforeach ?>

My code is, view.phtml:

<?php $_filters = $this->getFilters() ?>
                <?php foreach ($_filters as $_filter): ?>
                <?php
                            // get display attribute code
                            $attributeModel = $_filter->getAttributeModel();
                            if($attributeModel) {
                                $attr_code = $attributeModel->getAttributeCode();

                            }
                ?>

                <?php //echo $attr_code;?>
                <?php if($_filter->getItemsCount()): ?>
                    <?php if($attr_code == 'price'){?>

<?php echo $this->__($_filter->getName()) ?>

                        <input id="range_1" type="text" name="range_1" value="1;<?php echo $maxPrice+100;?>" data-type="double" data-step="1" data-postfix="$" data-from="<?php echo $minPrice;?>" data-to="<?php echo $maxPrice;?>" data-hasgrid="true" />

                    <?php }else { ?>

<?php echo $this->__($_filter->getName()) ?>

<?php echo $_filter->getHtml() ?>

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

my jquery is,

$j('#range_1').ionRangeSlider();

what I want is, the products should change when I change the price range in the slider. I don’t know how to give the filter URL to the slider. Please help me


texts: Add new product to the category with position 0 instead of last for Magento 2

texts: I've been trying to find the code where the product is added to a category but I haven't had much luck. I believe it should be in module-visual-merchandiser. Currently, when a product gets added to a category, it automatically goes to the end of the category but I want the product to have position 0 by default. Any guidance is appreciated.


texts: How to show the drop down attribute value using getData() method in magento 2?

texts: When I try to get data from the material attribute like $_product->getData('material'), it shows the integer value. How can I convert it to the actual front-end value and in which file do I have to make the changes?.


texts: An error will be output when migrating data to Magento 2

texts:
Below is the error contents outputted when migrating data from magento 1.9.3.1 to magento 2.2.6.

Please tell me how to fix the error.

[root@windows magento]# php bin/magento migrate:data vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.3.1/config.xml

[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Data Integrity Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: EAV Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Customer Attributes Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Map Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Url Rewrite Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Log Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Ratings Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: ConfigurablePrices step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: OrderGrids Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: Tier Price Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: integrity check][step: SalesIncrement Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: setup triggers][step: Stage]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: data migration][step: EAV Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: volume check][step: EAV Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: data migration][step: Customer Attributes Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: volume check][step: Customer Attributes Step]: started
[2018-11-30 11:53:01][INFO][mode: data][stage: data migration][step: Map Step]: started
58% [================>-----------] Remaining Time: 1 sec

  [PDOException]
  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '4175' for key 'WISHLIST_CUSTOMER_ID'


texts: Is there a good reason to put the same code in both try AND catch blocks?

texts:
In the file: app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Datetime.php, within the render() method, it seems like the exact same code is being run in both the try and catch blocks. The exception isn't handled at all. I'm curious to know what the reasons (if any) are for writing code like this:

try {
     $data = Mage::app()->getLocale()
         ->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
} catch (Exception $e) {
     $data = Mage::app()->getLocale()
         ->date($data, Varien_Date::DATETIME_INTERNAL_FORMAT)->toString($format);
}


texts: Custom quote item attribute while adding product to cart

texts:
I want to save some custom data to quote and order item, when a product is added to cart. I have a custom controller with an addtocartAction where i do the following:

...
$cart->addProduct($product, array(
    'qty' => $params['qty'] ? $params['qty'] : 1
));
...

The action is called via ajax with some data i have to save to the quote item. Where can i do that? Adding the custom attribute to the quote item is not the problem, but changing the value of the attribute. The Product can be more than one time in cart, but with different attribute values in the quote item.


texts: Magento 2 Get Error after add custom attribute in product

texts:
I use following code to add custom attribute in product magento 2

<?php

namespace Marketplace\Attribute\Setup;

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

class InstallData implements InstallDataInterface
{

private $eavSetupFactory;

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

public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{

    $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
    $eavSetup->addAttribute(
      \Magento\Catalog\Model\Product::ENTITY,
      'storevendor_id',
      [
        'type' => 'int',
        'backend' => '',
        'frontend' => '',
        'label' => 'Sample Atrribute',
        'input' => '',
        'class' => '',
        'source' => '',
        'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
        'visible' => true,
        'required' => false,
        'user_defined' => false,
        'default' => '',
        'searchable' => false,
        'filterable' => false,
        'comparable' => false,
        'visible_on_front' => false,
        'used_in_product_listing' => true,
        'unique' => false,
        'apply_to' => ''
      ]
    );
  }
}

but when after install it I got error when open detail product page in admin page

is there something wrong with my script ?


texts: Retrieve Invoices of a Customer from SOAP API v2 WS-I

texts:
salesOrderInvoiceList gives me a list of the invoices:

object(stdClass)[5]
  public 'complexObjectArray' =>
    array (size=9)
      0 =>
        object(stdClass)[6]
          public 'increment_id' => string '100000001' (length=9)
          public 'created_at' => string '2014-12-02 04:05:47' (length=19)
          public 'order_currency_code' => string 'AUD' (length=3)
          public 'order_id' => string '688' (length=3)
          public 'state' => string '2' (length=1)
          public 'grand_total' => string '70.0000' (length=7)
          public 'invoice_id' => string '448' (length=3)
      1 =>
        object(stdClass)[7]
          public 'increment_id' => string '100000002' (length=9)
          public 'created_at' => string '2014-12-02 04:08:49' (length=19)
          public 'order_currency_code' => string 'AUD' (length=3)
          public 'order_id' => string '687' (length=3)
          public 'state' => string '2' (length=1)
          public 'grand_total' => string '60.0000' (length=7)
          public 'invoice_id' => string '449' (length=3)

Is there a way to retrieve invoices based on the customer ID and/or email? Do I need to create my own API?


texts: Magento 2: How to create multi-line order with same SKU programmatically?

texts:
$product
                           ->setPrice($price)
                           ->setSpecialPrice($price)
                           ->setTierPrice([])
                           ->setBasePrice($baseprice)
                           ->setOriginalCustomPrice($price);
                                /** @var \Magento\Framework\DataObject $request */
                           $request = $this->dataFactory->create();
                           $request->setData('qty', (int)$qty)
                           $quote->addProduct($product, $request);

I have added the products to quote using the above code. But this merges the row qty for same SKU (as it supposes to).
How to create 2 different item-lines for the same SKU?


texts: How to disable product edit per field based on admin role in Magento 2

texts:
I have some differents users that will be use the admin, on this way, I need to create different rules to edit the products. On this way, I´ll create a rule that the user can edit just PRICES and STOCK, just this.
I was following this exemple: How to disable product edit fields based on admin role in magento 2 , but I believe that I need to do more things.
Can anyone help me with this, please?


texts:
I know it's kinda vague, but I have a website and all works fine, unless the page "See All" as well as the search and filters, are all very slow. If it's in cache it opens in a second but if it isn't it takes so much time.
it only happens to this page but it a catalog page anyway, I don't know where to check.
Thanks!
Best regards,
Rui Silva


texts: I am trying to add link to the success message in Magento 2

texts:
I am trying to add a product details link in the success message after a user clicks the add to cart button. So I create a variable in my controller but and want to send cart link. Here is file location vendor/magento/module-checkout/Controller/Cart

Here is some code from a similar question which was never solved. Can I include this with

if (!$this->_checkoutSession->getNoCartRedirect(true)) {
                if (!$this->cart->getQuote()->getHasError()) {
                  $cartLink = '_url->getUrl('checkout/cart') .'">View Cart/Checkout';
                   $message =  __('You added %1 to your shopping cart.', $product->getName()) .
''. __('View Cart/Checkout') .'';

                    $this->messageManager->addSuccessMessage($message);
                }


texts: Magento2 select by default one radio button in system configuration

texts:
In my custom module system.xml I added

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
    <tab id="Customodule" translate="label" sortOrder="10">
        Settings
    </tab>

        Connection Settings
        <tab>Customodule</tab>
        <resource>Vendor_Customodule::config</resource>
        <group id="first" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">

<field id="accessLevel" translate="label" type="radios" sortOrder="6" showInDefault="1" showInWebsite="1" showInStore="1">
    Access Level
    <source_model>Vendor\CustomModule\Model\Source\AccessLevel</source_model>
</field>

Model file is as

class AccessLevel implements \Magento\Framework\Option\ArrayInterface
{
    public function toOptionArray()
    {

        return  [
                    [
                        'value' => 'test',
                        'label' => __('Testing')
                    ],
                    [
                        'value' => 'production',
                        'label' => __('Production')
                    ],
                ];
    }

}

I want to select Test option by default.

What should I do please reply me!!!


texts: Magento /api/soap/wsdl XML Encoding is empty

texts:
Quick issue, when trying to access my magento SOAP api WSDL file "/localhost:8080/ecomm/index.php/api/soap/?wsdl" I get the following error in firefox:

XML Parsing Error: XML declaration not well-formed
Location: http://localhost:8080/ecomm/index.php/api/soap/?wsdl
Line Number 1, Column 31:

It looks like the response doesnt have an encoding version where it was previously UTF-8. I don't know what the cause is.

/app/core/api/etc/wsdl.xml has the correct encoding="UTF-8" encoding parameter in the  opening tag.

Any help would be much appreciated.

Thank you.


texts: Downloadable product order status showing pending or closed

texts:
My downloadable product order status is showing pending. I have set this option
Configuration->Catalog->Catalog->Order Item Status to Enable Downloads=Invoiced
Placing orders using Zero subtotal checkout New Order Status = Procssing.
Order status should be complete so customers can download products after order.
But order status is closed and no download link at the frontend for the customer. It is showing pending there.
For now, I am using Placing orders using Zero subtotal checkout New Order Status = Pending. So I can process orders from Admin
Order status should be complete and a download link should appear at frontend at My downloadable Product section
Am I missing something?


texts: How to Get Special Prices to Show with Original Price Strike-through in magento 2

texts: Am adding special price with Original Price Strike-through


texts: Magento 2.1 Admin Url not found on server

texts:
I just installed fresh magento 2.1 CE.Everything went fine. But I can not login to Admin panel. This is the error.

The requested URL /admin_****** was not found on this server.
Any easy solution?


texts:
I have the  fallowing collection and I want to pass the ProductFactory so it can be accessible in my collection.

class Collection extends AbstractCollection
    {
        public $productFactory;

        /**
         * @param \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory
         * @param \Psr\Log\LoggerInterface $logger
         * @param \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy
         * @param \Magento\Framework\Event\ManagerInterface $eventManager
         * @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
         * @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
         */
        public function __construct(
            \Magento\Framework\Data\Collection\EntityFactoryInterface $entityFactory,
            \Psr\Log\LoggerInterface $logger,
            \Magento\Framework\Data\Collection\Db\FetchStrategyInterface $fetchStrategy,
            \Magento\Framework\Event\ManagerInterface $eventManager,
            \Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
            \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null,
            ProductFactory $productFactory
        ) {
            parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource);
            $this->productFactory = $productFactory->create();
        }

        protected function _construct()
        {
            $this->_init(MyClass::class,MyResource::class);
        }

The error that I get is

Uncaught Error: Cannot instantiate interface Magento\Framework\DB\Adapter\AdapterInterface in

/var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

What am I doing wrong, is the goal that I am trying to achieve possible ?


texts: Magento 2 - Get order PayPal information programmatically

texts:
I'm developing a custom module to pass the following data to an external system after payment.

PayPal Express Checkout - Last Correlation ID
PayPal Express Checkout - Last Transaction ID

I can get the Order object but I cannot find the correct method to get these info.

As suggested by Khoa, I checked the sales_order_payment table and here is the record

*************************** 35. row ***************************
                   entity_id: 35
                   parent_id: 35
      base_shipping_captured: 0.0000
           shipping_captured: 0.0000
             amount_refunded: NULL
            base_amount_paid: 32.0000
             amount_canceled: NULL
      base_amount_authorized: 32.0000
     base_amount_paid_online: 32.0000
 base_amount_refunded_online: NULL
        base_shipping_amount: 0.0000
             shipping_amount: 0.0000
                 amount_paid: 32.0000
           amount_authorized: 32.0000
         base_amount_ordered: 32.0000
      base_shipping_refunded: NULL
           shipping_refunded: NULL
        base_amount_refunded: NULL
              amount_ordered: 32.0000
        base_amount_canceled: NULL
            quote_payment_id: NULL
             additional_data: NULL
                cc_exp_month: NULL
            cc_ss_start_year: 0
            echeck_bank_name: NULL
                      method: paypal_express
       cc_debug_request_body: NULL
            cc_secure_verify: NULL
      protection_eligibility: NULL
                 cc_approval: NULL
                   cc_last_4: NULL
       cc_status_description: NULL
                 echeck_type: NULL
cc_debug_response_serialized: NULL
           cc_ss_start_month: 0
         echeck_account_type: NULL
               last_trans_id: 7B590901VY7471028
               cc_cid_status: NULL
                    cc_owner: NULL
                     cc_type: NULL
                   po_number: NULL
                 cc_exp_year: 0
                   cc_status: NULL
       echeck_routing_number: NULL
              account_status: NULL
           anet_trans_method: NULL
      cc_debug_response_body: NULL
                 cc_ss_issue: NULL
         echeck_account_name: NULL
               cc_avs_status: NULL
               cc_number_enc: NULL
                 cc_trans_id: NULL
              address_status: NULL
      additional_information: a:11:{s:15:"paypal_payer_id";s:13:"S3N79BW9ASCXQ";s:18:"paypal_payer_email";s:25:"developer-buyer@qooar.com";s:19:"paypal_payer_status";s:8:"verified";s:21:"paypal_correlation_id";s:13:"689b01d290375";s:32:"paypal_express_checkout_payer_id";s:13:"S3N79BW9ASCXQ";s:29:"paypal_express_checkout_token";s:20:"EC-7F776218LS594863N";s:12:"method_title";s:23:"PayPal Express Checkout";s:41:"paypal_express_checkout_redirect_required";N;s:29:"paypal_protection_eligibility";s:10:"Ineligible";s:21:"paypal_payment_status";s:9:"completed";s:21:"paypal_pending_reason";s:4:"None";}
35 rows in set (0.00 sec)

The data I want is in the paypal_correlation_id & paypal_express_checkout_token of the additional_information column. How can I retrieve it?

I have tried this but failed

    $payment = $order->getPayment();
    var_dump(serialize($payment->getTransactionAdditionalInfo()));


texts: Change the default title of the links from customer navigation in magento 1.8?

texts:
I manage to remove the items that I don't want from the Customer Account Dashboard Links, following this answer,

        <?php $_links = $this->getLinks(); ?>
        <?php $_index = 1; ?>
        <?php $_count = count($_links); /* Add or Remove Account Left Navigation Links Here -*/
            //unset($_links['account']); /* Account Info */
            //unset($_links['account_edit']); /* Account Info */
            unset($_links['tags']); /* My Tags */
            unset($_links['invitations']); /* My Invitations */
            //unset($_links['reviews']);  /* Reviews */
            //unset($_links['wishlist']); /* Wishlist */
            //unset($_links['newsletter']); /* Newsletter */
            //unset($_links['orders']); /* My Orders */
            unset($_links['address_book']); /* Address */
            unset($_links['enterprise_customerbalance']); /* Store Credit */
            unset($_links['OAuth Customer Tokens']); /* My Applications */
            unset($_links['enterprise_reward']); /* Reward Points */
            unset($_links['giftregistry']); /* Gift Registry */
            unset($_links['downloadable_products']); /* My Downloadable Products */
            unset($_links['recurring_profiles']); /* Recurring Profiles */
            //unset($_links['billing_agreements']); /* Billing Agreements */
            unset($_links['enterprise_giftcardaccount']); /* Gift Card Link */
        ?>
        <?php foreach ($_links as $_link): ?>
            <?php $_last = ($_index++ >= $_count); ?>
            <?php if ($this->isActive($_link)): ?>
                <li class="current<?php echo ($_last ? ' last' : '') ?>"><?php echo $_link->getLabel() ?>

            <?php else: ?>
                <li<?php echo ($_last ? ' class="last"' : '') ?>><a href="<?php echo $_link->getUrl() ?>"><?php echo $_link->getLabel() ?>

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

But, what about - if I want to change the order and the default name of them? For instance, I want to change them from,

Account Dashboard
Account Information
My Orders
Billing Agreements
My Product Reviews
My Wishlist
Newsletter Subscriptions
My Gift Cards

to,

My Dashboard
Account Information
Billing Agreements
My Orders
My Reviews
My Wishlist
My Gift Cards
Subscriptions

is it possible?


texts: unable to handle this request. HTTP ERROR 500

texts:
Summary (*)

Magento 2, Version 2.2.8 started throwing 500 error after update.

Examples (*)

Error logs

Class Magento\Framework\App\Http\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. {"exception":"[object] (RuntimeException(code: 0): The specified \"/home/.../public_html/generated/code/Magento/Framework/App/Http/Interceptor.php.27337\" file could not be written Warning!file_put_contents(/home/.../public_html/generated/code/Magento/Framework/App/Http/Interceptor.php.27337): failed to open stream: Permission denied
Class Magento\\Framework\\App\\Http\\Interceptor generation error: The requested class did not generate properly, because the 'generated' directory permission is read-only. If --- after running the 'bin/magento setup:di:compile' CLI command when the 'generated' directory permission is set to write --- the requested class did not generate properly, then you must add the generated class object to the signature of the related construct method, only. at /home/.../public_html/vendor/magento/framework/Code/Generator.php:135)"} []

Proposed solution

Ran the following commands, compile and cleared cache.

 chmod -R 0777 generated

 find . -type f -exec chmod 644 {} \;

 find . -type d -exec chmod 755 {} \;

 find ./var -type d -exec chmod 777 {} \;

 find ./pub/media -type d -exec chmod 777 {} \;

 find ./pub/static -type d -exec chmod 777 {} \;

 chmod 777 ./app/etc

 chmod 644 ./app/etc/*.xml

 rm -rf pub/static/*

 rm -rf var/cache var/generation var/page_cache

 find ./pub/media/catalog -type f -exec chmod 777 {} \;


texts: How to remove the inner HTML of my H1 Page title tag?

texts:
For SEO purpose, I would like to remove the span tag of my pages Catalog and Product View. You can see the default render below:

How could I do that?


texts: How do you import products into Magento 2 by using the category ID, instead of the path?

texts: The default Magento 2 product import feature only allows you to specify the category path string in the import file. How can I import product by using the category ID instead?


texts: Magento setting under web : Use HTTP Only: No / Yes

texts:
I have install SSL certificate on my server in which magento setup is already install.
I have done almost everything. But don't know what to choose from HTTP Only field .

System -> config -> web

Field name: Use HTTP Only

What should i choose from Use HTTP Only field.


texts: Magento 2 - PHPUnit - Write mocks for chained methods

texts:
I'm writing PHPUnit test cases for a custom module. Got struct in writing mocks for the chained methods.
$product = $this->productRepository->get($item->getSku())->getData('bc_giftcard_code_set');

Tried with below, but didn't work.
$productRepository = $this->getMockBuilder(\Magento\Catalog\Model\ProductRepository::class)
        ->disableOriginalConstructor()
        ->setMethods(['get', 'getData'])
        ->getMock();
$productRepository->expects($this->any())->method('get')->will($this->returnSelf());
$productRepository->expects($this->any())->method('getData')->will($this->returnValue(2));


texts: Add custom link fields in header tab in magento 2

texts:
I need to add new custom link fields(chat) in header tab.

For example luma page has these link fields in header page (create account, signup), same header place i want to add chat link in header top, suggest me how to do this.


texts: Magento 1.9.2.4 : Owl carousel not working

texts:
I want to add an owl carousel to my homepage (as a banner slider and product slider) I have linked every file everything is working fine except owl carousel even I have tried to use a slick slider instead of it but its also not working
here is my linked files:

<link rel="stylesheet" href="<?php echo $this->getSkinUrl(); ?>css/bootstrap.css" />
<link rel="stylesheet" href="<?php echo $this->getSkinUrl(); ?>css/owl.carousel.min.css" />
<link rel="stylesheet" href="<?php echo $this->getSkinUrl(); ?>css/owl.theme.default.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous" />
<script type="text/javascript" src="<?php echo $this->getSkinUrl(); ?>js/owl.carousel.min.js"></script>
<script type="text/javascript" src="<?php echo $this->getSkinUrl(); ?>js/bootstrap.js"></script>

and javascript code for owl carousel:

$(document).ready(function(){
$('#slider').owlCarousel({
    loop:true,
    margin:0,
    nav:true,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:1
        },
        1000:{
            items:1
        }
    }
})
})

I have even tried jQuery.noConflict() but it's not working tried commenting other jquery code but still not working.


texts:
I am using Knockout as a View Model to fill values of my view template, It is working fine for all except one function  getConvertedTotal is returning NaN.
define([
'ko',
'uiComponent',
'mage/url',
'mage/storage',
'Magento_Checkout/js/model/quote',
],function (ko, Component, urlBuilder,storage,quote)
{
    'use strict';
    return Component.extend({
        defaults: {template: 'Ishaq_CheckoutTotal/custom-block-order-summary',},
        initialize: function(config) {
            this._super();
            var currencyRate = config.currencyRate;
            var currencySymbol = config.currencySymbol;
        },
        getSubtotal: function() {
            var totals = quote.totals();
            return (totals ? totals : quote)['subtotal'];
        },
        getGrandTotal: function() {
            var totals = quote.totals();
            return (totals ? totals : quote)['grand_total'] ;
        },
        getConvertedTotal: function() {
            var totals = quote.totals();
            var temp = (totals ? totals : quote)['grand_total'] ;
            return (temp*this.currencyRate);
        }
    });
});


texts:
Login to the website frontend in a customer account.

Click on "Account information" and edit some information (firstname, lastname, ...).
Click on the save button.
Now login to the magento backend and click on customers -> manage customers.
Now you see the grid with the correct "updated_at" timestamp.

Login to the website frontend again.
Click on "Account information"

And now click on "Addressbook" and edit some information.
Click on the save button.
Now go to the magento backend and click on customers -> manage customers. Updated_at is not changed.

Question:
How can we set new updated_at timestamp for the address book also?

Address is its own table and has its own updated_at field.
If i want to see the timestamp of customer updated when address is updated, i have to an observer for customer_save_after update the timestamp of customer there?

Can you tell me how we can setup an observer for customer_save_after update for the timestamp?
In which file i have to add the code?

Thank you and best wishes from germany


texts: localhost/private-sales what is the path to edit the default information?

texts:
At Magento link localhost/private-sales I'm getting below information:

  If you are a registered member, please log in here.

  Magento is the leading hub for exclusive specialty items for all your home, apparel and entertainment needs!

Please guide me the path where can I edit above information

.......


texts: Issue in Upgrading Magento2 from 2.2.8 to 2.3.3

texts:
I have upgraded magento 2 from 2.2.8 to 2.3.3. After upgrading, configurable product thumbnail images are not loading in the frontend. When changing the configurable variations, images are not changing in the product page.

Any help on this issue?

Thanks in advance.


texts: Magento 1.9.0.1 Error on Multiple Stores after Supee 8788

texts:
I have a few Magento shops which gets this error after installing the Supee 8788 Patch. I cannot find anyone who have the same problem on Google...

  Fatal error: Class 'Mage_Uploader_Helper_Data' not found in
  /www/app/Mage.php on line 547

Questions
What could be causing this?
Isn't there a way to see the stacktrace to see where it's called from?


texts: Magento 2.3.2 LayoutXML Update remove canonical

texts:
Under Stores > Configuration > Catalog > Catalog, We have "Use Canonical Link Meta Tag For Categories" set to "Yes"

There are a couple of category pages that we want to edit the Canonical Link for.
I am able to add a canonical via XML Update with the following code

<head>
 <link rel="canonical" src="url-goes-here" src_type="url"/>
</head>

However, This causes our category page to have 2 canonical links.
I'm looking for a way to remove the canonical link put in place by the config setting, or a way to edit the existing canonical link for a few of our categories.

Any help would be great.

Thanks,


texts:
I'm using magento 1.9.2.4 and need to remove billing step from onepage checkout and also billing information on the sidebar.

I tried with this way but when customer not logged in, customer cannot access the checkout page, it always redirected to homepage or product page.

Any idea? Thanks!


texts: What will happen if we install magento 2 from github and later used composer to update

texts:
Recently i am working on a Magento 2 website which was installed from github , when i started to work on that project i used composer as when while installing on my local machine it asks me to run "composer install"

But i am not able to do so , even after running composer install again it asks me to run the same command.

My question now is

  what is the `difference between the different methods to install the magento 2

and their cons if in future we ulter the method to update or while installing any extension.

I read this How to get the Magento software

  If you clone the Magento 2 GitHub repository, you cannot use the Magento software in a production environment. You cannot have a live store that accepts orders and so on.
  Thank You.


texts: Magento 2 admin panel login not working. I am getting an error

texts:
[2020-01-20 07:41:49] main.CRITICAL: Cannot gather stats!
  Warning!stat(): stat failed for
  D:/local.webstore/pub/static/frontend/Smartwave/porto/en_US/mage/requirejs/mixins.js
  {"exception":"[object]
  (Magento\Framework\Exception\FileSystemException(code: 0): Cannot
  gather stats! Warning!stat(): stat failed for
  D:/local.webstore/pub/static/frontend/Smartwave/porto/en_US/mage/requirejs/mixins.js
  at
  D:\local.webstore\vendor\magento\framework\Filesystem\Driver\File.php:73)"}
  []


texts:
I want to programmatically remove ALL product images as I am going to programmatically re-add all images. I've managed to remove gallery images (thanks to https://stackoverflow.com/questions/5709496/magento-programmatically-remove-product-images) but I can't get rid of that main image.

I can delete it from the file system obviously but that still leaves a placeholder (with broken image).

Any tips on how to remove the image without removing the product would be very appreciated.


texts: How to display full width homepage static blocks magento 2

texts: I have added cms block and catalog product widget in homepage so now i just need to make those section as full width . How can I achieve it


texts:
I have and (community) extension that switches the product images when you change the options of a configurable product. This works great.
I've also developed some extension that changes the select elements of the configurable options to images and labels. Again this works as expected.
Now the issue. Both of them need to remove from the head block the varien/configurable.js javascript file that handles the configurable products and add their own file. So basically both of them override the js class Product.Config. Both of them need to override the initialize function in the class so I cannot add in my extension Product.Config.prototype.initialize = function(){...}. Or can I?
As you can imagine they don't work together.
Is there any way to solve these kind of conflicts without cloning the changes that the community extension brings to the table into my js file and building on that?


texts: Magento2 - Creating my first custom module and observer

texts:
this is my first project with Magento and my first question here. I'm trying to create an Observer, but I can't figure it out.

The error in var/log/system.log is: main.CRITICAL: Exception message: Class Campaign\CampaignCustomer\Observer\CustomerRegisterSuccess does not exist

Here's my folder structure:

[etc] folder contains these 2 files:

events.xml

<?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="customer_save_before">
        <observer name="obs_customer_account_before" instance="Campaign\CampaignCustomer\Observer\CustomerRegisterSuccess" shared="false" />
    </event>
</config>

module.xml

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

I've run the following commands in my terminal and everything looks fine:

php bin/magento module:enable Campaign_CampaignCustomer
php bin/magento setup:upgrade
php bin/magento cache:clean
php bin/magento cache:flush

The registration.php file looks like this:

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

And finally, my CustomRegisterSuccess class:

<?php

namespace Campaign\CampaignCustomer\Observer;

use Magento\Framework\Event\ObserverInterface;
use Magento\Framework\Event\Observer;
use Magento\Customer\Api\CustomerRepositoryInterface;

class CustomerRegisterSuccess implements ObserverInterface
{
    /** @var CustomerRepositoryInterface */
    protected $customerRepository;

    /**
     * @param CustomerRepositoryInterface $customerRepository
     */
    public function __construct(
        CustomerRepositoryInterface $customerRepository
    ) {
        $this->customerRepository = $customerRepository;
    }

    /**
     * Manages redirect
     */
    public function execute(Observer $observer)
    {

        $accountController = $observer->getAccountController();
        $customer = $observer->getCustomer();
        $request = $accountController->getRequest();
        $customer_number = $request->getParam('customer_number');
        $customer->setCustomAttribute('customer_number', $customer_number);
        $this->customerRepository->save($customer);
    }
}

What's wrong with my code? Please help.


texts: How to add category dropdown in a popup when homepage load in Magent 2.4

texts:
First of all, I am very new to Magento.
I have seen resources to find my requirement, but it seems code folder in app folder is not there.
It is consuming my time a lot. Please help in doing this.
I want to add a Category Dropdown in a popup, when the homepage loads that popup should open, and based on selection of that category products should filter.
I need to know how to do, like what to do.. my requirement is that.. I mean I can write code. But where to write I don't know to achieve this


texts: Sending New order email programatically to custom email adress

texts:
I'm creating a module that checks if the order was made by a certain group, in this case wholesale groups, and if yes send the copy to new order email to a different email address.
It's okay if it still sends to the main address but I can't add another one in the admin area because only the wholesale ones matter.
I already created a module with a sales_order_save_after event and Observer, but I don't know how to get the new order email of that order and send it again to the custom email.
Thanks!
Best regards,
Rui Silva


texts:
Im currently creating a module that should update product quantity per source, based on SKU. Im using Magento\InventoryApi\Api\SourceItemsSaveInterface and Magento\InventoryApi\Api\Data\SourceItemsInterface.

Im trying to use the execute() function from SourceItemsSaveInterface but it expects parameter: \Magento\InventoryApi\Api\Data\SourceItemInterface[] $sourceItems.

What's unclear to me, is how to get that parameter from the SourceItemInterface and what kind of data it should be.

Currently it gives me the below error:

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\InventoryApi\Model\SourceItemValidatorChain::validate() must implement interface Magento\InventoryApi\Api\Data\SourceItemInterface, array given....

Using below code:

<?php
namespace <vendor>/<module>;

use Magento\InventoryApi\Api;
use Magento\InventoryApi\Api\Data;

class Temp
{
protected $_sourceItemsSaveInterface;

protected $_sourceItemInterface;

public function __construct(
    Api\SourceItemsSaveInterface $sourceItemsSaveInterface,
    Data\SourceItemInterface $sourceItemInterface
)
{
    $this->_sourceItemsSaveInterface = $sourceItemsSaveInterface;
    $this->_sourceItemInterface = $sourceItemInterface;
}

public function testFunction() {
    $sourceItemInterface = $this->_sourceItemInterface;

    $sourceItemInterface->setSourceCode('source');
    $sourceItemInterface->setSku('12345678');
    $sourceItemInterface->setQuantity(50);
    $sourceItemInterface->setStatus(1);

    $array = array(
        'sourceItems' => array('source_code' => 'source', 'sku' => '12345678', 'quantity'=>50, 'status'=>1)
    );

    $this->_sourceItemsSaveInterface->execute($array);

    //I need to know what kind of parameter/data should be set in execute() function
}
}


texts:
I've set up Bitbucket Pipelines to use in different Magento Commerce versions but not Magento Cloud yet.

I usually do like that in Magento Open Source or Magento Commerce:

How to setup CI on Magento 2 extension using Bitbucket Pipeline?

What are the differences using Magento Cloud and how could I set it up?


texts: Magento 2 - overwrite module Less / css with theme

texts:
I currently have a module installed inside of the following directory:

  httpdocs/vendor/module/module-name

I've installed the module with composer and it works. However I've noticed the module is adding its own styles to the style sheets (obviously its going to it has less files in it), I want to remove the styles that the module is adding, using my theme.

The current location the module is making the styles is:

  module/module-name/web/css/source/module.less

Style.css is empty - and I assume this is for custom styles as this doesn't get compiled into the main style sheets.

Do i go about it by creating the module inside of my theme and overwriting it like i do all magento core ones, or should I overwrite the module and stop it loading the styles all together.

My main issue is i want to remove the styles all together without touching the original module (they're annoying me) - as im sure that will get updated and i'd like to keep it up to date through composer.

The styles are very intrusive and break my layout - any help would be awesome


texts:
HI I want to ask if I create a custom template phtml file.
inside the coding
do I need to include below 2 tags?
 and


texts:
We are in the process of evaluating Magento CE and Cart2Quote (Extension for Magento)
Not sure if this is a Magento issue or Cart2Quote

I have installed Magento CE (with test data) and are able to integrate Cart2Quote.
We carry a lot of products so we need to do bulk import and export of the products.

To check import and export functionality I am referring to:
http://www.magentocommerce.com/knowledge-base/entry/tutorial-using-magentos-import-export-profiles

I am able to export the product, but when I try to import the same products it gives me following error:

  Invalid value for 'status' in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
  12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24 Invalid value for
  'tax_class_id' in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  15, 16, 17, 18, 19, 20, 21, 22, 23, 24 Invalid value for 'visibility'
  in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  18, 19, 20, 21, 22, 23, 24 Invalid value for 'gift_message_available'
  in rows: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  18, 19, 20, 21, 22, 23, 24 Invalid value for 'page_layout' in rows: 2,
  7 Invalid value for 'country_of_manufacture' in rows: 2, 7

  File is totally invalid. Please fix errors and re-upload file Checked
  rows: 24, checked entities: 24, invalid rows: 24, total errors: 100

Please note that

For some of the test products, I have given (manually from the admin console);

Allow Quotation Requests: Yes
Quotation Conditions: Always show Add to Quote Button

I have added new products (manually from the admin console) with:

Allow Quotation Requests: Yes
Quotation Conditions: Always show Add to Quote Button

In both the above cases Car2quote works fine, as the product shows up in the front end with "Add to Cart" button on them.

Can any one help me with the importing issue. Have attached screenshot of the importing error and below is the link for the csv file I am trying to import into the system.

https://drive.google.com/file/d/0BzE4AMByioYxTUF3T3RTTjhLbUE/view?usp=sharing

I tried importing using Data-Flow profiles...it is able to import now....

Thanks


texts:
I think by not mentioning magento version I made a mistake. This question is related to Magento 2.1.5

I need specific answer regarding

How to add header and footer at sales order print page? i.e.  /sales/order/print/order_id/3/

I have tried but being fresh at magento don't know how and where to add header and footer blocks in xml file.

Immediate help/guideline is required.


texts: Magento - Shopping Cart Rules - Discount based on percentage (20%) - How to cap?

texts:
Is there a way I can resrict the maximum amount for percentage discount?
Example 1 :
20% off discount for any SKU. So let say the SKU price is $1,000 - 20% off = $980  [ final Price = $980 , not $800 ]
Example 2 :
Product price = $20, discount(20%) = $4 discount.

customer can enjoy only 20 $ as discount


texts: Send Email based on Sku of product ordered

texts:
I'm trying to send an email to notify us if a specific sku is ordered.  I've created the following module, but I'm not receiving the email.

app/code/local/MyCompany/MyModule/etc/config.xml:

<?xml version="1.0"?>
<config>
<modules>
    <MyCompany_MyModule>
        <version>0.1.0</version>
    </MyCompany_MyModule>
</modules>

<adminhtml>
    <models>
        <mycompanymymodule>
            <class>MyModule_Model</class>
        </mycompanymymodule>
    </models>
    <events>
        <sales_order_save_after>
            <observers>
                <mycompany_mymodule_model_observer>
                    <type>singleton</type>
                    <class>MyCompany_MyModule_Model_Observer</class>
                    <method>sendEmail</method>
                </mycompany_mymodule_model_observer>
            </observers>
        </sales_order_save_after>
    </events>
</adminhtml>
</config>

app/code/local/MyCompany/MyModule/Model/Observer.php:

class MyCompany_MyModule_Model_Observer
{
    public function sendEmail($observer) {
        $orderId = $observer->getEvent()->getOrder()->getId();
        $order = Mage::getModel('sales/order')->load($orderId);
        $itemCollection = $order->getItemsCollection();
        foreach($itemCollection as $item) {
        $product = Mage::getModel('catalog/product')->load($item->getProductId());
        if($product->getSku() == 'SKU') {
             $mail = Mage::getModel('core/email');
             $mail->setToName('Your name');
             $mail->setToEmail('myemail@mycompany.com');
             $mail->setBody('Order number '.$order->getIncrementId().' has items that need action');
             $mail->setSubject('Order '.$order->getIncrementId().' needs attention');
             $mail->setFromName('Your from name');
             $mail->setFromEmail('customerservice@mycompany.com');
             $mail->setType('text');

                try {
                    $mail->send();
                } catch (Exception $e) {
                    Mage::log($e);
                }
            }
        }
    }
}

I checked my error log file but not seeing anything.  I've also sales_order_save_after for my event observer.

I still get the order confirmation email after ordering that particular sku but not the extra notification email.  Not sure where I went wrong?

EDIT

I now have this working, I've edited the code above with proper changes.  However, now I'm receiving my notification email twice instead of just one time.


texts: changing permissions has locked me out of the site

texts:
I changed my site (shared hosting) permission following the link here:
http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html

find . -type f -exec chmod 400 {} \;
find . -type d -exec chmod 500 {} \;
find var/ -type f -exec chmod 600 {} \;
find media/ -type f -exec chmod 600 {} \;
find var/ -type d -exec chmod 700 {} \;
find media/ -type d -exec chmod 700 {} \;
chmod 700 includes
chmod 600 includes/config.php

After doing this, I get the error:

You don't have permission to access /mymagentofolder/ on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

How can I resolve, and what are the correct permissions to have?

Thanks


texts:
My homepage slider has stopped working and all the images are displayed one below the other. I don't understand what went wrong. Can someone please suggest ways to solve this.

My website is www.barworldindia.com


texts: Magento 2: Share Javascript/CSS Between Backend and Frontend

texts:
In Magento 2, is there a way, as a module developer, to share a javascript or css file between the frontend and adminhtml areas?

In Magento 2, your css and javascript files are kept in the following folders

app/code/Packagename/Modulename/view/frontend/web/path/to/file.js
app/code/Packagename/Modulename/view/adminhtml/web/path/to/file.js

This means, as a module developer, if I want to share a bit of javascript between the frontend and backend, I need to include it twice in my module.

Is there a built-in way to store a css/javascript file in one place, and have it included in both the frontend and backend?

If not, is there a convenient place to hook-in with a plugin or observer and manipulate [what I assume is the head block] directly?


texts: How to merge multiple PDF files into one PDF magento 2 Programitically?

texts:
$fileName = $shipmentNumber.".pdf";
error_log("fileName: ". $fileName);
            echo  $this->_downloader->create(
                $fileName,
                @file_get_contents($filepath)
            );


texts: Magento 2: How to add loading icon on product page

texts: We develop website have many variables for every product. So, when the page loads the variable load very slow. So we want to add a loading icon at the product variable until all variable options show it. I try Google, but still don't have the answer.