texts: Programatically get category detail by multiple store view ids

texts: I am working on one website multi store functionality. I am having store view ids in my array, i want to get all categories by store view id arrays.


texts: Magento Sales Graph issue after upgrading to 1.8.1.0 from 1.5.1.0

texts:
I have upgraded Magento from Version 1.5.1.0 to 1.8.1.0
And now the order graph in the admin dashboard is showing misleading data. The number of sales has shifted by 2 months considering what it was in 1.5 version.

To be specific, in the earlier version of Magento the sales in my website reached peak on August and now after upgrade the peak is shown on September.

When I try to debug, the data coming the database seems to be correct but somehow the chart is displaying incorrectly.

Has anybody come across this issue and is there anyone who can help me with this??

Thank you..


texts: How to add some specific content to bottom of every category page in magento1.x?

texts: I want to add some content to bottom of every category product list page. The content should change depends-upon the category without editing code or layout xml file ?


texts: Why isn't magento finding my adminhtml grid block?

texts:
I'm trying to build my first admin grid.

The tutorial I'm following is http://inchoo.net/magento/how-to-create-a-custom-grid-from-scratch/

The routing-to-the-controller part is working. When I open my URL, I see the title set using $this->title().

controllers/Adminhtml/Shipments/ReportController.php

    $block = $this->getLayout()
        ->createBlock('ebuynow_ebnreports/adminhtml_shipments_report');
    $this->_addContent($block);

Block/Adminhtml/Shipments/Report.php, Ebuynow_Ebnreports_Adminhtml_Shipments_Report::__construct()

    $this->_blockGroup = 'ebuynow_ebnreports';
    $this->_controller = 'adminhtml_shipments_report';
    $this->_headerText = Mage::helper('ebuynow_ebnreports')
        ->__('sum headertext');
    parent::__construct();
    $this->removeButton('add');

And the grid file is located Block/Adminhtml/Shipments/Report/Grid.php and has class Ebuynow_Ebnreports_Block_Adminhtml_Shipments_Report_Grid. I've been looking at this for a while, and it all looks like it matches up with the inchoo tutorial code.

When I open the page with developer mode turned on, I get this error

  Recoverable Error: Argument 1 passed to Mage_Adminhtml_Controller_Action::_addContent()
  must be an instance of Mage_Core_Block_Abstract, boolean given

The createBlock() call is not able to find the block using that string and I don't see why.

If more information is needed I can add more code, I just figured this was where the error was.

Possibly relevant: I followed the execution path of createBlock() to see what it was looking for given the string ebuynow_ebnreports/adminhtml_shipments_report. In Mage/Core/Model/Config.php ::getGroupedClassName(), I echoed $className at the end, before the return and for this: Mage_Ebuynow_Ebnreports_Block_Adminhtml_Shipments_Report

It seems to be prefixing my block class name with Mage_. Not sure if that's normal or not but seems odd. I tried adding Mage_ to my actual block's class name and it didn't help.


texts:
How can i change Yes to Active and No to Deactive?

i've tried it with toOptionArray():

class ActiveDeactive implements \Magento\Framework\Option\ArrayInterface
{
    public function toOptionArray()
    {
        return [
            'value' => 'Active',
            'value_another' => 'Deactive'
        ];
    }
}

and with xml:

<field name="status">
    <argument name="data" xsi:type="array">
       <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">boolean</item>
                 <item name="label" xsi:type="string" translate="true">Status</item>
                 <item name="formElement" xsi:type="string">checkbox</item>
                 <item name="source" xsi:type="string">pricelist</item>
                 <item name="dataScope" xsi:type="string">status</item>
                 <item name="prefer" xsi:type="string">toggle</item>
                 <item name="valueMap" xsi:type="array">
                     <item name="true" xsi:type="string">Active</item>
                     <item name="false" xsi:type="string">Deactive</item>
                 </item>
            <item name="default" xsi:type="string">Active</item>
        </item>
    </argument>
</field>

and also with the option xml attribute:

<argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">\Vendor\Module\Model\Adminhtml\System\Config\Source\ActiveDeactive</item>
        ...


texts: Magento 2 Core Bug Found For Multiple discount calculation in All 2.2.x version

texts:
This is the core issue in all Magento 2.2.x. When we add two cart price rule with action " Percent of product price discount". It makes little calculation issue in total discount.

For example, I have created two cart price rules with the same priority:

Rule 1:

Rule Name: 10% Fix Discount
Coupon: No Coupon
Conditions: Apply for all product
Action:
    Apply: Percent of product price discount
    Discount Amount: 10

Rule 2:

Rule Name: 5% Fix Discount
Coupon: No Coupon
Conditions: Apply for all product
Action:
    Apply: Percent of product price discount
    Discount Amount: 5

So the calculation should be like this

For ex. Product Price = $45

First Rule(10% of product price) Discount: (45*10) / 100 = 4.5
Second Rule(5% of product price) Discount: (45*5) / 100 = 2.25

Total Discount = 6.75

  But it's shows $6.53 in total discount.

I have raised the issue on GitHub and magento team have also approved the issue. But it takes some time to resolve this issue. https://github.com/magento/magento2/issues/12837

Anyone have idea or any patch to resolve this issue?


texts:
I have set up a magento store with 5 stores for different sections of the charity. My problem exists in one store only 'fundraising'. The issue is this:

when a ticket is purchased through the store and paid for via PayPal standard, the transaction is not captured and no invoice is created. If I try to manually create the invoice I get the following error 'Unable to save the invoice'.

Please see contents of the log file below:

  2015-05-05T11:20:34+00:00 ERR (3):
  exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'INV100000001' for key 'UNQ_SALES_FLAT_INVOICE_INCREMENT_ID'' in lib/Zend/Db/Statement/Pdo.php:228
  Stack trace:

There is lots more the log is huge, I thought that line was the problem. I seriously stuck here so any help would be massively appreciated


texts: order confirm dont send any email Magento2

texts:
I am using magento 2.3
When I try placeorder. It doesn't have any mail.
I use mail server.
My mail sender: name@myserver.com

If I use SMPT module and change sender email to gmail then it works.
So, I think it relate to some setting for mail server or I am missing some step.
Anyone help me?


texts:
I am running Magento EE 1.13.1.0
I set all the index options in System=>Configuration=>Advanced=>Index Management to "Update when scheduled".

When I run

$ php -f indexer.php mode
Product Flat Data:                  unknown
Stock Status:                       unknown
Catalog product price:              unknown
Category URL Rewrites:              unknown
Product URL Rewrites:               unknown
URL Redirects:                      unknown
Catalog Category/Product Index:     unknown
Catalog Search Index:               unknown
Tag Aggregation Data:               Manual Update
Product Attributes:                 Manual Update

What is the meaning of the "unknown" mode and how can I repair?


texts:
When on my homepage and any page other than product pages my SSL works perfectly. When you load a product page the SSL breaks and I see this message in my console:

  The page at 'https://www.mywebsite.com/product-page.html' was loaded over HTTPS, but is submitting data to an insecure location at 'http://www.mywebsite.com/checkout/cart/add/uenc/aHR0cDovL3d3dy5uaXRyb3V…p6bGUtc3lzdGVtLmh0bWw_X19fU0lEPVU,/product/1347/form_key/bWcN0O9kodteC8FG/': this content should also be submitted over HTTPS.

I have done the typical base urls settings in magento and quadruple checked sure https is set for the secure base url. I also enable ssl in htaccess file using this:

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.mywebsite.com/$1 [R=301,L]

How can change the unsecure location URL? The cart page etc loads with the SSL.

Magento ver. 1.9.0.1

Thank you for your help!


texts: Cron not running because of simplexml_load_string error

texts:
I have some trouble receiving order emails so i debuged a bit.

Installed AOE Scheduler

Found some issues with the cron so i checked this. Now its running but keeps sending me the following errors:

When trying to run schedular_cron.sh:

PHP Fatal error: Call to undefined function simplexml_load_string() in /path/to/magento/lib/Varien/Simplexml/Config.php on line 510

When trying to run cron.sh (Mage default):

PHP Fatal error: Call to undefined function simplexml_load_file() in /path/to/magento/app/Mage.php on line 767

Both *.sh files are executable and have the right owner.

Based on my phpinfo() SimpleXML is enabled.
Also, if (extension_loaded('simplexml')) tells me its loaded.


texts: How to transfer WooCommerce Orders to Magento in Real Time

texts:
I would like to transfer orders I get from WooCommerce into Magento.  The reason is that I want to have one-click upsells/downsells and I can't find a module or anything for Magento that has this functionality.  But with WooCommerce there are a few plugins that enable this functionality.  So, for offers I'm promoting/advertising I could send them to my landing page and WooCommerce checkout (i.e. with the one-click upsells/downsells)  then transfer those orders automatically into Magento.

I was reading here: API to automatically import Woocommerce orders to Magento and one of the commenters said one could do this "via API (REST or SOAP)"

In another post here: Transfer orders from another cms to magento one could use an extension.

What would be the simplest way to accomplish this? Seems via API would be but I don't have much understanding of how to setup the API and would most likely require professional help.

The extensions mentioned in the post above cost are a little pricey for me at this time but might be the way to go. Not sure.

Maybe a script that cron runs every couple minutes to update and transfer the orders? I would like it to be just like the order was received through the Magento checkout i.e. all customer info.

Any suggestions would be very much appreciated.


texts: Magento 2: InvalidArgumentException There are no commands defined in the "cache" namespace

texts:
I have facing issue while run command. I can't use any bin/cli commands in magento 2.

I keep getting below generic error messages.

Error: InvalidArgumentException There are no commands defined in the "cache" namespace.


texts: How to disable Share Wish List in Magento

texts: What is the best way to disable the sharing feature inside the customers front end Wish List view of Magento 1.9.x? I've considered css but would prefer if it can be disabled in the code/layouts or code if it's not a hack, as the site I am working on is mainly private and requires login to view anything.


texts:
Can someone point me to documentation on the EMail templating / merge fields available in Magento?

I seem to be missing many default templates and may have to build them myself, but would like to understand what fields are available for the templates.


texts: Add Company column to Customers Admin Grid with Observer

texts:
I want to add the "Company" column from the customer's Address attributes.

Is there any way to populate this column through an observer or do I need to extend the prepareCollection or preparePage functions?

Working Code:

Observer is set up on event core_block_abstract_prepare_layout_before

XML

/app/code/local/Mbs/Changegrid/etc/config.xml
<?xml version="1.0"?>
<config>
    <modules>
        <Mbs_Changegrid>
            <version>0.4.0</version>
        </Mbs_Changegrid>
    </modules>
    <global>
        <models>
            <mbs_changegrid>
                <class>Mbs_Changegrid_Model</class>
            </mbs_changegrid>
        </models>
    </global>
    <adminhtml>
        <events>
            <core_block_abstract_to_html_before>
                <observers>
                    <changegrid_before_block>
                        <class>Mbs_Changegrid_Model_Observer</class>
                        <method>beforeBlockToHtml</method>
                    </changegrid_before_block>
                </observers>
            </core_block_abstract_to_html_before>
            <eav_collection_abstract_load_before>
                <observers>
                    <changegrid_collection_load>
                        <class>Mbs_Changegrid_Model_Observer</class>
                        <method>beforeCollectionLoad</method>
                    </changegrid_collection_load>
                </observers>
            </eav_collection_abstract_load_before>
        </events>
    </adminhtml>
</config>

PHP

/app/code/local/Mbs/Changegrid/Model/Observer.php
class Mbs_Changegrid_Model_Observer {
    public function beforeBlockToHtml(Varien_Event_Observer $observer) {
        $grid = $observer->getBlock();
        /**
         * Mage_Adminhtml_Block_Customer_Grid
         */
        if ($grid instanceof Mage_Adminhtml_Block_Customer_Grid) {
            $grid->addColumnAfter(
                'company',
                array(
                    'header' => Mage::helper('customer')->__('Company'),
                    'index'  => 'company'
                ),
                'name'
            );
        }
    }

    public function beforeCollectionLoad(Varien_Event_Observer $observer) {
        $collection = $observer->getCollection();
        if (!isset($collection)) {
            return;
        }

        /**
         * Mage_Customer_Model_Resource_Customer_Collection
         */
        if ($collection instanceof Mage_Customer_Model_Resource_Customer_Collection) {
            /* @var $collection Mage_Customer_Model_Resource_Customer_Collection */
            $collection->addAttributeToSelect('company');
            $addressCollection = Mage::getModel('customer/address')->getCollection()->addAttributeToSelect('company');
            $addressCollection->getSelect()->limit(1);
            $address = $addressCollection->getFirstItem();
            foreach ($address->getAttributes() as $attribute) {
                if (is_null($attribute->getAttributeID()) || is_null($attribute->getFrontendLabel()) || ($attribute->getFrontendLabel() == '')) {
                    continue;
                }
                $collection->joinAttribute($attribute->getName(), 'customer_address/' . $attribute->getName(), 'default_billing', null, 'left');
            }
        }
    }
}


texts: Magento 2: Customer name not display in programmatically logged in user account

texts:
I have programmatically logged into the customer accounts from my custom controller. In this case the customer name is not loading in the header.
https://prnt.sc/nzucg9

How can I do it?

Here is the code

    public function __construct(
               .....
            \Magento\Customer\Api\Data\CustomerInterfaceFactory $customerInterfaceFactory,
            \Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
            \Magento\Customer\Api\CustomerRepositoryInterface $customerRepositoryInterface,
            \Magento\Customer\Model\CustomerFactory $customerFactory,
            \Magento\Customer\Model\Session $customerSession,
             ....
        ) {
            $this->customerInterfaceFactory = $customerInterfaceFactory;
            $this->customerRepositoryInterface = $customerRepositoryInterface;
            $this->storeManagerInterface = $storeManagerInterface;
            $this->customerFactory = $customerFactory;
            $this->customerSession = $customerSession;
                 .....

        }

 public function execute() {
    $email = 'test@test.com';
        $storeId = $this->storeManagerInterface->getStore()->getId();
        $websiteId = $this->storeManagerInterface->getStore($storeId)->getWebsiteId();
        $customer = $this->customerFactory->create();
        $customer->setWebsiteId($websiteId)->loadByEmail($email);
        $this->customerSession->setCustomerAsLoggedIn($customer);
        $this->customerSession->regenerateId();
}


texts: Magento 1.8 Flat table disable after invoice not creating

texts:
Issue: Invoice not created.

Note: Flat tables activated. Problem disappears when Flat tables are disabled.


texts: Exporting to CSV creates displaced rows and way too many

texts:
So I have maybe less than 150 total products but my CSV file is reaching 900 rows. Additionally there are displaced rows with some things tripled or doubled.

Is there a way to clean this up before exporting? Like a missed setting/option that I'm not seeing?


texts: how to sort stock by quantity in magento 2.3

texts:
In magento frontend i want to sort products by maximum quantity first to lower number of stock (Quantity sort in descending order)

Please advise which module to be made and where to save the files
i am using magento 2.3.0


texts:
I am using sales_order_place_after event to send an sms to the user. Now, sometimes I have to make a call again when I can't send an sms and this means it takes a lot of time. The customer all this time is stuck on the place order button. Is there a way to make place order loading independent of its event.

EDIT: I must add that I am sending a validation code in that sms and want user to input it on the success page. It is just that it takes 30 to 40 seconds in worst case scenario. Normally it takes 3 seconds for the process to complete. So even though I want the page load time to remain less, I also want the customer to get an sms within 40 seconds. This would mean my observer gets triggered but doesn't hold place order to itself


texts:
When I enter a wrong email/password, it says:

  Invalid User Name or Password.

error.

But correct email, password does not show any error and also does not redirect to dashboard.

How do I resolve this issue?


texts: Change standard quantity on product page

texts:
When a customer visits a product page, the order quantity is standard set to 0. I want it to be automatically set to "nombre necessaire", which is regenerated by a code, but I have no clue how to do this. can you help me out?
i'm using magento 2
thank you
-paul


texts: restrict the lightbox image size to 1200 in product view page

texts:
please visit this link : http://demo.kidsdial.com/boys-toys/bikes-trikes-ride-ons/peacock-kinder-blocks-play-set.html

click on "product image", you can see image ,image will expand with original size [lightbox image]

I want to restrict that lightbox image size to 1200.

please see below media.phtml file

media.phtml file = http://pastebin.com/8yaDrs8Q

help me to restrict the lightbox image size for 1200.

let me know if you need any clarifications,

thanks in advance,....


texts:
I have always used MAMP PRO to configure my Magento sites for local dev, but with Magento 2 requiring mysql 5.6, I haven't had much luck setting up site successfully on local server with MAMP...plus I'm reading a lot that it's more or less abandonware.

I used this Vagrant setup: https://github.com/paliarush/magento2-vagrant-for-developers, which seemed to work alright, but not quite as intuitive to configure the host names and set up project.

Any other suggestions or ideas on some efficient/easy to set up local dev environment packages for Magento 2. Or is a VM my best bet?


texts: I can use .lib-clearfix() in source/_module.less files within custom modules, I want to add a mixin similar to that so I can call it from all modules but have it stored within the theme. What is the best practise way to do this?


texts:
I need your help. I'm running Magento CE 1.9 and every time someone places an order I get the email saying:

Payment transaction failed. Reason Please agree to all the terms and conditions before placing the order. Checkout Type onepage

However, the order gets placed. I tested it myself and I get the same email even though I agree to terms and conditions. So far I noticed this only with PayPal.

Does anybody know what could it be?

Thank you!


texts: Magento Blank Frontend Page and Blank Backend Page after login

texts:
I am moving my local Magento installation (on OSX) to the a new server (opensuse 11.4).

I moved the whole folder with Magento (Version 1.8.1.0 with the mt_colinus theme installed), deleted the var/cache and var/log folder.
I exported my local db via phpMyAdmin and imported it via phpMyAdmin on the server.
I modified the app/atc/local.xml file with the new server mysql data.

However I get a blank page going to the frontend index.php page.

The backend index.php/admin login page seems to be fine but after submitting the login data I got another blank page index.php/admin/dashboard/index/key/.

After enabling:

ini_set(’display_errors’, 1);
ini_set(‘memory_limit’, ’256M’);

I got this error in the frontend page:

  Fatal error: Call to a member function getId() on a non-object in
  /srv/www/htdocs/XXXXXXXXXX/app/code/core/Mage/Cms/Helper/Page.php on
  line 67

And this one in the backend dashboard page:

  Fatal error: Call to a member function addCreateAtPeriodFilter() on a
  non-object in
  /srv/www/htdocs/XXXXXXXXXX/app/code/core/Mage/Adminhtml/Block/Dashboard/Totals.php
  on line 53

I also uploaded a blank Magento 1.8.1.0 folder without setting the local.xml file with the db info (hoping to see the installation wizard) and I still get a blank page. The error in this case is:

  Fatal error: Call to a member function rewrite() on a non-object in
  /srv/www/htdocs/magento/app/code/core/Mage/Core/Controller/Varien/Front.php
  on line 165

What can I additionally try to do to solve the this issue?


texts: Add .phtml file code to admin side made page

texts:
I made a page using admin side. and I want to assign this file which I  already used on Product description page . in  catalog_product_view.xml

like this

<block class="Magento\Catalog\Block\Product\View\Description" name="product.details.accessories" template="product/view/accessories.phtml" after="product.info.details" />

How I can use this  accessories.phtml  now on my page which I made using admin side ?


texts: Whenever any decimal gets entered into a products special_price, it will always be rounded when you visit it again in the backend. I've checked the front end and it will display the decimal entered as long as you don't save the product for a second time as this causes the special_price to round to 0dp. I've checked the attribute and it's input is price however the attribute "price" has the same configuration and yet won't round the decimals in the backend.


texts:
let me know what could happen? on the frontend I do not see half of the products and Product does not appear in product list, how could this happen? No products that I added in the last 2 weeks, but I can see the admin panel products, and products enabled by categories are - no errors

What to do?
Thanks


texts: Server folder appears as output url for media, js and skin

texts:
Any ideas why Magento 1.9.2.4 sets the beginning of the media, skin and js url's like this /var/www/domain.com/html/ instead of normal http://www.domain.com like it has been set in unsecure_base_url and secure_base_url?

I have set up full url for each (js, media and skin) in database so I'm not sure where does that server folder come from.


texts:
I have upgraded Magento version 2.3.5-p1 to Magento 2.4.0 after the upgrade it's showing me an error regarding newsletter files below are the error. I am running below command
php bin/magento setup:di:compile

Error Message
Compilation was started.
Interception cache generation... 6/8 [=====================>------]  75% 52 secs 572.0 MiBErrors during compilation:
        Magento\Newsletter\Model\Queue\TransportBuilder
                Extra parameters passed to parent construct: $messageFactory, $emailMessageInterfaceFactory, $mimeMessageInterfaceFactory, $mimePartInterfaceFactory, $addressConverter. File: /var/www/html/vendor/magento/module-newsletter/Model/Queue/TransportBuilder.php
Total Errors Count: 1

In Log.php line 92:

  Error during compilation

Transport Builder code
public function __construct(
    FactoryInterface $templateFactory,
    MessageInterface $message,
    SenderResolverInterface $senderResolver,
    ObjectManagerInterface $objectManager,
    TransportInterfaceFactory $mailTransportFactory,
    MessageInterfaceFactory $messageFactory = null,
    EmailMessageInterfaceFactory $emailMessageInterfaceFactory = null,
    MimeMessageInterfaceFactory $mimeMessageInterfaceFactory = null,
    MimePartInterfaceFactory $mimePartInterfaceFactory = null,
    AddressConverter $addressConverter = null
) {
    parent::__construct(
        $templateFactory,
        $message,
        $senderResolver,
        $objectManager,
        $mailTransportFactory,
        $messageFactory,
        $emailMessageInterfaceFactory,
        $mimeMessageInterfaceFactory,
        $mimePartInterfaceFactory,
        $addressConverter
    );
    $this->emailMessageInterfaceFactory = $emailMessageInterfaceFactory ?: $this->objectManager
        ->get(EmailMessageInterfaceFactory::class);
    $this->mimeMessageInterfaceFactory = $mimeMessageInterfaceFactory ?: $this->objectManager
        ->get(MimeMessageInterfaceFactory::class);
    $this->mimePartInterfaceFactory = $mimePartInterfaceFactory ?: $this->objectManager
        ->get(MimePartInterfaceFactory::class);
    $this->addressConverter = $addressConverter ?: $this->objectManager
        ->get(AddressConverter::class);
}

It's extending below file
Magento\Framework\Mail\Template\TransportBuilder
public function __construct(
    FactoryInterface $templateFactory,
    MessageInterface $message,
    SenderResolverInterface $senderResolver,
    ObjectManagerInterface $objectManager,
    TransportInterfaceFactory $mailTransportFactory,
    MessageInterfaceFactory $messageFactory = null,
    EmailMessageInterfaceFactory $emailMessageInterfaceFactory = null,
    MimeMessageInterfaceFactory $mimeMessageInterfaceFactory = null,
    MimePartInterfaceFactory $mimePartInterfaceFactory = null,
    AddressConverter $addressConverter = null
) {
    $this->templateFactory = $templateFactory;
    $this->objectManager = $objectManager;
    $this->_senderResolver = $senderResolver;
    $this->mailTransportFactory = $mailTransportFactory;
    $this->emailMessageInterfaceFactory = $emailMessageInterfaceFactory ?: $this->objectManager
        ->get(EmailMessageInterfaceFactory::class);
    $this->mimeMessageInterfaceFactory = $mimeMessageInterfaceFactory ?: $this->objectManager
        ->get(MimeMessageInterfaceFactory::class);
    $this->mimePartInterfaceFactory = $mimePartInterfaceFactory ?: $this->objectManager
        ->get(MimePartInterfaceFactory::class);
    $this->addressConverter = $addressConverter ?: $this->objectManager
        ->get(AddressConverter::class);
}


texts: How can I get Response getBody() in Observer event?

texts:
In Magento 1 I can do the following:

$response = $observer->getEvent()->getControllerAction()->getResponse();
if(!$response) {
   return $this;
 }

$html = $response->getBody();

How can I do the same in Magento 2?


texts: Is it possible to make Magento 2 fast (i.e. < 2s page load) without using any caching?

texts:
In web development it's good practice to ensure that your applications perform sufficiently well without relying on a cache. Caching should not be used as a crutch or a permanent solution to mask otherwise poor performance.

So my question is: is it possible to achieve acceptably performant (i.e. under two second) page loads in Magento 2 without using any caching, and if so, how?


texts: Magento 2 Inventory & price change events

texts:
I want to write an observer when Product Inventory & price changes in Magento 2.

In Magento 1 I was able to find event :- cataloginventory_stock_item_save_after

But In magento 2 I am not able to run this event.

app/code/Company/Module/etc/events.xml

    <event name="cataloginventory_stock_item_save_after">
        <observer name="cataloginventorysave" instance="Company\Module\Observer\Cataloginventorysave" />
    </event>

app/code/Company/Module/Observer/Cataloginventorysave.php

<?php
namespace Company\Module\Observer;

use Magento\Framework\Event\ObserverInterface;

class Cataloginventorysave implements ObserverInterface
{
    protected $_objectManager;

    protected $_logger;

    public function __construct(
        \Magento\Framework\ObjectManagerInterface $objectManager,
        \Psr\Log\LoggerInterface $logger
    ) {
        $this->_logger          = $logger;
        $this->_objectManager   = $objectManager;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $stockItem = $observer->getEvent()->getItem();

        echo '<pre>'; print_r($stockItem->getData());

        $this->_logger->addError('inventory_change');
    }
}

Also which event is used for price change?


texts: Magento 2 newsletter subscription redirection to custom page

texts:
Default behavior:

When I subscribed to newsletter then it displayed the success message in the same page itself.

What I want is:

When the customer or guest user subscribe to the newsletter I want them to be redirected to a custom page(cms page).In other words, I just want to display a separate thank you page after clicking "submit" button.

So, how can I achieve this?

Magento 2.2.6


texts: How to show uploaded image url in custom tab in admin grid in Magento2

texts:
I want to show the uploaded image URL in a custom tab in admin grid in Magento 2.
 In the custom tab, image name is coming from the database.

Any help will be appreciated.

As shown in the picture I want to show that image URL in that form


texts: Magento third party library does not work

texts:
Installed module : https://github.com/E-ComProcessing/magento-ce-ecp-plugin
generate below system.log:

2016-11-21T09:04:44+00:00 ERR (3): Warning: include(/opt/lampp/htdocs/demo/includes/src/Genesis\Genesis.php): failed to open stream: No such file or directory  in /opt/lampp/htdocs/demo/includes/src/Varien_Autoload.php on line 94
2016-11-21T09:04:44+00:00 ERR (3): Warning: include(): Failed opening '/opt/lampp/htdocs/demo/includes/src/Genesis\Genesis.php' for inclusion (include_path='/opt/lampp/htdocs/demo/includes/src:.:/opt/lampp/lib/php')  in /opt/lampp/htdocs/demo/includes/src/Varien_Autoload.php on line 94
2016-11-21T09:04:44+00:00 ERR (3): Warning: include(/opt/lampp/htdocs/demo/includes/src/Genesis\Genesis.php): failed to open stream: No such file or directory  in /opt/lampp/htdocs/demo/includes/src/Varien_Autoload.php on line 94
2016-11-21T09:04:44+00:00 ERR (3): Warning: include(): Failed opening '/opt/lampp/htdocs/demo/includes/src/Genesis\Genesis.php' for inclusion (include_path='/opt/lampp/htdocs/demo/includes/src:.:/opt/lampp/lib/php')  in /opt/lampp/htdocs/demo/includes/src/Varien_Autoload.php on line 94

Can any one suggest me what is the directory structure of the third party codes?

how can i debug this?


texts: Magento 404 error but all pages work fine

texts:
Magento version 1.9.2.4
linux server

I've been having trouble getting my google to crawl my site.

When I run a check on my http header it returns a 404 not found, but I can clearly navigate to the page and it renders fine.

Address: 'atebol.com'

A bit of history on the setup, I originally had the site on a different domain and I enabled web server rewrites. when I changed over I updated the config data with teh base url and cleared the cache. ever since I have been getting a 404 but still able to access my site. for some reason I am not able to turn off server rewrites in the backend, when i do it just says "configuration has been saved" but still says 'yes' in the field.

I have tried swapping out the htaccess with the original htaccess config but has no effect.

can someone please help me, let me know if you need anymore information, thank you.


texts: Magmi category creator does not work with options

texts:
I am importing ~5000 products into our Magento 1.9 via Magmi 0.7.22 without major issues. The categories shall not be active so I set the is_active flag in the categories column to 0:

[myroot]/CatA1::0::1::1/CatA2::0::1::1;;[myroot]/CatB1::0::1::1/CatB2::0::1::1

According to the documentation of the CategoryImporter plugin the syntax is as follows:

[root category]/category name::[is_active]::[is_anchor]::[include_in_menu]

But all categories which are created during the import are active. Am I doing something wrong here?


texts: Backorders Set to No but still receiving orders (Magento 2.3)

texts:
We're experiencing a bug wherein backorders is set to no but for some reason, for newly created products, people can order beyond that set amount of stock that we have and the number goes into the negative
Inventory -> No Backorders
Advanced Inventory -> No backorders
Any insights on why this may be happening will be helpful.


texts: Magento 2.3 New product detail tabs prevent automatic nesting

texts:
In my layout file I created 2 new tabs. Both tabs appear, however one is nested below the other. I don't understand why Magento would do this behavior since I did not set any code that should trigger it. I actually cannot figure out how to stop it from doing it. See example
    <referenceBlock name="product.info.details">
      <block class="Magento\Catalog\Block\Product\View" name="installationcaretab" template="product/view/installation_care.phtml" group="detailed_info">
         <arguments>
            <argument translate="true" name="title" xsi:type="string">Installation and Care</argument>
         </arguments>
      </block>
    </referenceBlock>

    <referenceBlock name="product.info.details">
      <block class="Magento\Catalog\Block\Product\View" name="warrantytab" template="product/view/warranty.phtml" group="detailed_info">
         <arguments>
            <argument translate="true" name="title" xsi:type="string">Warranty</argument>
         </arguments>
      </block>
    </referenceBlock>


texts: Magento 2 run php bin/magento without command line

texts:
I have Magento 2 store and I need to run php bin/magento setup:upgrade. But the problem is that client has just a basic webhosting, so there is no command line.

Is it possible to create php file that will execute this command, and then I will just open it in browser to run it?
Thanks.


texts: Images are not shown on Magento 2.3.5 for the product page

texts:
I have an issue with the images. On the category pages images are shown for the products, but on the PDP page the img is missing. Instead i got the placeholder img. On the admin, the img is set to base, small and thumbnail.
I followed the possible answers from here: Magento 2.3.2 Product Image Missing after version updating from 2.2.1, like doing:
bin/magento indexer:reindex

or
bin/magento catalog:images:resize

But none of them worked for me. The cache is also cleared. Can you give me some advice what should I check more ? Thank you


texts: Great challenge - convert XML structure to php code

texts:
I'm working in a project which i need convert the minicart xml structure to a php code.

I made all this.
But i don't know why he does't call or read my templates html.

I compared the json structure generated by my php code with that of xml and this equals.

Part of struture XML

http://prntscr.com/de58kk

Part of my PHP code

http://prntscr.com/de5916

The components are ok, the only one which does not work is the templates.

When i test which the xml and verify the Network tab on Chrome.
The content.html is loaded.

But when i test with my php code not load.

Json code renderized on the end of document.

Thanks.

"Magento_Ui/js/core/app":{
   "components":{
      "minicart_content":{
         "children":{
            "subtotal.container":{
               "children":{
                  "subtotal":{
                     "children":{
                        "subtotal.totals":{
                           "config":{
                              "display_cart_subtotal_incl_tax":0,
                              "display_cart_subtotal_excl_tax":1,
                              "template":"Magento_Tax\/checkout\/minicart\/subtotal\/totals"
                           },
                           "component":"Magento_Tax\/js\/view\/checkout\/minicart\/subtotal\/totals",
                           "children":{
                              "subtotal.totals.msrp":{
                                 "component":"Magento_Msrp\/js\/view\/checkout\/minicart\/subtotal\/totals",
                                 "config":{
                                    "displayArea":"minicart-subtotal-hidden",
                                    "template":"Magento_Msrp\/checkout\/minicart\/subtotal\/totals"
                                 }
                              }
                           }
                        }
                     },
                     "component":"uiComponent",
                     "config":{
                        "template":"Magento_Checkout\/minicart\/subtotal"
                     }
                  }
               },
               "component":"uiComponent",
               "config":{
                  "displayArea":"subtotalContainer"
               }
            },
            "item.renderer":{
               "component":"uiComponent",
               "config":{
                  "displayArea":"defaultRenderer",
                  "template":"Magento_Checkout\/minicart\/item\/default"
               },
               "children":{
                  "item.image":{
                     "component":"Magento_Catalog\/js\/view\/image",
                     "config":{
                        "template":"Magento_Catalog\/product\/image",
                        "displayArea":"itemImage"
                     }
                  },
                  "checkout.cart.item.price.sidebar":{
                     "component":"uiComponent",
                     "config":{
                        "template":"Magento_Checkout\/minicart\/item\/price",
                        "displayArea":"priceSidebar"
                     }
                  }
               }
            },
            "extra_info":{
               "component":"uiComponent",
               "config":{
                  "displayArea":"extraInfo"
               }
            },
            "promotion":{
               "component":"uiComponent",
               "config":{
                  "displayArea":"promotion"
               }
            }
         },
         "config":{
            "itemRenderer":{
               "default":"defaultRenderer",
               "simple":"defaultRenderer",
               "virtual":"defaultRenderer"
            },
            "template":"Magento_Checkout\/minicart\/content"
         },
         "component":"Magento_Checkout\/js\/view\/minicart"
      }
   },
   "types":[

   ]
}
},


texts: Magento Ajax cart remove items not working in mini cart

texts:
I have created the custom ajax cart in magento,in that mini cart is updated without loading the page.But in that remove items link is not working,it is been redirecting to ajaxDelete action url(for eg:

http://dev.magento.com/index.php/checkout/cart/ajaxDelete/id/19/uenc/aHR0cDovL2Rldi5tYWdlbnRvLmNvbS9pbmRleC5waHAvdGVzdC5odG1s/).

Its not showing the confirm box.Code I have used for mini cart in controller is,

$mini_cart              = $this->getLayout()->getBlock('minicart_head');
$response['minicart']   = $mini_cart->toHtml();

in list.phtml I used,

if (jQuery('.header-minicart')){
        jQuery('.header-minicart').html( data.minicart );
        }

Thanks in advance.


texts: Get Ordered quantity in admin controller using the order id and product id?

texts:
I want to get the Ordered quantity for each product for that order When action is being performed on any order. How can I achieve this.

This is code:

<?php

namespace Custom\Confirm\Controller\Adminhtml\Order;

use Magento\Framework\Controller\ResultFactory;
use Magento\Backend\App\Action\Context;
use Magento\Ui\Component\MassAction\Filter;
use Custom\Confirm\Model\ResourceModel\Saleslist\CollectionFactory;

/**
 * Class Payseller.
 */
class MassConfirm extends \Magento\Backend\App\Action
{
     /**
     * @var \Magento\Sales\Api\OrderRepositoryInterface
     */
    protected $_orderRepository;

    /**
     * @var \Magento\Sales\Model\Service\InvoiceService
     */
    protected $_invoiceService;

    /**
     * @var \Magento\Framework\DB\Transaction
     */
    protected $_transaction;

    protected $_order;

    public function __construct(
        \Magento\Framework\App\Action\Context $context,
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
        \Magento\Sales\Model\Service\InvoiceService $invoiceService,
        \Magento\Sales\Model\Order $orderInfo,
        \Magento\Framework\DB\Transaction $transaction
    ) {
        $this->_orderRepository = $orderRepository;
        $this->_order = $orderInfo;
        $this->_invoiceService = $invoiceService;
        $this->_transaction = $transaction;
        parent::__construct($context);
    }

    /**
     * Execute action.
     *
     * @return \Magento\Backend\Model\View\Result\Redirect
     *
     * @throws \Magento\Framework\Exception\LocalizedException|\Exception
     */

    /**
     * Get seller for the product purchased.
     *
     * Nitin Pawar 9/11/16.
     */
    protected function _getSellersForProduct($pid)
    {
        $collection = $this->_objectManager->create(
                'Webkul\Marketplace\Model\Product'
            )->getCollection()
            ->addFieldToFilter(
                'mageproduct_id',
                $pid
            );

            $count = $collection->getData();
            return $count;

    }

    public function execute()
    {
            /** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
        $resultRedirect = $this->resultRedirectFactory->create();

        $wholedata = $this->getRequest()->getPost();

        foreach ($wholedata['selected'] as $orderId){

         $order = $this->_orderRepository->get($orderId);
                  $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
                $order_ = $objectManager->create('\Magento\Sales\Model\Order')
                                           ->load($orderId);

                 $orderItems = $order_->getAllItems();
            foreach ($orderItems as $item) {
                    $proID = $item->getProductId();
                    $itemSku = $item->getSku();
                    echo '
product id: '.$proID;
                    echo '
product sku: '.$itemSku;
                    $sellers = $this->_getSellersForProduct($proID);
                    var_dump($sellers);
                    foreach($sellers as $seller){
                        var_dump($seller); echo '
';
                    }
            }
                 exit;
                $order_->setState("processing")->setStatus("processing");

                $order_->save();

        }
        $this->messageManager->addSuccess(__('The order has been confirm. '));
        return $resultRedirect->setPath('sales/order/index');
    }

}

Here i can get the order id and product id, and i want to display the each product ordered quantity in the cart for that order.

Thanks in advance.


texts:
I'm attempting to rewrite the Hierarchy head in enterprise. Right now I just have it fire for an xdebug which I know works in other files. This is what I have that I think should be working:

app/core/local/Abc/ThemeSwitch/Block/Hierarchy/Head.php

class Abc_Themeswitch_Block_Hierarchy_Head extends Enterprise_Cms_Block_Hierarchy_Head
{
    protected function _prepareLayout()
    {
        $node = Mage::registry('current_cms_hierarchy_node');

        xdebug_var_dump($node);

        return parent::_prepareLayout();
    }
}

app/core/local/Abc/ThemeSwitch/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Abc_ThemeSwitch>
            <version>0.1.0</version>
        </Abc_ThemeSwitch>
    </modules>
    <global>
        <blocks>
            <themeswitch>
                <class>Abc_Themeswitch_Block</class>
            </themeswitch>
            <enterprise_cms>
                <rewrite>
                    <hierarchy_head>Abc_Themeswitch_Block_Hierarchy_Head</hierarchy_head>
                </rewrite>
            </enterprise_cms>
        </blocks>
    </global>
</config>

app/etc/modules/Abc_ThemeSwitch.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Abc_ThemeSwitch>
            <active>true</active>
            <codePool>local</codePool>
            <depends>
                <Enterprise_Cms />
            </depends>
        </Abc_ThemeSwitch>
    </modules>
</config>


texts: Include specific javascript configuration in Magento website

texts:
I'm just getting started with the Magento CMS and I am not sure that it can do what I need right know.
I need to include some custom javascript in every pages of my site :

One line of js code in <head>
At the end of the body a remote script like : <script src="https://..." type="text/javascript"></script> followed by some inline js.

I have seen other answer on this topic but nothing would really fit this particular requirement. Is it even possible to do something like this with magento ? (I am using Magento 2.1.5)

Thanks guys


texts:
I'm having a hard time calculating tax.

I need to have it charge New York Sales Tax anytime the BILLING address is a New York address. But it either charges tax on all orders, even when the billing address is out of state, or it doesn't charge tax at all.


texts: CE 1.9.2 - Custom sales_order_save_after observer fires twice

texts:
This has been driving me crazy for the last few hours now. I created a module to test sending Suppliers a custom email only once the order has been paid for (Order status changes to Processing). I thought everything was working well: emails were been sent, the correct data was coming through the emails ... until I realised that the emails were being sent twice.

To troubleshoot this, I skipped the email function, and instead wrote the word hello to a custom log file. And indeed hello was written twice. Here are some excerpts from my code for my custom module which is currently observing the sales_order_save_after event.

inside config.xml

<events>
    <sales_order_save_after>
        <observers>
            <test_suppliernotification>
                <type>singleton</type>
                <class>test_mod/observer</class>
                <method>notifySupplier</method>
            </test_suppliernotification>
        </observers>
    </sales_order_save_after>
</events>

inside app/code/local/Test/SupplierNotification/Model/Observer.php

class Test_SupplierNotification_Model_Observer
{
    public function notifySupplier(Varien_Event_Observer $observer) {
        $order = $observer->getEvent()->getOrder();
        $stateProcessing = Mage_Sales_Model_Order::STATE_PROCESSING;

        if($order->getState() == $stateProcessing && $order->getOrigData('state') != $stateProcessing) {
            Mage::log("hello", null, 'test_suppliernotification.log');
            return true;
        }
    }
}

output of var/log/test_suppliernotification.log

2015-10-02T01:17:49+00:00 DEBUG (7): hello
2015-10-02T01:17:49+00:00 DEBUG (7): hello

I cannot figure this one out! Has something like this happen to any of you, and if so, how did you solve it? I'm not sure what additional info you may require, so please let me know if you need to see any additional code. I'd really appreciate any assistance in this regard.

EDIT
Forgot to mention that for the particular order that I had tested, the Order status moved from Pending -> Pending Payment -> Processing.


texts:
I forgot to take note of the admin URI during installation.

Is there a way to retrieve it?


texts: UPS Negotiated Rates Not Being Applied (Magento Go V1.1.2.2)

texts:
I have escalated tickets with both Magento and UPS right now, but I don't seem to be getting very far very fast. I'm hoping one of you has run into a similar problem and can point me in the right direction.

UPS XML is configured exactly to spec: full production everything, all fields are correct. I've had both UPS and Magento review and troubleshoot my configuration. According them, it looks fine. Tests run by UPS have confirmed that my rates are functional and should be reflected in XML API.

No matter what I do, no matter how many hours I spend trying every single combination of settings, I cannot get negotiated rates to work on my Magento Go store. My shipping rates display as equal to or greater than retail prices with an error level of $5+ per package.


texts: Price not showing when creating a custom product in Magento2

texts:
I am tring to create a new product but I do not get the price enabled on the admin panel.

I create a product_types.xml with this structure:

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/product_types.xsd">
    <type name="my_product" label="My Product" modelInstance="My\Module\Model\Product\Type\MyProduct" composite="false" isQty="true" canUseQtyDecimals="false" indexPriority="30" sortOrder="20">
        <customAttributes>
            <attribute name="is_real_product" value="false"/>
            <attribute name="refundable" value="true"/>
        </customAttributes>
    </type>
</config>

Then I create the model as My\Module\Model\Product\Type\MyProduct like this:

<?php

namespace My\Module\Model\Product\Type;

use \Magento\Catalog\Model\Product\Type\Virtual;

class MyProduct extends Virtual
{
    /**
     * Product type code
     */
    const TYPE_CODE = 'my_product';
}

When I try to create a new product in the admin panel I do not get the option to input a price. What Am I missing? By the way I have tested this model with AbstractType and Simple Product too.


texts: Magento 2 category sidebar configuration

texts: I'm using magento 2 and I would like to configure my sidebar from the category page , for example , now in my sidebar I have also Compare products and My whish list , and I would like to get rid of them from there. There is any option in the admin panel to do that , or which is the file to edit so I can hide the code for that ?


texts: The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later in backend login issue

texts: I am using magento 2.3. Particular backend admin user login does not working in particular system and laptop. "Error occur : The account sign-in was incorrect or your account is disabled temporarily. Please wait and try again later." I checked locked user permission and i checked table "oauth_token_request_log". But still error occured. New user also does not working in any system and laptop sometimes. I cleared all cache and reindex. But still same issue. Please reply as soon as possible.


texts: I want to add multiple attribute on one go

texts:
How can i add multiple attributes in one script.

namespace Backadmin\Grid\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;

/**
* @codeCoverageIgnore
*/
class InstallData implements InstallDataInterface
{
    /**
     * Eav setup factory
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

    /**
     * Init
     * @param CategorySetupFactory $categorySetupFactory
     */
    public function __construct(\Magento\Eav\Setup\EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    /**
     * {@inheritdoc}
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.ExcessiveMethodLength)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create();
        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Product::ENTITY,
            'clothing_material',
            [
                'group' => 'General',
                'type' => 'varchar',
                'label' => 'Clothing Material',
                'input' => 'text',
                'source' => '',
                'frontend' => '',
                'backend' => '',
                'required' => false,
                'sort_order' => 50,
                'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
                'is_used_in_grid' => false,
                'is_visible_in_grid' => false,
                'is_filterable_in_grid' => false,
                'visible' => true,
                'is_html_allowed_on_front' => true,
                'visible_on_front' => true
            ]
        );
    }

}


texts: Missing templates after switching a theme

texts:
i have problem, i bought and installed template for my site but all of my extensions are not showing on the frontend (backend is like it should ), so this are the errors in system.log, please advice what is causing this :

  2013-09-07T18:52:43+00:00 CRIT (2): Not valid template
  file:frontend/base/default/template/mathieuf/eventscalendar/events.phtml
  2013-09-07T18:52:51+00:00 CRIT (2): Not valid template
  file:frontend/base/default/template/my_igallery/listx.phtml

Thank you


texts:
I have a multi-store magento 2 installation where the stores are totally independent, from different companies.

So, we have an integration with our ERP system in the company. Each user in our system has a specific permission only for your own store in frontend.

My problem is: a serious problem with security. A user can have access to another store by changing the store_id in REST API. Is there a way to block this?

reference: http://devdocs.magento.com/swagger/#/


texts: Magento ver. 2.1.0 - Index Management without SSH/Shell Access?

texts: Is it possible to do Index Management without SSH/Shell Access in Magento ver. 2.1.0 ?


texts: Where can I change the value for direct_url privacy-policy-cookie-restriction-mode?

texts:
Although I can edit the cookie_restriction_notice_block to change the link to the relevant Privacy Policy page I would like to be able to change the value of {{store direct_url="privacy-policy-cookie-restriction-mode"}}.

I can't see anywhere to update it in the back-end and can't find it in core_config_data table.

Any ideas where it is stored?


texts: How to give proper file and directory permission for magento localhost

texts:
Hi i am using Ubuntu 18 and apache2

when i setup magento 2 on localhost

always have file permission problems and also

whenever i run

sudo php bin/magento setup:di:compile

it will cancel all file permission

already tried comment

sudo chmod -R 777 var/www/html/myproject/*

My Question:
1)How give proper file and directory permission to my magento project


texts: Unable to view the page created through a custom module

texts:
I am using Magento CE 1.9.2.1. I wrote a custom module for just outputting "Test page Feedback". But, I am unable to access the page (facing 404 error) http://localhost/magento/index.php/feedback/index or http://localhost/magento/feedback/index. Even, I am unable to find any error in the logs.

Below is my code for the respective files:

/app/etc/modules/MYStore_Feedback.xml

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

app/code/local/MYStore/Feedback/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <MYStore_Feedback>
            <version>0.1.0</version>
        </MYStore_Feedback>
    </modules>
    <frontend>
        <routers>
            <feedback>
                <use>standard</use>
                <args>
                    <module>MYStore_Feedback</module>
                    <frontName>feedback</frontName>
                </args>
            </feedback>
        </routers>
    </frontend>
</config>

app/code/local/MYStore/Feedback/controllers/IndexController.php

<?php
class MYStore_Feedback_IndexController extends Mage_Core_Controller_Front_Action {
    public function indexAction() {
        echo "Test page Feedback";
    }
}


texts:
Should price conversion, using the built in conversion rates automatically show the converted price on the frontend?

I have a website with 5 storeviews each with a different currency.

When using the currency converter, the currency symbol changes correctly i.e. to dollars, pounds etc but the value doesnt change.  For example a product costing 29 will be 29 in dollars and pounds.  But not converted as would expect


texts: M2 - How to change Wishlist icon color after product added to Wishlist

texts:
My code:
app\design\frontend\Zero\my_theme\Magento_Wishlist\templates\catalog\product\view\addto\wishlist.phtml
<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var \Magento\Wishlist\Block\Catalog\Product\View\AddTo\Wishlist $block */
?>
<?php if ($block->isWishListAllowed()) : ?>
    <?php $_product = $block->getProduct(); ?>
    <?php $isAdded = $this->helper('Magento\Wishlist\Helper\Data')->getWishlistItemCollection()->addFieldToFilter('product_id', $_product->getId())->count(); ?>
    <?php if($isAdded): ?>
    <?= $block->escapeHtml(__('Added to Wish List')) ?>
    <?php else: ?>
       <a href="#" class="action towishlist" data-post='<?= /* @noEscape */ $block->getWishlistParams() ?>' data-action="add-to-wishlist"><?= $block->escapeHtml(__('Add to Wish List')) ?>
    <?php endif; ?>
<?php endif; ?>

CSS:
app\design\frontend\Zero\my_theme\Magento_Wishlist\web\css_extend.less
.action.towishlist.already-added{color: #ff0000 !important;}

After the item added to the wishlist the wishlist icon color not update.


texts: Cannot get configurable product to show after adding via PHP without running full index

texts:
Been stuck on this for hours spinning my wheels. I have script that builds some products based off a CSV. First it builds a few simple products, then a configurable product with those simple products assigned to it. Everything works fine, except the configurable product will not show up on the frontend without either opening it and saving it in the admin after the script, or running an re-index. Here are the facts so far:

The simple products show up fine.

The configurable product WILL show up correctly if I assign it to simple products previously created instead of the simple products in the same script run. This includes simple products created B

I am using the  admin store set

Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);

I did try changing the index setting before and then after the script

$processes = Mage::getSingleton('index/indexer')->getProcessesCollection();
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL));
$processes->walk('save');
script
$processes->walk('reindexAll');
$processes->walk('setMode', array(Mage_Index_Model_Process::MODE_REAL_TIME));
$processes->walk('save');

So the only thing left I can think to do is add a button that the user can press when they're all done that starts the indexing process, but that takes for ever with the product database that we have now, so I was really hoping to avoid having to do that.


texts:
I am  trying to create tab on frontend with ajax call.

I created phtml file and put these code:

google

yahoo

rediff

youtube

            <?php
            $p = $_GET['id'];
            switch($p) {
        case "1":
            echo '
google
Content goes here !
';
            break;
        case "2":
            echo 'yahoo ?
';
            break;
        case "3":
            echo 'My rediff content goes here...
';
            break;
        case "4":
        default:
            echo 'youtube status update :)
';
            break;
            }
            ?>

and js code used:

</style>

but its not worked, because in navcontainer,the href is wrong. if I put code in controller then how should I call it here to show in tab content?


texts: Magento 2.2 Rest Api creating same url-key for different product names

texts:
has anyone already faced the problem in Magento 2.2, that you have two different product names and magento creates the same url-key for both? Like:

name: Product Name 1 url-key: product-name-1

name: Product Name 2 url-key: product-name-1

I´m having this problem right now. I´m posting two different products with different product names and magento is just adding one product to the store and I wondered why. So I had a look at my posted content and the response from magento. And magento is using the url-key from product 1 for product 2, even though I have two separate posts to the api for these two products. Can´t explain why magento is doing this and I haven´t found any solution to it or problem/bug for Magento 2.2, but implement and post my own url-key. I also deleted the url-keys in url_rewrite database.

I´ve already added lots of products in same kind of post without any problem.


texts: Error Consumer is not authorized to access %resources

texts:
It seems that similar questions have been asked but none seem to solve my specific problems. We have developed a routine to automatically update and create product information using the REST API. This routine has been working in our test environment for some time and also working on a couple of other customer sites.  Two weeks ago after a godaddy error/update the REST API stopped working with the error:-

{
    "message": "Consumer is not authorized to access %resources",
    "parameters": {
        "resources": "Magento_Catalog::products"
    }
}

We have tried talking to godaddy, to c-panel but to no avail. We resorted, in our test environment, to do a completely new install of magento2 (2.1.9) and even with this we still get the error.

After re-installing we generate the Integration Access Token

We use the 'access token' to try a simple test and select the products
(html version)

GET /rest/V1/products?searchCriteria[page_size]=0 HTTP/1.1
Host: mysite.com
Authorization: Bearer 7l20v2kyp9g7o2jug772soeexn6eyonj
Cache-Control: no-cache
Postman-Token: 4f6d6368-0d05-4f09-a793-6e9aa679e414

and this returns the "Consumer is not authorized error'.

Does anyone have any ideas as to why we get this error and how to solve it?

php version is 7.0.30

Since we host on godaddy we don't have access to root previlidges but don't believe we should need these as before it was working.


texts: Create a sortable and filterable custom attribute to stand-alone entity

texts:
I would like to add a custom attribute type that allows an admin to assign a product to a custom entity by name. The end user should be able to sort and filter by the same custom entity.

For example think about a custom entity which is (for example) a region where the product is produced, this region has got many fields amongst which a name, id, and image. All products are assigned to one region. The end user could be interested in products produced only in one certain region and therefore would like to be able to filter on this custom attribute.

I have already created a custom stand-alone entity with a setup script that look like:

$installer = $this;
$installer->startSetup();

$connection = $installer->getConnection();

if($connection->isTableExists("company_custom_region")){
    $connection->dropTable("company_custom_region");
    $connection->commit();
}

$table = $connection
    ->newTable($installer->getTable('company_custom/region'))
    ->addColumn('id', Varien_Db_Ddl_Table::TYPE_INTEGER, null, array(
        'identity'  => true,
        'unsigned'  => true,
        'nullable'  => false,
        'primary'   => true,
    ), 'ID')
    ->addColumn('name', Varien_Db_Ddl_Table::TYPE_TEXT, 0, array(
        'nullable'  => false,
    ), 'Name')
    ->addColumn('image', Varien_Db_Ddl_Table::TYPE_CLOB, 0, array(
        'nullable'  => false,
    ), 'Image')
;

$installer->getConnection()->createTable($table);

$installer->endSetup();

The next step is to add a custom attribute source by extending the above with the following:

$installer->addAttribute('catalog_product', 'product_type', array(
        'group'             => 'Production region',
        'label'             => 'Region',
        'note'              => '',
        'type'              => 'int',
        'input'             => 'select',
        'frontend_class'    => '',
        'source'            => 'sourcetype/attribute_source_type',
        'backend'           => '',
        'frontend'          => '',
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_WEBSITE,
        'required'          => false,
        'visible_on_front'  => false,
        'apply_to'          => 'simple',
        'is_configurable'   => false,
        'used_in_product_listing'   => false,
        'sort_order'        => 5,
    ));

And then add a custom source type which returns the entity options using the getAllOptions() method:

    public function getAllOptions(){
        $collection = Mage::getModel('company_custom/region')->getCollection()->setOrder('id','asc');

        if (!$this->_options) {
            $this->_options = array();
            foreach($collection as $data){
                $this->_options[] = array(
                    'value' => $data->getData('id'),
                    'label' => $data->getData('name')
                );
            }
        }
        return $this->_options;
    }
}

So far this seems to be pretty straightforward, but the part I am missing is how to extend this custom entity (or the source type) to allow this to be used for sorting and filtering.

My best clue so far is the post by Inchoo: http://inchoo.net/ecommerce/magento/how-to-create-custom-attribute-source-type/ where the addValueSortToCollection($collection, $dir = 'asc') method is implemented.

I cannot find a great deal of information on this method and how to use it, so any hints in the right direction are very welcome!


texts: Getting configurable product id by simple product's attribute id

texts:
Every configurable product has own product id as you know.

When I select medium (in this example) I want to get 26, when I select large I want to get 28 etc.

I think the only way to do that using attribute id, right? How can I get product id using option's attribute id? Or another way?


texts: What encryption model does Magento1 use?

texts:
I want to know what encryption methods are used by Magento.

Is it simple md5 or salted or SHA? Where can I look into it in detail?

I looked for code for md5 encryption in Mage_Core_Model_Encryption, which is used to encrypt passwords. I can also see encrypt and decrypt. What are they used for? Encrypting user info or something else?


texts: Magento 2 Modified Product Cache file not being used

texts:
Why are optimized files that I manually add to "pub/media/catalog/product/cache" not being served.

I have optimized product images that are much smaller than those automatically created in "pub/media/catalog/product/cache". So I copied over the files in the cache, but these files are still not loading in the web browser.

See Image:

What do I need to do to make my manually added files to cache be served in a web browser?

Thanks.


texts:
I'm trying to put the client name on a little screen, I saw that when you enter the site it displays the user name, I tried to use the same function, but in mine it is not working.

Magento code

<?php echo $this->__('Hello, %s!', $this->escapeHtml($this->getCustomerName())) ?>

<?php echo $this->__('From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.') ?>

My code

<?php echo $this->__('Hello, %s!', $this->escapeHtml($this->getCustomerName())) ?>


texts: Magento registration - customer save information into shipping and billing

texts:
When a user registers with us then Magento automatically save customer first name and last name into shipping and billing address.

Address fields are not displaying at the registration page and I don't want to save this information into the shipping and billing address.


texts: A Custom module that uses a JavaScript script breaks functionality

texts:
I have created a custom module that is simply a link that shows a modal with a picture on it. I have connected the module with an attribute and the module works for that specific product attribute. However in the rest of the products, I get an error in Google Inspector, plus the functionality breaks (i.e. Product image not loading and cart content is not visible).

Any ideas? Thank you in advance

The template code:

  Vendor/Module/view/frontend/templates/catalog/product/view/addto.phtml

<?php
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */

// @codingStandardsIgnoreFile

/** @var $block \Magento\Catalog\Block\Product\View*/
?>

<?php
$product = $block->getProduct();
?>

<?php if( $product->getData('size_chart') ): ?>

<?php
$sc = $product->getData('size_chart');
$sc = 'Vendor_Module::documents/' . $sc . '?iframe=true';
?>

Size Chart

    <img src="<?php echo $this->getViewFileUrl($sc); ?>"/>

<?php endif; ?>

    <?= $block->getChildHtml() ?>

And the error that I inspect in Google:

jquery.js:3762 Uncaught TypeError: Cannot read property 'nodeName' of undefined
    at acceptData (jquery.js:3762)
    at internalData (jquery.js:3830)
    at Function.data (jquery.js:4031)
    at $.(anonymous function).(anonymous function)._createWidget (https://leptokaropoulos.gr/pub/static/version1529493861/frontend/Infortis/lepto/el_GR/jquery/jquery-ui.js:545:6)
    at new $.(anonymous function).(anonymous function) (https://leptokaropoulos.gr/pub/static/version1529493861/frontend/Infortis/lepto/el_GR/jquery/jquery-ui.js:363:9)
    at $.(anonymous function).(anonymous function) (https://leptokaropoulos.gr/pub/static/version1529493861/frontend/Infortis/lepto/el_GR/jquery/jquery-ui.js:357:11)
    at joust-duffle-bag:1516
    at Object.execCb (require.js:1650)
    at Module.check (require.js:866)
    at Module.<anonymous> (require.js:1113)


texts: Magento 2 - mesg: URL key for specified store already exists.and I know it doesn't

texts:
In Magento 2, when I try to change URL key for a category, I get this message:"URL key for specified store already exists.". This is my code:

$this->logger->log("id is: " . $c->getId(), true);
$c->load($c->getId());
$newUrlKey=$c->getUrlKey() . "-baba" . $count++;
$this->logger->log($newUrlKey, true);
$c->setUrlKey($newUrlKey);
$this->logger->log($c->getData(), true);

$c->save();

But I know there is no other category with this url key. What is the problem with Magento here?


texts:
We have a magento website on /store folder.
Idea is, on root folder, index.php will have company website.

/store folder will have magento folder.

Idea is, www.example.com/account should load login form from

www.example.com/store/customer/account/login/

and

www.example.com/account/register

should load register form from

www.example.com/store/customer/account/create/

Can we do this using .htaccess?

I was trying following code

RewriteEngine on
RewriteCond %{REQUEST_URI} !^/account
RewriteRule ^(.*)$ /store/customer/account/login/ [NC,L]

this code redirects to /accounts to /store


texts:
I discovered, that Magento2 (1.0.0-beta2) is not storing the theme name (like Example_default) but an id in the system configuration:

$ n98-magerun2.phar config:get "*theme*"
+------------------------+---------+----------+--------+
| Path                   | Scope   | Scope-ID | Value  |
+------------------------+---------+----------+--------+
| design/theme/theme_id  | default | 0        | 4      |

There is a database table theme containing this theme id:

My question: What would happen if I insert a new theme? Can it also get the ID 4 - for example when clearing the cache - and so suddenly switching the theme of the shop?


texts:
I am using this API to search a word apple in all website

https://domain.com/index.php/rest/V1/search?searchCriteria[currentPage]=1&searchCriteria[requestName]=quick_search_container&searchCriteria[filterGroups][0][filters][0][field]=search_term&searchCriteria[filterGroups][0][filters][0][value]=apple

Is there is a parameter can be added to search in a specific category?


texts: Magento2: he website with code plpl that was requested wasn't found. Verify the website and try again

texts:
I have main website with code base with url: www.firstweb.com
I have created second website store with code plpl with url www.secondweb.com
This main first web working normally. But For second web I get issue:
1 exception(s):
Exception #0 (Magento\Framework\Exception\NoSuchEntityException): The website with code plpl that was requested wasn't found. Verify the website and try again.

Exception #0 (Magento\Framework\Exception\NoSuchEntityException): The website with code plpl that was requested wasn't found. Verify the website and try again.
<pre>#1 Magento\Store\Model\StoreResolver\Website->getAllowedStoreIds('plpl') called at [vendor/magento/module-store/Model/StoresData.php:65]
#2 Magento\Store\Model\StoresData->getStoresData('website', 'plpl') called at [vendor/magento/module-store/Model/StoreResolver.php:138]
#3 Magento\Store\Model\StoreResolver->getStoresData() called at [vendor/magento/module-store/Model/StoreResolver.php:97]
#4 Magento\Store\Model\StoreResolver->getCurrentStoreId() called at [vendor/magento/framework/Interception/Interceptor.php:58]
#5 Magento\Store\Model\StoreResolver\Interceptor->___callParent('getCurrentStoreI...', array()) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#6 Magento\Store\Model\StoreResolver\Interceptor->Magento\Framework\Interception\{closure}() called at [vendor/magento/framework/Interception/Interceptor.php:153]
#7 Magento\Store\Model\StoreResolver\Interceptor->___callPlugins('getCurrentStoreI...', array(), array(array('feedStoreResolve...'))) called at [generated/code/Magento/Store/Model/StoreResolver/Interceptor.php:23]


texts: password_hash convert into simple md5 format

texts: How to export all customers in simple username , email, and simple md5 format csv.


texts:
I just received this email below. There usually is something under the ‘Reason’ heading, however there is nothing here.

  Payment transaction failed.

  Reason

  Checkout Type onepage

  Customer: Sakthi Anand Velusamy


texts: Notice: Undefined offset in Algorithm.php

texts:
I experience a strange error which is filling up var/system.log:

  2016-01-18T17:04:25+00:00 ERR (3): Notice: Undefined offset: 22  in /chroot/home/www/files/html/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php on line 366
  2016-01-18T17:04:25+00:00 ERR (3): Notice: Undefined offset: 0  in /chroot/home/www/files/html/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php on line 368
  2016-01-18T17:04:25+00:00 ERR (3): Notice: Undefined offset: -1  in /chroot/home/www/files/html/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php on line 384
  2016-01-18T17:04:25+00:00 ERR (3): Notice: Undefined offset: -1  in /chroot/home/www/files/html/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php on line 395
  2016-01-18T17:04:26+00:00 ERR (3): Notice: Undefined offset: 20  in /chroot/home/www/files/html/app/code/core/Mage/Catalog/Model/Layer/Filter/Price/Algorithm.php on line 366

Unfortunately I had no luck debugging it. I could not narrow down the issue nor find any related overwrites.

The site is running on Magento ver. 1.9.2.0 and PHP Version => 5.3.24

Any ideas what could cause the issue?


texts:
I have a scenario whereby I need the following currency requirements out of my Magento 1 website.

Three currencies GBP, USD, EUR
GBP is base currency for UK orders
USD is base currency for US orders
EUR is base currency for European orders

I have identified that I need to have 3 different website views to achieve this.

The complication is that the USD price has to be a direct conversion of the GBP price but without tax. The EUR price has to be a direct conversion of the GBP price but with tax. The base currency must also be maintained for each country as specified above.

Does anybody know of a way of doing this by default in Magento or would I need an extension/custom solution.


texts:
I have try to create custom module in magento 2 but i have got error like

Fatal error: Cannot declare class Product, because the name is already in use in /var/www/mymagento/app/code/Plus/Demo/Model/Product.php on line 2

Here is my Product.php

<?php
class Product {
public function sayHello() {
    echo "hi";
  }
}

And here is my test.php

<?php

use Magento\Framework\App\Bootstrap;

require __DIR__ . '/app/bootstrap.php';

$params = $_SERVER;

$bootstrap = Bootstrap::create(BP, $params);

$obj = $bootstrap->getObjectManager();

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

$quote = $obj->get('Plus\Demo\Model\Product');
//I have created say fucntion under Product.php file
echo '<pre>';
print_r($quote->sayHello());
echo '</pre>'; */

I tried but i still can not success.

Thanks in advance

TRY


texts:
I'am a newbie to Magento. I stacked on followed problem: i have db table with config settings (name/value) and want add functionality to change this data via admin area. By default, when I click on menu item "Config" data showing as grid ie as a table with 2 columns and when I click on row, I see the form, where I can change only one pair name/value. But I want to change all values at one page like System-Tools-Compilation. Please help me to solve this task.

UPD:

I create a controller:

app\code\local\PCG\Mod\controllers\Adminhtml\ConfigController.php with following code:

class PCG_Mod_Adminhtml_ConfigController extends Mage_Adminhtml_Controller_Action

    public function indexAction()
    {
        $this->loadLayout();
        $this->_setActiveMenu('pcgmod');
        $this->_addContent($this->getLayout()->createBlock('pcgmod/adminhtml_config_edit'));
        $this->renderLayout();
    }

}

Then create Edit block:

../Block/Adminhtml/Config/Edit.php with following code:

class PCG_Mod_Block_Adminhtml_Config_Edit extends Mage_Adminhtml_Block_Widget_Form_Container {

    public function __construct()
    {
        echo "edit works";
        parent::__construct();
        $this->_controller = 'adminhtml_config';
        $this->_updateButton('save', 'label', Mage::helper('adminhtml')->__('Save config'));
        $this->_removeButton('reset');
        $this->_removeButton('back');
    }
}

After that I create form:
..Block/Adminhtml/Config/Edit/Form.php with following code:

class PCG_Mod_Block_Adminhtml_Config_Edit_Form extendsMage_Adminhtml_Block_Widget_Form
{
    protected function _prepareForm()
    {
       echo "form works";
    }
}

I expect to see "form works", but I see only "edit works". What I do wrong?


texts: Error message after trying to install recaptcha:2.0.0 on Magento Open Source 2.2.x

texts:
Included in Magento documentation the following steps to install Google recaptcha:2.0.0 on Magento Open Source 2.2.x:

composer require msp/recaptcha:2.0.0

This code did not work, therefore, I tried the code below (based on the recommendation I received from my other post)

composer require msp/recaptcha

I encountered the following:


texts:
Magento 2:- How to get customers now online?

Want to get all customers data current login.


texts: Magento 2 Mini Cart values with Full Page Cache

texts:
Running Magento 2.1.10 CE, with multiple stores.

We have all the cache enabled, with Full Page Cache running with Varnish.
Having an issue with the minicart values since enabling cache

Steps:
1- Open an individual product page (frontend)
2- clicked add to cart button,
3- Minicart is updated with the count and the content
4- Refresh the page, Minicart shows that the cart is empty
5- Open the cart page (www.site.com/checkout/cart), the count on the mini cart is correct!

When I disable the FullPageCache, it shows the correct count.

I have edited the minicart.phtml file and take out most of the knockout js code. Replaced it with the following

$helper = $this->helper('\Magento\Checkout\Helper\Cart');
$quote = $helper->getQuote();
$quoteitems = $quote->getAllItems();
$totalItemsCount = $helper->getSummaryCount();
echo $totalItemsCount; exit;

On individual product pages, the output is empty, but on cart page the value is correct.

One issue is that we do not cache the cart and checkout pages. With the above code, the value returned is correct, but on other CACHED pages, the value is empty, although. the values on all other cached pages gets updated with the sections ajax call, it does not update on the individual page!

UPDATE

One more thing is with Varnish Full Page Cache enabled,, i am not able to get Customer Session on the cached pages. Need the session to set customer menu in the header! Even after login, the cached pages display the Login form in the header file.


texts: Magento 2 - Custom registration and login with external system

texts: I have an external system that stores all the customer accounts. I need to integrate it with Magento so that when a user logins or registers, Magento calls a API of the external system to do the registration and authentication. Which classes should I override or modify to achieve this?


texts: How to add a discount or apply a cart rule programmatically to quote in checkout_submit_before observer Magento 2

texts:
I want to apply some discounts amounts to the the quote, the observer I'm using is checkout_submit_before. There I have the access to the quote and order objects.
How can I apply a cart rule or a custom discount amount to the quote?
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$coupon['name'] = 'group_product';
$coupon['desc'] = 'Cart Rule for Grouped Products';
$coupon['start'] = date('Y-m-d');
$coupon['end'] = '';
$coupon['max_redemptions'] = 1;
$coupon['discount_type'] = 'by_fixed';
$coupon['discount_amount'] = $discountAmount;
$coupon['flag_is_free_shipping'] = 'no';
$coupon['redemptions'] = 1;
$coupon['code'] = $quote->getId();

$shoppingCartPriceRule = $objectManager->create('Magento\SalesRule\Model\Rule');
$shoppingCartPriceRule->setName($coupon['name'])
    ->setDescription($coupon['desc'])
    ->setUsesPerCustomer($coupon['max_redemptions'])
    ->setCustomerGroupIds(array('0', '1', '2', '3',))
    ->setIsActive(1)
    ->setSimpleAction($coupon['discount_type'])
    ->setDiscountAmount($coupon['discount_amount'])
    ->setDiscountQty(1)
    ->setTimesUsed($coupon['redemptions'])
    ->setWebsiteIds(array('1'))
    ->setCouponType(2)
    ->setCouponCode($coupon['code'])
    ->setIsAdvanced(true)
    ->setStopRulesProcessing(false)
    ->setDiscountStep(0)
    ->setUsesPerCoupon(NULL);
$shoppingCartPriceRule->save();
$quote->setCouponCode($coupon['code']);

currently, I'm trying code but got no luck, maybe do I have to change the observer?


texts: Magento2 - missing adminhtml custom block after upgrade to 2.2

texts:
We had a custom block injected in the adminhtml section. This block is managed in a module (let's call it Vendor/Module) & it was working fine in Magento 2.1.*, following this methodology magento 2 - How to create a custom "admin" block and display it on an existing Admin page?

After upgrading to 2.2 the block has disappeared

I have checked for the concrete layout (in our case sales_order_view.xml) for any structural changes in the new version, but containers & blocks look the same as we had in 2.1.*

Any ideas for this?

This is the concrete layout file which worked fine in 2.1.*

app/code/Vendor/Module/view/adminhtml/layout/sales_order_view.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="order_info">
            <block class="Vendor\Module\Block\Adminhtml\Sales\Order\View\Form" name="our_unique_block_name" template="Vendor_Module::our_template.phtml"/>
        </referenceBlock>
    </body>
</page>

UPDATE

Bounty: provide XML code to inject a block inside sales_order_view adminhtml layout, explaining how to place it in different sections of the page


texts: TAblerates upload: something went wrong with importing tablerates

texts:
When importing the tablerates i get the message:

  something went wrong

when importing the tablerates.

I can't find the reason why, could you give me a hint? On the internet i could not find anything. Configuration is on mainwebsite, price vs destination.


texts: Upgrade 2.2.6 - 2.3.1 -> Table staging.queu doe not exist

texts:
I have followed all procedures to update correctly.
After composer is updated and we run 'php bin/magento setup:upgrade' we get a strange error. Please see image attached.

Error is Base Table or view not found:1146 Table 'ortlieb_staging.queue' doesn't exit.

So I have trouble in understanding how to solve this.
Creating a 'queue' table is not the solution according to me.

If somebody can advise on what to do to solve this that would be great.
Please note all update steps before the 'upgrade' command were done according to documentation of Magento.


texts: How to configure Category product listings in Mobile?

texts:
We knew the steps to configure the product listings in Magento 2 on Desktop view and done successfully as per our need. Now, we wanted to show 2 products per row in portrait mode and 3 products per row in landscape mode on Mobiles.

We have configured to show 5 products per row in desktop view on Category pages. Because of this, we are getting an empty space in mobile.

Have read the posts regarding the product listings but none of the solutions are working for us.

We have also tried in adjusting the width of product listing grid but that too is not working.

Could anyone please guide me with this?


texts: Some transactional emails are not being sent

texts:
I have SMTP PRO in Magento 1.9 hosted on AWS.
The new account emails, and comments work well, but the email of new orders, change of status and billing are not sent.

I have no errors or helpful information from the system logs.

What additional steps should I take to resolve this?


texts: Adding Google Customer Reviews to Magento Success Page

texts:
I'm trying to add the google customer reviews opt-in survey to my order confirmation page using the code below.  The script appears to be working, pulling the correct order information.  However, there is no box in the middle of the screen for the customer to opt-in to the survey as google suggested there would be.  If anyone has had any success implementing this on Magento 1.9 please help in any way you can.

Thank you.

<?php
    $orderId = Mage::getSingleton('checkout/session')->getLastOrderId();
    $order = Mage::getModel('sales/order')->load($orderId);
    ?>
    <script src="https://apis.google.com/js/platform.js?onload=renderOptIn"async defer></script>

    <script>
    window.renderOptIn = function() {
        window.gapi.load('surveyoptin', function() {
            window.gapi.surveyoptin.render(
                {
                    "merchant_id": 112592416,
                    "order_id": "<?php echo $order->getIncrementId() ?>",
                    "email": <?php echo $order->getCustomerEmail() ?>,
                    "delivery_country":  "<?php echo $order->getShippingAddress()->getCountryId() ?>",
                    "estimated_delivery_date": "<?php $date = date("Y-m-d"); $mod_date = strtotime($date."+ 6 days"); echo date("Y-m-d",$mod_date); ?>"

                });
        });
    }
    </script>

<!-- END GCR Opt-in Module Code -->


texts: Can't Enable Module through the Web Setup Wizard

texts:
I'm having some problems with my Magento2 setup.

I've installed a several extensions/modules that are having trouble actually installing and becoming part of our system.

I normally install with composer, do a setup:upgrade and static:code:deploy using cli.

While the module shows enabled in app/etc/config.php and in magento module:status, when I go to the Web Setup Wizard it's not enabled.

Furthermore, when I click on "Enable" in the Web Setup Wizard, the module name is replaced with "Null" and the readiness check fails almost completely.

Any thoughts? What am I doing wrong here?

Steps to recreate.

Open Magento2.3
Select the "Web Setup Wizard" by going to System >
Web Setup Wizard
Select the Module Manager
Find some Module that isn't enabled
Click Enable
Start Readiness Check


texts:
SyntaxError: expected expression, got '.'
    .updateElement.value = this.getChecked().join(', ');

I have get above error & not load data from options when edit conditions option when change other elements.


texts:
I need to add some jQuery script to home page.

Following docs:
http://devdocs.magento.com/guides/v2.2/javascript-dev-guide/javascript/js-resources.html

I have my.js file with inside:

require(["jquery"], function($){
   //my code
});

but in the console i've got thi error:

  TypeError: require is not a function

Which is the correct way to add e js file in the homepage only?

EDIT:

the problem seems to be that the js is loaded before all the others, including jquery, when it is inserted in the <head> tag

How to make it to be load at the end of the que?


texts: Is it possible to override a vendor module's di.xml file in Magento2?

texts:
So a module installed via composer lives in vendor/module, and I'd like to change its etc/di.xml from this:
    <virtualType name="customCategoryCollection" type="Magento\CatalogSearch\Model\ResourceModel\Fulltext\Collection">
        <arguments>
            <argument name="searchRequestName" xsi:type="string">catalog_view_container</argument>
        </arguments>
    </virtualType>

To this:
    <virtualType name="customCategoryCollection" type="Custom\Module\Model\ResourceModel\Fulltext\Collection">
        <arguments>
            <argument name="searchRequestName" xsi:type="string">catalog_view_container</argument>
        </arguments>
    </virtualType>

Is that possible without editing the vendor/module di.xml?


texts: magento 2 - How to create new object Product?

texts:
How to create new object Product ?
Example:

$product = new Product();
$product->sku = 'fdfds';
...
$product->save();


texts: Magento 1.9 - Call custom attribute in cart and success pages

texts:
I'm trying to call a custom attribute in the cart.phtml and success.phtml pages so that a module can see the text that is contained. The attribute is a dropdown that isn't visible on the frontend at all.

The attribute contains a keyword that the module searches for, if the keyword is found, different finance options appear.

I've got this working on the product page by adding the following to view.phtml and it works perfectly but using the same/similar code on cart.phtml and success.phtml does not work:

$pro->getAttributeText('my_attribute')

I've done some searches and found that I needed to create a custom module and add the attribute in the config.xml of this module but that didn't work. My php knowledge isn't great so I'm sure I'm missing something.

This is what the snippet of code looks like from cart.phtml:

$prodname = "";

if($cart->getAllItems()):
    foreach ($cart->getAllItems() as $item):
        $prodname .= "|||".$item->getProduct()->getAttributeText('my_attribute').$item->getProduct()->getName();
    endforeach;
endif;

I've also tried with $_item and without the ->getProduct() with no luck.

In the admin panel I can see my custom module where I've put the config.xml is enabled. This is the config.xml:

<config>
<modules>
<module_name>
<version>0.0.1</version>
</module_name>
</modules>
    <global>
        <sales>
            <quote>
                <item>
                    <product_attributes>
                        <my_attribute />
                    </product_attributes>
                </item>
            </quote>
        </sales>
    </global>
</config>

Help me stackexchange, you're my only hope


texts: Magento2 check which rules are applied on checkout page

texts: Magento2 How can I check which rules are applied on checkout page & how can I stop any one of this rule from processing further?


texts: What template does the Fooman Email Attachments use for Print

texts:
Fooman Email Attachments extension gives you the option to print from the order page before an invoice is actually created (exactly what I need). I'm curious though what template (if any) it uses when I click the "print" button.

I tried looking in the documentation for the extension but found nothing. http://cdn.fooman.co.nz/media/custom/upload/UserManual-FoomanEmailAttachments.pdf

I want to add some of what shows up on the PDF when you click PRint from the order summary page.

Extension URL:

http://store.fooman.co.nz/extensions/magento-extension-email-attachments.html


texts: Customer custom value not saving to customer_enitity table

texts:
I have created new column in customer_entity table

class UpgradeData implements UpgradeDataInterface{

    public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        if (version_compare($context->getVersion(),'1.0.6'<0)){

            $customerName = $setup->getTable('customer_entity');

            if ($setup->getConnection()->isTableExists($customerName) == true) {

                $connection = $setup->getConnection();

                $connection->addColumn(
                    $customerName,
                    'family_name',
                    [
                        'type' => \Magento\Framework\DB\Ddl\Table::TYPE_TEXT,
                        'length' => 100,
                        'nullable' => true,
                        'comment' => 'Family Name'
                    ]
                );
            }
        }
}

and i am creating a customer programmatically.

$customerFactory = $this->_objectManager->get('\Magento\Customer\Model\CustomerFactory');
$newCustomer = $customerFactory->create();
$newCustomer->setWebsiteId($this->_storeManager->getWebsite()->getId());
$newCustomer->setEmail('email@email.com');
$newCustomer->setFirstname('First name');
$newCustomer->setLastname('Last name');
$newCustomer->setPassword('Password');
.....
$newCustomer->setData('family_name', $externalUser['FamilyName']);
$newCustomer->save();

But only family_name (custom field) is not storing in customer_entity table.

Is this the proper way to store custom field ?

$newCustomer->setData('family_name', $externalUser['FamilyName']);

any idea?


texts: update stripe information into magento 2.3 orders using rest api

texts:
I am creating an order using rest API in Magento 2.3, Order created using cash on delivery payment method.

In my scenario need to create an order using stripe payment gateway method.

Cash on delivery payment method payload:

"payment": {
            "method": "cashondelivery",
            "amount_paid":100
        },

My Question:
1. How to send the stripe token in payment information


texts: Magento 2 : Set My Account Page Title with customer name

texts:
I want to change page title of My Account Page only like below:

  welcome back, Customer.firstname()

How I can change my account page title only with customer firstname?


texts: Backend order with paypal payment method

texts:
I configured paypal and it's working fine on frontend, but I also need to create orders on backend. But I can't choose paypal as a payment method. Why is that?

Other methods are available.


texts: Magento 2 - How do i edit qty in partial invoice?

texts:
I want to edit qty in the partial invoice on my live website but won't be able to edit that for pending payment status, it's working fine for pending payment status. Attaching a screenshot for your reference.

But the same thing is working on my staging for the same payment status attaching a screenshot for your reference

So my question is, is there any setting to enable qty edit on the partial invoice for pending payment status? Pls, help!


texts: Calculate total price of cart depending on quantity

texts:
I am trying to setup 3 different tier prices (all of which are in the same category):

0-5 products - £2.50
6-10 products - £5
11-20 products - £10

Note: Creating Tier pricing will not work, as I have numerous colors of these products. For example: Let's say I order 4 products from:

Product A (blue)
Product B (green)
Product C (black)

...Equalling 12 products.

The cart would need to adhere to the consumer purchasing '11-20 products', not '0-5 products' for each item. Therefore category tier pricing would not work in this instance.

Essentially, I am trying to create something like this:
Want to apply set prices based on quantity in cart (tier prices for multiple products)

However, it's going to be a little trickier to implement when I have ranges in the tier pricing.

Edit: Partly found the solution. I have had to set up 20 individual rules which sets up a specific discount for the amount of products in the basket, view below:

https://gyazo.com/f8f6e5b033836aeb82abb5d2477766f8 - Rule fires when 15 products are in the basket from a particular category
https://gyazo.com/3367fb8df96b64ee5c639fc943723aa8 - Applies 2.50 discount, but only to 11 products (£2.50 * £4 = £10).

However, the problem is that this ONLY works for 1 product. If I add, say, 6 green products and 9 red products (15 overall, which should charge £10), the discount does do not work because the Maximum Qty Discount is Applied To field only works for a specific product.

Any workarounds for this? I feel like the only way to fix this would be a Magento plugin. If there are any free ones around which will help for this, please let me know!